Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

amelidiate

Function for combining outputs from mediations function and calculating quantities of interest. For use with multiple imputation procedures.


Description

'amelidiate' takes the output from mediations and stacks the different vectors. Next it outputs these stacked vectors in the format of a mediate object.

Usage

amelidiate(g)

Arguments

g

output from mediations that used the same models and variables but run on different datasets.

Details

amelidiate is designed to help users process multiple datasets where missing values have been imputed. First create multiple datasets using your preferred imputation software.

Next pass the data sets, as shown in the example below, to the mediations function. Finally pass the output of mediations through the amelidiate function. This will output an object that can then be passed through the standard summary and plot commands.

This function is not completely developed. It does not support models for ordered outcomes, inherits the limitations of the mediations function, and does not pass the information required for calculation of p-values.

Value

An object of class "mediate".

Author(s)

Dustin Tingley, Harvard University, dtingley@gov.harvard.edu

See Also

Examples

## 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)

## End(Not run)

mediation

Causal Mediation Analysis

v4.5.0
GPL (>= 2)
Authors
Dustin Tingley <dtingley@gov.harvard.edu>, Teppei Yamamoto <teppei@mit.edu>, Kentaro Hirose <hirose@princeton.edu>, Luke Keele <ljk20@psu.edu>, Kosuke Imai <kimai@princeton.edu>, Minh Trinh <mdtrinh@mit.edu>, Weihuang Wong <wwong@mit.edu>
Initial release
2019-9-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.