Reputation: 11
i am trying to run cox regression model in R studio but facing same error every time.
cox.model <-coxph(Surv(dat$los, dat$died) ~ gender, data=dat)
Error in coxph(Surv(dat$los, dat$died) ~ gender, data = dat) :
an id statement is required for multi-state models
Here is data:
Upvotes: 1
Views: 1887
Reputation: 1
Check the type of event i.e., dead in your case. It might be a factor or character. Just convert it into a numeric. You will not get the same again. Event you can plot forest plot.
Upvotes: 0