Monday 15 September 2014

R- Error "survfit" formula, survival package -



R- Error "survfit" formula, survival package -

i'm learning basics survival bundle in r this tutorial

i followed steps , got error: info in package:

aml<-aml

and in page 2 of tutorial:

summary(survfit(surv(aml$time[1:11],aml$status[1:11]))) error in usemethod("survfit", formula) : no applicable method 'survfit' applied object of class "surv"

so, tried:

train<-surv(aml$time[1:11],aml$status[1:11]) survfit(surv(time, status), info = train)

and got error:

error in surv(time, status) : time variable not numeric

really don't know i'm doing , why steps tutorial wrong.

you should convert time variable numeric type using: train$time=as.numeric(train$time)

r survival-analysis

No comments:

Post a Comment