|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: margins and interactions
Ed Levitas <[email protected]> is using -xtreg- with a linear and squared term
for a continuous independent variable in his model, and is trying to compute
elasticities using the -margins- postestimation command:
> I apologize for the simplicity of this question but I can't seem to
> solve a problem.
>
> I am trying to compute elasticities of variables in a regression model
> (using xtreg,fe). The model includes a squared term (iv2 squared).
>
> My simplified model is:
>
> xtreg dv iv1 c.iv2##c.iv2.
>
> I've tried a number of variants of the margins command (e.g. "margins,
> eyex(iv1 c.iv2##c.iv2)") but I continually receive errors.
>
> Can someone point me to a reference or provide suggestions about the
> correct syntax for the margins command?
Using the above simplified mode, it appears that Ed wants
. margins, eyex(iv1 iv2)
Ed can use the '*' shortcut to compute the average elasticity for each
indepvar in the model
. margins, eyex(*)
The following will compute the elasticities where all the indepvars have been
set to their mean
. margins, eyex(*) atmeans
--Jeff
[email protected]
*
* 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/