Is there a way to evaluate observations of exponentially-distributed variables, where some of the observations are still "alive"? I am looking at the tenure (i.e. elapsed time between hire date and termination date) of various employees in a system. I want to test the hypothesis that two groups of employees have the same tenure distribution. This distribution is generally exponential in shape. Normally in this case I would start with something like the Kolmogorov-Smirnov test. However, many of the employees for which I have data, have not been terminated yet. For these employees, I have "tenure so far" instead of actual tenure.
If I only include the employees who have been terminated, my dataset shrinks quite a bit and also faces some additional bias. Plus, I think that the "tenure so far" can still provide some valuable data. If an employee's tenure so far is already pretty long, then we know they are different than someone who was terminated after working for 2 weeks.
I've tried imputing the future termination dates of these folks by taking the median tenure of any terminated employee whose tenure was at least as long as this employee's "tenure so far", but I'm sure that this introduces complications to hypothesis testing because of its effect on the variance.
Any thoughts or suggestions? Thanks so much!
 A: This seems to be a classic case of survival analysis, as typically used in medical research. For each individual, you record the time between hire date and either termination date or last-data date while still employed. You also record whether the time represents a termination date or a last-data date while employed. The R survival package easily handles this type of analysis; you don't have to assume any underlying distribution of employment time.
If daysEmployed is your set of times and terminated is your record of whether still employed at that time (coded 0) or terminated at that time (coded 1), you can use Cox proportional hazards analysis to gauge the relative rates of employee tenure by group as:
coxph(Surv(daysEmployed,terminated)~group)
This will give a statistical comparison of tenure times between the two groups, taking into account both those who have terminated and those who are still employed. Note, however, that what mainly counts is the numbers who have terminated, so if there aren't many terminations you aren't likely to find differences between the groups.
