add.ci {dpasurv} | R Documentation |
Calculate bootstrap confidence bands for effect of interest
Description
Calculate bootstrap confidence bands for effect of interest
Usage
add.ci(object, alpha)
Arguments
object |
object of class "effect" |
alpha |
the confidence level |
Value
object of class "effect" with updated confidence interval corresponding to alpha
Examples
library(dpasurv)
data(simdata)
# Perform dynamic path analysis:
# We set boot.n=30 for the example to run fast, should be set large enough
# so that results don't change meaningfully for different seeds.
s <- dpa(Surv(start,stop,event)~M+x, list(M~x), id="subject", data=simdata, boot.n=30)
# Calculate cumulative direct effect (which calculates a CI with alpha = 0.05 by default):
direct <- effect(x ~ outcome, s)
# update confidence interval for a new alpha (this overwrites the 0.05 CI already calculated above)
direct <- add.ci(direct, alpha=0.10)
[Package dpasurv version 0.1.0 Index]