How to handle count type features in survival regression? I want to understand how to model 'count' or 'customer behaviour' type features in survival analysis.
For example, assume that Netflix wants to predict time to churn after a customer upgrades to a Premier subscription by using a Cox Proportional Hazards survival regression.
Say the training data looks like this as at an observation date of 2022-08-23, with customers 2 and 3 right-censored.




ID
Premier upgrade date
Churn date
Movies watched per week prior to Premier
Movies watched per week since Premier




1
2022-03-01
2022-05-01
10
1


2
2022-08-22
NULL
0
6


3
2022-07-01
NULL
1
20


4
2022-07-01
2022-08-01
20
1





*

*The number of movies a customer has watched per week since upgrading to Premier is likely to be a good indicator of whether they will churn.

Can I just plug this covariate in to the model the same way I would plug in a covariate such as gender? Does it need to be treated a special way / treated as a time-varying covariate?


*Am I allowed to use customer behaviour data before they upgraded to Premier in the model? For example, can I use the ratio of number of movies after Premier upgrade / number of movies before Premier upgrade as an input to predict churn duration after upgrading to Premier?


So long as you respect causality with respect to covariates (that is, you can't use future values of covariates to explain current survival) and you provide corresponding covariate values for all those at risk at any event time,* then you are allowed to try any covariate that makes sense based on your understanding of the subject matter.
The trick in this context is the second part of that restriction: "provide corresponding covariate values for all those at risk at any event time." With this type of data that necessarily means time-varying covariate values that are updated for all at-risk individuals at each event time (whether their own event times or someone else's).
To summarize: for question 1, yes, you need to use a model that allows for time-varying covariate values; for question 2, if the covariate value is in place no later than the time of the churn event then you can consider it.

*Be careful in using the word "event" in survival analysis contexts. That's usually taken to mean the event of interest, the churn event in this context. You're using "number of events" to mean something else, like how many movies were watched. That confused me a bit at first in reading this question. It's better to use some more generic term like "count variable" for candidate predictors. In this answer I use "event time" to mean the time at which the churn occurs.
