You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now I combine them using the add_covariate_to_timeline function, which used to work before. But now for some reason, the output dataframe with the two tables folded into each other give out a 7092 row-sized table. The output table is not taking into account the changes in X over time (all start values in the output table are 0).
I am not sure why add_covariate_to_timeline is not working, any leads would be appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am performing Cox regression with the time-varying covariates method on a dataset.
I use to_long_format from lifelines.utils to convert the data into a long format. There are 7092 events (rows) in the data in the long format.
For some events, the value of a variable X changes over time, and I include this in a type 1 format table as described in the documentation: https://lifelines.readthedocs.io/en/latest/Time%20varying%20survival%20regression.html#dataset-creation-for-time-varying-regression
These correspond to 8936 rows / changes.
Now I combine them using the add_covariate_to_timeline function, which used to work before. But now for some reason, the output dataframe with the two tables folded into each other give out a 7092 row-sized table. The output table is not taking into account the changes in X over time (all start values in the output table are 0).
I am not sure why add_covariate_to_timeline is not working, any leads would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions