Dear all,
Does anyone know how to calculate the 95% CI for a proportion when the proportion is exactly 100% ? Thanks !
Feng Liang
data x;
x=1;output;
x=1;output;
run;
proc freq data=x;
table x/binomial cl;
run;
The problem is that if all trials resulted in 'success' then (to a frequentist) the standard error is 0 and the confidence interval collapses to [1, 1]. There are ways to adjust the CI. See the Hanley's 1983 JAMA paper
http://www.medicine.mcgill.ca/epidemiology/hanley/reprints/If_Nothing_Goes_1983.pdf
which suggests that you should use a 95% CI of [1 - 3/n, 1] for the rate, where n is the number of observations.
You can get an exact lower confidence limit by using the EXACT BINOMIAL statement in PROC FREQ:
data a; input x w; datalines;
1 20
0 0
;
proc freq; table x; exact binomial; weight w; run;
Thanks a lot for your help !
Regards,
Feng Liang
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.