Not my exact setup, but for easier explanation imagine I'm working on a project that looks at user session data on a website (like netflix). The idea is to understand how video playback errors might cause users to leave the website.

Playback errors are rare, and just looking at correlation of playback errors and session length would give an incorrect interpretation because longer sessions will generally have more playback errors (since more videos watched means more opportunities for errors).

The data I have is the user session length, timestamps of all playback errors in the session, and user demographic information.

My idea was to do a survival analysis (perhaps a cox ph model) where a "failure" is the user leaving the website, but how would I include playback errors as a covariate, since doing so will lead to a bad interpretation? Or is there a different method that would be better suited for this?


1 Answer 1


It's not necessarily true that including the playback errors will be erroneous. Yes, you will have more playback errors as times progresses, but a properly defined model (unlike a simple correlation of errors with session length) would effectively be comparing situations at constant overall session length that have different histories of prior playback errors.

In the context of a Cox model, a covariate should be related to the instantaneous probability of the event, in this case the probability of leaving the website.* The analysis with respect to covariates is done at each event time, with the covariate values of the case having the event compared against the cases still at risk but not having the event.

One approach that comes to mind would be to use the cumulative number of playback errors as a time-dependent covariate. Your knowledge of the subject matter might suggest a better way to incorporate the playback errors, perhaps as some measure of error frequency. Just make sure that your choice is compatible with the instantaneous relationship between covariates and event probability that the Cox model assumes.

*If you are treating leaving the website as the "event" you probably aren't dealing with "recurrent events" in the technical sense. That terminology has to do with the possibility of the modeled event occurring more than once over the study in an individual. That terminology would be OK if playback errors themselves were the event being modeled.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.