mediate.ced: Estimating Average Causal Mediation Effects under the...

View source: R/mediate.designs.R

mediate.cedR Documentation

Estimating Average Causal Mediation Effects under the Crossover Encouragement Design

Description

'mediate.ced' estimates the average causal mediation effects for the crossover encouragement design.

Usage

mediate.ced(outcome, med.1, med.2, treat, encourage, data, sims = 1000,
  conf.level = 0.95)

Arguments

outcome

variable name in 'data' containing the outcome values observed in the second experiment. The variable must be binary (factor or numeric 0/1).

med.1

variable name in 'data' containing the mediator values observed in the first experiment. The variable must be binary (factor or numeric 0/1).

med.2

variable name in 'data' containing the mediator values observed in the second experiment.

treat

variable name in 'data' containing the treatment values in the first experiment. Must be binary (factor or numeric 0/1).

encourage

name of the encouragement indicator in 'data'. Must be binary (factor or numeric 0/1).

data

a data frame containing all the above variables.

sims

number of bootstrap simulations.

conf.level

level of the returned two-sided confidence intervals.

Details

This function estimates the average indirect effects for the pliable units under the crossover encouragement design. The design has two stages. In the first stage the treatment is randomized and the mediator and outcome variables are measured. In the second the treatment is set to the value opposite of first period and a randomly selected group of units receives encouragement to take on the mediator opposite to the values observed in the first stage. See Imai, Tingley and Yamamoto (2012) for a full description. The confidence intervals are calculated via the nonparametric bootstrap.

Note that outcome should be the observed responses in the second stage whereas treat should be the values in the first stage.

Value

mediate.ced returns an object of class "mediate.design", a list that contains the components listed below.

The summary function can be used to obtain a table of the results.

d0, d1

point estimates of the average indirect effects under the control and treatment conditions.

d0.ci, d1.ci

confidence intervals for the effects. The confidence level is set at the value specified in 'conf.level'.

conf.level

confidence level used.

sims

number of bootstrap simulations.

nobs

number of observations used.

design

indicates the design. Always equals "CED".

Author(s)

Dustin Tingley, Harvard University, dtingley@gov.harvard.edu; Teppei Yamamoto, Massachusetts Institute of Technology, teppei@mit.edu.

References

Tingley, D., Yamamoto, T., Hirose, K., Imai, K. and Keele, L. (2014). "mediation: R package for Causal Mediation Analysis", Journal of Statistical Software, Vol. 59, No. 5, pp. 1-38.

Imai, K., Tingley, D. and Yamamoto, T. (2012) Experimental Designs for Identifying Causal Mechanisms. Journal of the Royal Statistical Society, Series A (Statistics in Society)"

Imai, K., Keele, L., Tingley, D. and Yamamoto, T. (2011). Unpacking the Black Box of Causality: Learning about Causal Mechanisms from Experimental and Observational Studies, American Political Science Review, Vol. 105, No. 4 (November), pp. 765-789.

Imai, K., Keele, L. and Yamamoto, T. (2010) Identification, Inference, and Sensitivity Analysis for Causal Mediation Effects, Statistical Science, Vol. 25, No. 1 (February), pp. 51-71.

Imai, K., Keele, L., Tingley, D. and Yamamoto, T. (2009) Causal Mediation Analysis Using R" in Advances in Social Science Research Using R, ed. H. D. Vinod New York: Springer.

See Also

mediate, summary.mediate.design

Examples

data(CEDdata)

res <- mediate.ced("Y2", "M1", "M2", "T1", "Z", CEDdata, sims = 100)
summary(res)

kosukeimai/mediation documentation built on June 3, 2023, 12:14 a.m.