Dear all,
I am still struggling to estimate 95% confidence interval for a data set in which we did not observe the event. I have a dummy variable that indicates the event occurrence and the number of person-years.
I did not observe nay event and the number of person-years is equal to 116.42. Then, the incidence rate is zero (0/116.42). But I would like to estimate the confidence interval. I used Proc Genmod and it gives me a perfect result when events occurred. Whithout events I do not get the confidence intervals.It would be possible to estimate the confidence interval?
Regards,
Iuri
As I said in your original post:
If you replace 100 with 116.42 in the code I provided earlier, then you will get the exact confidence interval from PROC GENMOD. You can also use the PROC FREQ code I provided since your response is binary, but PROC FREQ requires integer counts. If you use it with 116 and again with 117, you get very similar results and also quite similar to the interval from PROC GENMOD.
As I said in your original post:
If you replace 100 with 116.42 in the code I provided earlier, then you will get the exact confidence interval from PROC GENMOD. You can also use the PROC FREQ code I provided since your response is binary, but PROC FREQ requires integer counts. If you use it with 116 and again with 117, you get very similar results and also quite similar to the interval from PROC GENMOD.
Hello @iuri_leite ,
What do you mean with : "information from / in the dataset"?
The number of person-years (116.42) is coming from the data set.
Just calculate that number by processing the data set and put that number in a macro variable (programmatically!!).
Then use the macro variable in PROC GENMOD.
That's completely dynamic and nothing has to be hardcoded.
Koen
It's only the lower bound that is difficult to compute, but it is 0 by using common sense or a limiting argument applied to the quantile function of the chi-square distribution with df->0.
/* exact CIs from
Ulm K. A simple method to calculate the confidence interval of a standardized
mortality ratio. American Journal of Epidemiology 1990;131(2):373-375.
*/
data CI;
alpha = 0.05;
N = 0; /* observed count */
R = N / 116.42; /* observed rate = count / personYears */
if N = 0 then
LCL = 0;
else
LCL = quantile('chisq', alpha/2, 2*R) / 2;
UCL = quantile('chisq', 1-alpha/2, 2*(1+R)) / 2;
run;
proc print data=CI; run;
For a derivation, see On Biostatistics and Clinical Trials: Computing Confidence Interval for Poisson Mean
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.