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 logistic outcome
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: moderated mediation logistic outcome
Date
Fri, 28 Oct 2011 09:09:58 +0100
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
<[email protected]> 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/