加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

188.Proportions and their Confidence Intervals

(2013-05-22 06:16:11)
标签:

rates

ci

杂谈

分类: 统计分享

Introduction

A proportion refers to the fraction of the total that possesses a certain attribute. Estimating the confidence interval for the binomial proportion is not a challenge any more in statistics. The FREQ procedure in SAS will do the entire job for you without programming any formula.
The following analysis was from a simulated study which is involving four different groups, i.e., test, placebo, standard and other, during a certain period of time, to compare the crude proportions of positive responses to a  specific test among the four groups. Of note, in the data, there is a zero count in group 'other' that may cause estimation problems in some methods, in particular, the classical method of calculating a Wald confidence interval.

Code

 

proc format;

value OTfmt

1 ='positive' 2 ='negative' 3 ='unknown'

;

run;

data respire;

  input treat $ outcome  count @@;

  datalines;

test     1 20 test     2 120 test     3 2

placebo  1 48 placebo  2 96 placebo  3 2

standard 1 34 standard 2 108 standard 3 3

other    1 0 other    2 3 other    2 1 other    3 2

;

 

proc freq data =respire order=data noprint;

  weight count/zeros; *Not miss the zero counts;

  tables treat*outcome/list out =list;       format outcome OTfmt.;

run;

ods select BinomialProp BinomialCLs;

proc freq data =list order=data;

       by treat notsorted;

       tables outcome/binomial(all); *Option ALL since SAS 9.2 version;

       weight count/zeros;       format outcome OTfmt.;

run;

 


Results (selected)

Proportion of positive response for test group.

 

The SAS System           18:10 Tuesday, May 21, 2013   1

 

------------------------------------------- treat=test -------------------------------------------

 

                                        The FREQ Procedure

 

                                       Binomial Proportion

                                      for outcome = positive

                                -------------------------------------------

                                      Proportion      0.1408

                                      ASE             0.0292

 

                          Type                     95% Confidence Limits

 

                          Wald                          0.0836    0.1981

                          Wilson                        0.0931    0.2075

                          Agresti-Coull                 0.0923    0.2083

                          Jeffreys                      0.0911    0.2051

                          Clopper-Pearson (Exact)       0.0882    0.2091

 

 Proportion of positive response for other group. As seen, there is no or a degenerate confidence interval (0,0) in Wald method.

 

------------------------------------------ treat=other -------------------------------------------

 

                                        The FREQ Procedure

 

                                       Binomial Proportion

                                      for outcome = positive

                                -------------------------------------------

                                      Proportion      0.0000

                                      ASE             0.0000

 

                          Type                     95% Confidence Limits

 

                          Wald                          0.0000    0.0000

                          Wilson                        0.0000    0.3903

                          Agresti-Coull                 0.0000    0.4428

                          Jeffreys                      0.0000    0.3304

                          Clopper-Pearson (Exact)       0.0000    0.4593

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有