SAS 或 SPSS 中的精确二项式检验?

发布于 2024-09-06 16:12:30 字数 254 浏览 1 评论 0原文

我有 400,000 行,每行都有一个 id、试验次数和成功次数。

我有(一个)p 值,即假设的成功概率。

我想使用其试验成功率和全局 p 来计算每一行的精确、二项式、单侧 p 值。

例如,

1001 10 2

应该给我

对于 2 次或更多成功的概率,

1001 10 2 2.639011e-01。我更喜欢 SAS 中的解决方案,但 SPSS 也很有用。

谢谢!

I have 400,000 rows, each with an id, number of trials, and number of successes.

I have (one) value for p, a hypothesized probability of success.

I'd like to calculate an exact, binomial, one-sided p-value for each row, using its trials successes, and the global p.

E.g.,

1001 10 2

should give me

1001 10 2 2.639011e-01 for the probability of 2 successes or more.

I'd prefer a solution in SAS, but SPSS is also useful.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南冥有猫 2024-09-13 16:12:30

您可以直接使用二项式分布:

data yourdata;
   set yourdata;
   p_lower = PROBBNML(globalp, ntrials, nsuccesses);
   p_higher = 1 - PROBBNML(globalp, ntrials, nsuccesses-1);
run;

我尚未测试 PROBBNML 是否适用于 -1 响应,因此您可能需要在使用 p_higher 公式之前测试 nsuccesses=0

You can use the binomial distribution directly:

data yourdata;
   set yourdata;
   p_lower = PROBBNML(globalp, ntrials, nsuccesses);
   p_higher = 1 - PROBBNML(globalp, ntrials, nsuccesses-1);
run;

I have not tested whether PROBBNML will work with -1 responses, so you might need to test for nsuccesses=0 before using the p_higher formula.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文