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

Re: st: margins and interactions

From (Jeff Pitblado, StataCorp LP)
Subject   Re: st: margins and interactions
Date   Tue, 01 Sep 2009 16:51:07 -0500

Ed Levitas <> had a follow-up question about -margins-:

> Thanks for the response. So technically I can get the elasticity of the
> "main" iv2 effect but not the effect decomposed into iv2-squared and
> iv2-residual?

Short answer:


-margins- produces marginal effects and elasticities for individual variables
in the dataset that were used as independent variables in the model fit.

Long answer:

Here is the break-down for what the marginal effects and elasticities options
mean in the -margins- command:

	option		definition		simplification
	dydx()		     dy/dx
	eyex()		d ln(y)/d ln(x)		dy/dx * (x/y)
	eydx()		d ln(y)/dx		dy/dx * (1/y)
	dyex()		     dy/d ln(x)		dy/dx * (x)

where 'y' denotes the user specified prediction, and 'x' is an indepvar.  By
'indepvar' I mean a single variable in the Stata dataset used to fit the

As mentioned in the 'Expression derivatives as elasticities' subsection in the
'Remarks' section of '[R] margins',

	eyex() is the proportional change in y for a proportional change in x

If 'x' appears in the model multiple times, as in Ed's orignal example

	. xtreg dv iv1 c.iv2##c.iv2

which is a shortcut for

	. xtreg dv iv1 iv2 c.iv2#c.iv2


	. margins, eyex(iv2)

will compute the average of the proportional changes in the linear prediction
for proportional changes in 'iv2'.

-margins- is aware that 'iv2' is present in both linear and squared terms in
this model and computes the derivatives with respect to the variable 'iv2'.

*   For searches and help try:

© Copyright 1996–2023 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index