I do not understand what the newdata argument means. Can someone explain this to me please? I have read the documentation but honestly I just can't understand it. When do I need to use it?
Presumably this is reference to a predict
function? You need to use 'newdata' when you want to predict an outcome for a combination of predictor variables that are not in your dataset. You need to supply a list object with column names that match the RHS variables. There are many worked examples on SO if you search for coxph
(or survfit
) along with predict
.