楼主: baojiwolong
28605 13

[原创博文] 泊松分布95%置信区间计算 [推广有奖]

  • 0关注
  • 8粉丝

博士生

58%

还不是VIP/贵宾

-

威望
0
论坛币
471 个
通用积分
7.0900
学术水平
15 点
热心指数
32 点
信用等级
12 点
经验
7644 点
帖子
167
精华
0
在线时间
453 小时
注册时间
2007-2-1
最后登录
2024-3-27

100论坛币
如题:
总数  失败数  估计失败率(%,95% CI)
347       7            2.02(0.96-4.23)

code该如何写?

最佳答案

jingju11 查看完整内容

Contrast Estimate Results Mean Mean L'Beta Standard Label Estimate Confidence Limits Estimate Error Alpha rate 0.0202 0.0096 0.0423 -3.9034 0.3780 0.05 Exp(rate) 0.0202 0.0076 0.05 Co ...
关键词:泊松分布 置信区间 code 如何写 ODE 置信区间 如何

本帖被以下文库推荐

沙发
jingju11 发表于 2010-8-9 22:58:46 |只看作者 |坛友微信交流群
  1. data have1;
  2. y =7; n =347;
  3. log_n = log(347);
  4. run;
  5. ods select Estimates;
  6. proc genmod;
  7. model y=/dist =poisson offset =log_n;
  8. estimate 'rate' intercept 1/exp;
  9. run;
复制代码
Contrast Estimate Results
                 Mean            Mean                         L'Beta          Standard
Label        Estimate      Confidence Limits     Estimate       Error      Alpha
rate           0.0202         0.0096      0.0423     -3.9034         0.3780      0.05
Exp(rate)                                                        0.0202          0.0076     0.05
                Contrast Estimate Results
                    L'Beta                       Chi-
Label          Confidence Limits     Square    Pr > ChiSq
rate             -4.6442     -3.1626    106.66        <.0001
Exp(rate)     0.0096      0.0423

but I dont think this is exact poisson regression either, while you can count on SAS 9.22 for the newly implemented Exact method in Genmod

使用道具

藤椅
marloneusa 发表于 2010-8-10 04:07:50 |只看作者 |坛友微信交流群
data a;
r=7/347;
r_low = cinv(0.025, 2*7)/(2*347);
r_up = cinv(0.975, 2*(7+1))/(2*347);
run;

It is easy if you use R:

poisson.test(7,347)
已有 1 人评分学术水平 热心指数 收起 理由
baojiwolong + 1 + 1 好的意见建议

总评分: 学术水平 + 1  热心指数 + 1   查看全部评分

使用道具

板凳
harlon1976 发表于 2010-8-10 07:02:48 |只看作者 |坛友微信交流群
data a;
r=7/347;z=probit(0.975);
deta=z*sqrt((z/347)**2+4*r/347);
b=2*r+z**2/347;
up=(b+deta)/2;
lo=(b-deta)/2;
proc print;run;
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
baojiwolong + 1 + 1 + 1 好的意见建议

总评分: 学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

使用道具

报纸
baojiwolong 发表于 2010-8-10 11:06:20 |只看作者 |坛友微信交流群
harlon1976 发表于 2010-8-10 07:02
data a;
r=7/347;z=probit(0.975);
deta=z*sqrt((z/347)**2+4*r/347);
b=2*r+z**2/347;
up=(b+deta)/2;
lo=(b-deta)/2;
proc print;run;
这是正态近似法计算,结果为:95%CI(0.9771942-4.1644),
与想要的结果还有点差距。能否用exact poisson distribution计算呢?

使用道具

地板
baojiwolong 发表于 2010-8-10 11:09:49 |只看作者 |坛友微信交流群
marloneusa 发表于 2010-8-10 04:07
data a;
r=7/347;
r_low = cinv(0.025, 2*7)/(2*347);
r_up = cinv(0.975, 2*(7+1))/(2*347);
run;

It is easy if you use R:

poisson.test(7,347)
The CINV function returns the pth quantile from the chi-square distribution with degrees of freedom df and a noncentrality parameter nc. The probability that an observation from a chi-square distribution is less than or equal to the returned quantile is p. This function accepts a noninteger degrees of freedom parameter df.
If the optional parameter nc is not specified or has the value 0, the quantile from the central chi-square distribution is returned. The noncentrality parameter nc is defined such that if X is a normal random variable with mean and variance 1, X2 has a noncentral chi-square distribution with df=1 and nc = 2.
CAUTION: For large values of nc, the algorithm could fail; in that case, a missing value is returned.   
Note:   CINV is the inverse of the PROBCHI function.  

使用道具

7
baojiwolong 发表于 2010-8-10 21:46:15 |只看作者 |坛友微信交流群
自己顶一下!

使用道具

8
baojiwolong 发表于 2010-8-12 21:31:47 |只看作者 |坛友微信交流群
再顶一个!

使用道具

9
baojiwolong 发表于 2010-8-16 20:57:41 |只看作者 |坛友微信交流群
自己再顶一次!!!

使用道具

10
冯特 在职认证  学生认证  发表于 2015-3-25 10:22:33 |只看作者 |坛友微信交流群
学习学习

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-19 11:43