Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Moderated mediation analyses


From   William Buchanan <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Moderated mediation analyses
Date   Mon, 3 Dec 2012 21:03:12 -0800

Check your syntax again. You're incorrectly referencing the estimate you're interested in. [y]_b[wx1] is what you might be trying to reference, but that estimate does not exist in the first equation [m1].

HTH

Sent from my iPhone

On Dec 3, 2012, at 19:14, "Kim, Isok" <[email protected]> wrote:

> Hello,
> 
> I am trying to replicate moderated mediation method (Preacher, Rucker & Hayes, 2007) using the UCLA Stata FAQ, (http://www.ats.ucla.edu/stat/stata/faq/modmed.htm#model5).  Similar to my previous inquiry about writing stata codes for mediation analysis, it involves -sureg- and -nlcom-. This time, I'm having trouble calculating conditional indirect effect.  Below is my stata code:
> 
> //RENAME vars for simplification
> rename CESD y /* dependent variable */
> rename PRD x1  /* independent variable */
> rename GC3E m1 /* mediator variable 1 */
> rename ES w /* moderator variable */
> 
> /*-sureg-&-nlcom- methods*/
> set more off
> summarize w
> global m=r(mean)
> global s=r(sd)
> capture generate wx1=w*x1 /* moderator(ES) by IV(PRD) */
> capture generate m1w=m1*w /* Mediator 1(GC3E) by Mod(ES) */
> 
> set more off
> sureg (m1 x1 w i.SEX AGE EDU i.UNEMP i.MARSTS i.NATIVITY) ///
>      (y x1 w wx1 m1 m1w i.SEX AGE EDU i.UNEMP i.MARSTS i.NATIVITY) if NMV5==1
> 
> //Conditional indirect effect via m1 with w
> nlcom ([m1]_b[x1]+($m-$s)*[m1]_b[wx1])*([y]_b[m1]+($m-$s)*[y]_b[m1w])  /*mean - 1sd*/
> 
> Everything appears to run without an error until the last -nlcom- command. The error message reads, "[wx1] not found."  r(111).  Any suggestion or insight into resolving this would again be greatly appreciated!
> 
> Best,
> isok
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index