summary.medsens {mediation} | R Documentation |
Function to perform sensitivity analysis on mediation effect for violations of sequential ignorability assumption. The procedure estimates the mediation effect allowing for a correlation between the error terms of the outcome model and the mediator model. The extent of this correlation is expressed in terms of the parameter rho. Sensitivity analysis is possible with continuous mediator and continuous outcome and binary outcome and continuous mediator. Future versions of the function will also permit sensitivity analysis for a continuous outcome and binary mediator. Output from the function can be passed through summary or plot functions which display estimated mediation effects for given values of rho.
## S3 method for class 'medsens': summary(object, ...) ## S3 method for class 'summary.medsens': print(x, ...)
x |
Output from medsens function. |
object |
Output from medsens function. |
... |
Additional arguments to be passed. |
Luke Keele, Ohio State University, keele.4@osu.edu , Dustin Tingley, Princeton University, dtingley@princeton.edu, Teppei Yamamoto, Princeton University, tyamamot@princeton.edu, Kosuke Imai, Princeton University, kimai@princeton.edu
Imai, Kosuke, Luke Keele and Dustin Tingley (2009) A General Approach to Causal Mediation Analysis. Imai, Kosuke, Luke Keele and Teppei Yamamoto (2009) Identification, Inference, and Sensitivity Analysis for Causal Mediation Effects.
See also medsens
#Example with JOBS II Field experiment #For illustration purposes simulations set to low number. #Example with JOBS II Field experiment data(jobs) ## Not run: ######################################### #continuous mediator and continuous outcome ######################################### #fit parametric model model.m <- lm(job_seek ~ treat + depress1 + econ_hard + sex + age + occp + marital + nonwhite + educ + income, data=jobs) model.y <- lm(depress2 ~ treat + job_seek + depress1 + econ_hard + sex + age + occp + marital + nonwhite + educ + income, data=jobs) #pass model objects through medsens function sens.cont <- medsens(model.m, model.y, T="treat", M="job_seek", INT=FALSE, DETAIL=FALSE, sims=1000) #use summary function to display values of rho where 95 summary(sens.cont) #plot mediation effect and 95 plot(sens.cont, main="JOBS", ylim=c(-.2,.2)) ######################################### #binary outcome and continuous mediator ######################################### model.m <- lm(job_seek ~ treat + depress1 + econ_hard + sex + age + occp + marital + nonwhite + educ + income, data=jobs) model.y <- glm(work1 ~ treat + job_seek + depress1 + econ_hard + sex + age + occp + marital + nonwhite + educ + income, family=binomial(link="probit"), data=jobs) sens.dichO <- medsens(model.m, model.y, T="treat", M="job_seek", INT=FALSE, DETAIL=FALSE) summary(sens.dichO) plot(sens.dichO, main="JOBS", ylim=c(-.2,.2)) ## End(Not run)