qgcomp.survcurve.boot: Survival curve data from a qgcomp survival fit

View source: R/base_surv.R

qgcomp.survcurve.bootR Documentation

Survival curve data from a qgcomp survival fit

Description

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.

Usage

qgcomp.survcurve.boot(x, ...)

Arguments

x

a qgcompfit object from qgcomp.cox.boot

...

not used

Value

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

Examples

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)



qgcomp documentation built on Aug. 10, 2023, 5:07 p.m.