I am running survival analysis on a very large data set and attempting to examine the impact of a particular variable on survival at various time points (30 days, 90 days, 180 days, 365 days).
I want to run a univariate Cox regression and I am not sure how to do this properly. The data set contains a variable, "Time", which contains the amount of days that patients have been present in the data set.
At first, I simply did a subset of the major dataset at the various time points (i.e. subset by Time <= 30...etc) and then just ran a simple Cox regression in each data frame (coxph(surv(time, event)~x
) ...this was obviously foolish because it only included information leading up to each interval. I have no idea how to attack this problem otherwise and was unable to find a good answer through my searches
Any suggestions would be greatly appreciated. thank you!