This is a test version of Biostars. For the public version, visit https://www.biostars.org.
survival analysis using R
mrna_grade_surv<-coxph(Surv(Survival,Vital_status)~Grades,conf.type="none")
Error in Surv(Survival, Vital_status) : Time variable is not numeric

what do i do?

r
Survival    Vital_status
-0.0328549  0
-0.0328549  0
-0.0328549  0
0.0328549   0
0.0657098   1

this is the sample data.

1 answer

Most likely, you should convert your time variable to a numeric type. It could be as simple as using as.numeric() but it depends on what type your data is.

I did that. but the curve is not right. but earlier when I did the analysis with the same code it worked. why not for this.?

Log in to answer this question.