I have selected 7 coxph models using AIC, and did model averaging to obtain model averaged parameter estimates. I wanted to plot the survival curve from the averaged model, and I found someone with my problem, whose answer was given by Terry Therneau:
You can fit a Cox model with fixed coefficients. Assume "fixbeta" are the coefficients from your model averaging, then do
ffit <- coxph(Surv(time, status) ~ x1 + x2 + .... , data=mydata, init=fixbeta, iter=0) sfit <- survfit(fit)
The standard errors in sfit are incorrect of course. One could bootstrap the entire model creation process to get accurate values.
My question is: how do I "bootsrap the entire model creation process" using R?