# How do I calculate the probability of something happening after a certain age?

I study a rare disease (recurrent respiratory papillomatosis (RRP)) and have accumulated data on hundreds of patients and the age at which they were diagnosed. Only a few (17) ever went on to develop the dreaded complication of pulmonary involvement. They were all patients who were diagnosed before the age of 5. But then again about half of all patients in our sample are diagnosed before the age of 5. I am able to easily use R to figure out, in our specific cohort, the oldest diagnostic age of any patient who subsequently developed pulmonary involvement.

data.table [SitePulmonay==TRUE, max(diagnostic.age)]


I am also able to use the ecdf() function and can use ggplot to visualize

Empirical cumulative distribution (ECDF).

How do I calculate the 95% confidence interval, or any confidence interval. I want to determine an age of diagnosis above which there is only a 2.5% probability of ever going on to develop pulmonary involvement. Ideally I would like to implement in R. Since I only have 17 patients with pulmonary RRP, I cannot simply believe that our maximum diagnostic age is THE maximum diagnostic age. I am not looking for the mean diagnostic age and the 95% interval on that (that would be the sem

• You're interested in something like survival analysis: stats.stackexchange.com/questions/tagged/survival Commented Jul 26, 2018 at 20:12
• Do you have data on the present ages of your patients, ages of death for those that are dead, and the ages at which they developed pulmonary involvement?
– Ben
Commented Jul 27, 2018 at 0:38
• @Ben alas, no I do not. The data is not that good. that would be ideal. Instead I have the age of diagnosis and the age that they enrolled in a study and whether or not they had or had ever had pulmonary involvement at the time of that enrollment. And that is that. Commented Jul 27, 2018 at 23:13
• is the last parenthetical sentence correct? Do you mean "same"? or sem - structural equation modeling. Commented Dec 7, 2022 at 19:04
• Sorry for the confusion. I have no idea why I did not not write it out in full. sem = standard error of the mean. Commented Dec 9, 2022 at 0:32