Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: moderated mediation logistic outcome


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: moderated mediation logistic outcome
Date   Fri, 28 Oct 2011 09:15:21 +0100

That's not an exact equivalent, as it treats missings in -usepurchase-
differently, but is more likely to be what is wanted if any missings
exist.

On Fri, Oct 28, 2011 at 9:09 AM, Nick Cox <njcoxstata@gmail.com> wrote:
> Sorry, no idea on your main question. Just a comment that
>
>        generate switch    = .
>        replace  switch = 0 if (usepurchase <= 1)
>        replace  switch = 1 if (usepurchase >= 2)
>        rename switch y  /* dependent variable   */
>
> can be rewritten as one line
>
>       gen y = usepurchase >= 2 if usepurchase < .
>
> Nick
>
> On Fri, Oct 28, 2011 at 8:57 AM, Tobias Schlager
> <tobias.schlager@unisg.ch> wrote:
>> Dear List
>>
>> I am encountering a problem with moderated mediation. I wanted to use
>> moderated mediation as in the link below specified by Preacher et al.,
>> however, my dependent variable is binary.
>> For this, I was trying to implement a logistic regression, however, I am
>> not sure about the correct specification, because from what I know sureg
>> is only for linear regression.
>>
>> Here is my specification which relates to model 1 of the link below:
>>        use "x.dta", clear
>>        generate switch    = .
>>        replace  switch = 0 if (usepurchase <= 1)
>>        replace  switch = 1 if (usepurchase >= 2)
>>        rename switch y  /* dependent variable   */
>>        rename satis x     /* independent variable */
>>        rename dbpu m     /* mediator variable    */
>>        quietly summarize x
>>        global m=r(mean)
>>        global s=r(sd)
>>        generate mx=m*x  /*  mv by iv interaction */
>>        sureg (m x)(y m x mx)
>>
>> It would be great if anybody knew how to do this. Thanks a lot,
>> Tobias
>>
>>
>> http://www.ats.ucla.edu/stat/stata/faq/modmed.htm#model1
>

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


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index