# \dontshow{
RcppArmadillo::armadillo_throttle_cores(2)
# }
data(doveData)
set.seed(1234)
smp <- sample(1L:nrow(x = doveData), size = 2500L)
# NOTE: This sample size is chosen for example only -- larger data sets
# should be used.
# See the vignette for a full analysis of the doveData dataset
# Fit the model with default settings
dove2(formula = Surv(event.time, event.status) ~ priority + sex +
vaccine(entry.time, vaccine.status, vaccine.time),
data = doveData[smp,])
# Specify Week 4 as the change point
# Assume a potentially waning VE after 4 weeks
# Estimate VE_a over 0-4, 4-16, 16-28, 28-40 weeks
dove2(formula = Surv(event.time, event.status) ~ priority + sex +
vaccine(entry.time, vaccine.status, vaccine.time),
data = doveData[smp,],
changePts = 4*7,
timePts = c(4, 16, 28, 40)*7)
# Specify multiple change points at Weeks 4 and 8
# Assume a constant VE after 8 weeks
dove2(formula = Surv(event.time, event.status) ~ priority + sex +
vaccine(entry.time, vaccine.status, vaccine.time),
data = doveData[smp,],
changePts = c(4, 8)*7,
constantVE = TRUE)
Run the code above in your browser using DataLab