I have a small dataset (128 observations) for cancer survival which I split into 100 obs in a train set and the other 18 in my test set. I am trying to fit a Cox Regression model to the training set and then use that model to predict with my testing set and measure the prediction accuracy with the sbrier function. My code is as follows:
mod1<-coxph(Surv(survtime, status)~pretx_cirrhosis+pretx_pvt+active_lesions+tumor_size, data=train.pre) plot(survfit(mod1, newdata=test.pre))
preds<-survfit(mod1, newdata=test.pre)
sbrier(Surv(train.pre$survtime, train.pre$status), preds)
But I keep getting the following error: Error in switch(ptype, survfit = { : EXPR must be a length 1 vector
How can I find the Brier score from predicting on my test set data?