model - Unable to predict on a new dataset using coxph in R -
i built coxph model on training data , having trouble in using predictions on validation dataset. used surv build survival object , used response variable in coxph model. used predict predictions on both training , test dataset @ both times predicted using on training data.
my.surv<-surv(train$time_to_event, train$event, type="right") basic.coxph<-coxph(my.surv~train$basin+train$region+train$district_code) prediction_train<-predict(basic.coxph,train,type="risk") prediction_test<-predict(object=basic.coxph,newdata=validate,type="risk")
the results of both prediction_train , prediction_test have same dimensions , same, though training , validation dataset have different dimensions al same columns. suggestion on doing wrong here?
Comments
Post a Comment