BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
iuri_leite
Fluorite | Level 6

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

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

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.

View solution in original post

5 REPLIES 5
StatDave
SAS Super FREQ

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.

iuri_leite
Fluorite | Level 6
Dear Dave,

thanks. I used the code you provided but using the information of the
dataset instead of the number. I followed the code now and it worked fine.

Is there any way to do that with the information in the dataset?

regards,
Iuri

sbxkoenk
SAS Super FREQ

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

iuri_leite
Fluorite | Level 6
Dear Koen,

when I first saw your code, I thought I could use the vector of a dummy
variable indicating the occurrence of the event and a vector with
person-year for each participant.
But it did not work. Then I perceived that I should only put the zero and
the value of the person-years (116.42).
The value of 116.42 is obtained by adding the individual values.

Thanks again for helping me.

regards,

Iuri

Rick_SAS
SAS Super FREQ

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

 

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

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.

Discussion stats
  • 5 replies
  • 7822 views
  • 3 likes
  • 4 in conversation