Statistical Notes (5): Confidence Intervals for Difference Between Independent Binomial Proportions Using SAS

This post was kindly contributed by From a Logical Point of View » SAS - go there to comment and to read the full post.

A guy notices a bunch of targets scattered over a barn wall, and in the center of each, in the "bulls-eye," is a bullet hole. "Wow," he says to the farmer, "that’s pretty good shooting. How’d you do it?" "Oh," says the farmer, "it was easy. I painted the targets after I shot the holes." – An Old Joke

Note on how to get the difference between independent binomial proportions using SAS PROC FREQ (tested in SAS 9.3M1).  Also, benchmarks took from Prof. Newcombe ’s paper:

Interval estimation for the difference between independent proportions: comparison of eleven methods.

newcombe

Key findings:

SASFreq_woCC

SASFreq_CC

1. SAS Proc Freq offers 7 ( including 4 of toal 11 in Prof. Newcombe ’s paper) methods to compute confidence intervals for difference between independent binomial proportions:

    • Exact confidence limits
    • Farrington-Manning confidence limits
    • Hauck-Anderson confidence limits
    • Newcombe confidence limits (also named Wilson/Score method), #10
    • Newcombe confidence limits, with CC, #11
    • Wald confidence limits, #1
    • Wald confidence limits, with CC, #2

Note that #1 method is the most popular one in textbook, #10 might  be the most wildly used method in industry.

2. There is a big discrepancy in the outputs in the  so called “exact” method among  SAS Proc Freq and Prof. Newcombe ’s paper. Seems they used different methods (in the same “exact” families) under same name. Need to further investigation.

The SAS codes:

data ci;
    input grp res count;
datalines;
1 0 56
1 1 14
2 0 48
2 1 32
;

ods select  PdiffCLs;
proc freq data=ci order=data;
    tables grp*res /riskdiff (CL=WALD CL= EXACT CL=FM CL=HA CL=WILSON);
    weight count;
    exact riskdiff;
run;

ods select  PdiffCLs;
proc freq data=ci order=data;
    tables grp*res /riskdiff (CORRECT CL=WALD CL= EXACT CL=FM CL=HA CL=NEWCOMBE);
    weight count;
    exact riskdiff;
run;

———————————-

You may be also interested in this post on calculating confidence intervals for single proportion:

Statistical Notes (3): Confidence Intervals for Binomial Proportion Using SAS

using the following 11 methods:

      • 1.  Simple asymptotic, Without CC | Wald
      • 2.  Simple asymptotic, With CC      
      • 3.  Score method, Without CC | Wilson       
      • 4.  Score method, With CC    
      • 5. Binomial-based, ‘Exact’ | Clopper-Pearson              
      • 6.  Binomial-based, Mid-p      
      • 7.  Likelihood-based            
      • 8.  Jeffreys    
      • 9.  Agresti-Coull,z^2/2 successes          
      • 10. Agresti-Coull,2 successes and 2 fail           
      • 11. Logit                                               

This post was kindly contributed by From a Logical Point of View » SAS - go there to comment and to read the full post.