It is often of interest to examine survival curves from qgcomp.cox.boot models. They can be useful for checking assumptions about how well the marginal structural model conforms to the underlying conditional model, such that the overall fit approximates the non-linearity in the underlying model. This function will yield survival curves, but no measures of uncertainty.
a list of data.frames: #'
'mdfpop': Average Survival curve (survival, time) based on marginal structural model, averaged over the population at every quantile of exposure
'cdfpop': Population average survival curve (survival, time) based on the underlying conditional model
'mdfq': Survival curves (survival, time) for each quantile based on marginal structural model
'cdfq': Survival curves (survival, time) for each quantile based on underlying conditional model
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
set.seed(50) N=200 dat <- data.frame(time=(tmg <- pmin(.1,rweibull(N, 10, 0.1))), d=1.0*(tmg<0.1), x1=runif(N), x2=runif(N), z=runif(N)) expnms=paste0("x", 1:2) f = survival::Surv(time, d)~x1 + x2 (fit1 <- survival::coxph(f, data = dat)) (obj <- qgcomp.cox.noboot(f, expnms = expnms, data = dat)) ## Not run: ## Not run: (obj2 <- qgcomp.cox.boot(f, expnms = expnms, data = dat, B=10, MCsize=20000)) curves = cox.survcurve.boot(obj2) rbind(head(curves$mdfq),tail(curves$mdfq)) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.