Statalist


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

st: question on margins and interaction between factor and continuous var


From   Robert Duval <rduval@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: question on margins and interaction between factor and continuous var
Date   Sat, 3 Oct 2009 21:55:28 -0500

Dear all,

I am a bit confused about the syntax of margins.

I have a model where I interact a categorical variable, say cat, with
a continuous variable say cont. For simplicity assume cat has 3
levels.

The command would generically look like

command depvar i.cat cont i.cat#c.cont

I want to obtain the marginal effects of

cat2
cat3
cont
cat2#cont
cat3#cont

However, when i run margins as

margins , dydx(cat cont)

I obtain the overall average marginal effects for each variable
(averaging out the interaction)

if i run

margins cat  , dydx(cont)

i obtain what it seems to be the average marginal effects for
different levels of cat, i.e. cat2#cont cat3#cont

But then how to obtain the marginal effects for cat2 and cat2 (i.e.
when cont==0)?

Thanks for any advice,

robert
*
*   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   |   What's new   |   Site index