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]

st: using margins to analyze moderation of a quadratic relationship


From   Constantin Alba <[email protected]>
To   [email protected]
Subject   st: using margins to analyze moderation of a quadratic relationship
Date   Tue, 23 Jul 2013 17:56:41 +0300

I am trying to use margins to analyze the moderation of a quadratic relationship

here is the model:

Y = b1 + b2*X + b3*X*X + b4*X*M + b5 *X*X*M

where M is the moderating variable.

to do so I tried to adapt the usage of margins from here
http://www.ats.ucla.edu/stat/stata/faq/conconb11.htm

in the following way:

*///////////////

regress Y c.X##c.M c.X2##c.M
*// X2= X*X

margins, dydx (X X2) at (M=(1 (1) 16))

matrix s=r(b)

margins, at (X=0 X2=0 (M=1 (1) 16)) asbalanced

matrix i=r(b)

*/////////////

question 1: am I doing all correctly up to this point?
question 2: I would like to draw the resulted curves, and cannot
figure the way to do so
question 3. how i change the code to include all other (i.e. control) variables?

thank you in advance

Constantin
*
*   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