# NOT RUN {
# Hypothetical example
## To use mediations, must make list of multiple datasets. Then,
## must also repeat the treatment assignment list as many times
## as you have data sets.
# datasets <- list(D1=D1, D2=D2) # list of multiply imputed data sets
# mediators <- c("M1")
# outcome <- c("Ycont1")
# treatment <- c("T1","T1") # note how the treatment indicator is repeated
# covariates <- c("X1+X2")
# olsols <- mediations(datasets, treatment, mediators, outcome, covariates,
# families=c("gaussian","gaussian"), interaction=FALSE,
# conf.level=.90, sims=1000)
# output <- amelidiate(olsols)
# summary(output)
# plot(output)
# }
Run the code above in your browser using DataLab