# NOT RUN {
## Set seed in order to have reproducibility of the bootstrap standard error estimate
set.seed(1234)
## Estimation of regression parameters only. No bootstrap variance estimation.
## with 'simdata_aipw'
data(simdata_aipw)
fit_aipw <- ciregic_aipw(formula = Surv2(v = v, u = u, event = c) ~ z1 + z2, aux = a,
data = simdata_aipw, alpha = c(1, 1), nboot = 0,
do.par = FALSE)
fit_aipw
## Bootstrap variance estimation based on 50 replications
fit_aipw <- ciregic_aipw(formula = Surv2(v = v, u = u, event = c) ~ z1 + z2, aux = a,
data = simdata_aipw, alpha = c(1, 1), k = 1, nboot = 50,
do.par = FALSE)
# }
# NOT RUN {
## Note that the user can use parallel computing to decrease
## the computation time of the bootstrap variance-covariance
## estimation (e.g. nboot = 50)
## Summarize semiparametric regression model
summary(fit_aipw)
## Predict and draw plot the cumulative incidence function evaluated at z1 = 1 and z2 = 0.5
t <- seq(from = 0, to = 2.8, by = 2.8 / 99)
pred <- predict(object = fit_aipw, covp = c(1, 0.5), times = t)
pred
plot(pred$t, pred$cif1, type = "l", ylim = c(0, 1))
points(pred$t, pred$cif2, type = "l", col = 2)
# }
Run the code above in your browser using DataLab