0

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!

Maurits Evers
  • 49,617
  • 4
  • 47
  • 68
Sam
  • 11
  • 1
    Welcome to SO. Please consider [taking the tour](https://stackoverflow.com/tour). You are more likely to get help if you (1) do some (i.e. a lot of) [research yourself](https://meta.stackoverflow.com/questions/261592/how-much-research-effort-is-expected-of-stack-overflow-users), (2) learn [how to ask](https://stackoverflow.com/help/how-to-ask) questions, and (3) provide a [minimal reproducible example/attempt](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example), *including sample data*. – Maurits Evers Mar 20 '18 at 23:34
  • Thank you for your reply. Sorry for the poor question – Sam Mar 20 '18 at 23:43
  • There are many worked examples in R help pages and vignettes. The `survival` package (which you are obviously using) is part of the distributed R core. There's also a Task View: https://cran.r-project.org/web/views/Survival.html – IRTFM Mar 20 '18 at 23:43

0 Answers0