MEDIATION ANALYSIS WITH R


I have tried to do a mediation analysis
In my dataset I did not use a treatment. If i write treatment = NULL  the
program sends me back a error. How i can do this?
R> model.m <- lm(job_seek ~ treat + depress1 + econ_hard + sex + age
+ occp + marital + nonwhite + educ + income, data = jobs)
R> model.y <- lm(depress2 ~ treat + job_seek + depress1 + econ_hard + sex +
age
+ occp + marital + nonwhite + educ + income, data = jobs)

R> out.1 <- mediate(model.m, model.y, sims = 1000, boot = TRUE, treat =
"treat",
mediator = "job_seek")
R> out.2 <- mediate(model.m, model.y, sims = 1000, treat = "treat",
mediator = "job_seek")
 thank you

-- 
ste



-- 
ste

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to