Can you get the probability of an event happening before n days using its empirical cumulative distribution?

I have data of the number of days it takes an object to change from state A to state B, and I am interested in knowing what is the probability that this change of states happens before n days. Can I use the empirical cumulative distribution of the data I have to know this?

In particular, I am using the ecdf() function from R to obtain the cumulative empirical distribution of my dataset (n=35). If I want to get the probability of the change of states of objects not in the dataset happening between days 30 and 60 I use the command diff(ecdf(ages)(c(30,60))), where ages is the array with my data.

Am I doing this correctly? I don't know if it is statistically correct to extrapolate the empirical cumulative function to answer questions about data that is not in my dataset. That is, to make inferences about this unknown data, but I cannot think about a better alternative for now.

Also, I have explored the possibility of using the kernel density of my data. From my understanding, the kernel density is a non parametric process that "infers" the probability distribution of a dataset through interpolation. Could this somehow be helpful to solve my question.

• If you have some objects that are still in state A when you stop observing them you will want to look at survival analysis (whether parametric or nonparametric). – Glen_b Jun 10 '16 at 1:25