- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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