Creating confidence intervals using datastep

X is a proportion (ranges from 0 to 1).  When alpha is set to 1.96, it creates 95% confidence intervals (two-tail tests).

N is the number of cases.

 

%let Alpha=1.96;

X_STDERR =sqrt(((X*(1-X))/N));
X_CI95_lower =X-(X_STDERR*&alpha);
X_CI95_upper =X+(X_STDERR*&alpha);

 

REFERENCE

http://davidmlane.com/hyperstat/B9168.html

Leave a Reply