mediate.ced(outcome, med.1, med.2, treat, encourage, data,
sims = 1000, conf.level = .95)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.
Note that outcome should be the observed responses in the second stage whereas treat should be the values in the first stage.
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.
mediate, summary.mediate.designdata(CEDdata)
res <- mediate.ced("Y2", "M1", "M2", "T1", "Z", CEDdata, sims = 100)
summary(res)Run the code above in your browser using DataLab