Description Usage Arguments Value Author(s) References See Also Examples
Function to test whether the average causal mediation effects and direct effects are significantly different between the treatment and control contitions.
1 2 3 4 | test.TMint(x, ...)
## S3 method for class 'mediate'
test.TMint(x, conf.level = x$conf.level, ...)
|
x |
output from |
... |
additional arguments. |
conf.level |
level of the returned two-sided confidence intervals for the effect differences. By default it is set to the value used in the original mediate call. |
test.TMint returns an object of class "htest" when
applied to a mediate object. See t.test for more
explanations of the contents. The function returns an object of class
"htest.order" which has its own print method included in this
package.
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., Keele, L. and Tingley, D. (2010) A General Approach to Causal Mediation Analysis, Psychological Methods, Vol. 15, No. 4 (December), pp. 309-334.
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Examples with JOBS II Field Experiment
# **For illustration purposes a small number of simulations are used**
data(jobs)
# Fit mediator and outcome models allowing for treatment-mediator interaction
b <- lm(job_seek ~ treat + econ_hard + sex + age, data=jobs)
d <- lm(depress2 ~ treat*job_seek + econ_hard + sex + age, data=jobs)
# Test for significance of interaction
fit <- mediate(b, d, sims=50, treat="treat", mediator="job_seek")
test.TMint(fit)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.