Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/mediate.designs.R
'mediate.ced' estimates the average causal mediation effects for the crossover encouragement design.
1 2 | mediate.ced(outcome, med.1, med.2, treat, encourage, data, sims = 1000,
conf.level = 0.95)
|
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. |
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.
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". |
Dustin Tingley, Harvard University, dtingley@gov.harvard.edu; Teppei Yamamoto, Massachusetts Institute of Technology, teppei@mit.edu.
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.
mediate
, summary.mediate.design
1 2 3 4 | data(CEDdata)
res <- mediate.ced("Y2", "M1", "M2", "T1", "Z", CEDdata, sims = 100)
summary(res)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.