# \donttest{
# load datasets
data(exp_data_full) # full experimental data
data(exp_data) #experimental data
data(pop_data) #population data
#attach SuperLearner (model will not recognize learner if package is not loaded)
library(SuperLearner)
set.seed(123456)
#specify models and estimate PATTC
pattc <- pattc_ensemble(response.formula = support_war ~ age + income +
education + employed + job_loss,
exp.data = exp_data_full,
pop.data = pop_data,
treat.var = "strong_leader",
compl.var = "compliance",
compl.SL.learners = c("SL.glm", "SL.nnet"),
response.SL.learners = c("SL.glm", "SL.nnet"),
ID = NULL,
cluster = NULL,
binary.outcome = FALSE)
print(pattc)
pattc_boot <- pattc_ensemble(response.formula = support_war ~ age + income +
education + employed + job_loss,
exp.data = exp_data_full,
pop.data = pop_data,
treat.var = "strong_leader",
compl.var = "compliance",
compl.SL.learners = c("SL.glm", "SL.nnet"),
response.SL.learners = c("SL.glm", "SL.nnet"),
ID = NULL,
cluster = NULL,
binary.outcome = FALSE,
bootstrap = TRUE,
nboot = 1000)
print(pattc_boot)
# }
Run the code above in your browser using DataLab