I have the cox proportional hazard model that has 4 explanatory variables.
newm3<-coxph(Surv(HoldTime, Indicator) ~ 1 + HIC+SH+DeckDur+Bushels_Scallops, df_model)
I have used the predict function to produce a plot of the model:
#identify variables for new data HIC<-sort(unique(df_model$HIC)) SH<-mean(df_model$SH) DeckDur<-mean(df_model$DeckDur) Bushels_Scallops=mean(df_model$Bushels_Scallops) #use expand.grid to make new dataset for predict newdata<-expand.grid(HIC,SH,DeckDur,Bushels_Scallops) names(newdata)<-c("HIC","SH","DeckDur","Bushels_Scallops") #predict and plot predict_fit <- survfit(newm3, newdata= newdata) plot(predict_fit,ylab="Probability of Survival",xlab="Holding Time (hrs)")
I have been searching around trying to figure out how to compare the coxph fit to a KM curve to assess the model goodness-of-fit. I have only come across examples with one explanatory variable. Does anyone have suggestion for an example with multiple variables or advice on how to proceed?
I did not provide an example because the dataset has ~2000 rows and 19 columns.