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: re: margeff/margins discrepancy
From
Kit Baum <[email protected]>
To
[email protected]
Subject
st: re: margeff/margins discrepancy
Date
Sun, 25 Apr 2010 11:35:04 -0400
<>
Joanne's problem arises because in the code for Bartus' margeff, version 2.2.0 of 20 Aug 2009 (on SSC),
the line
>
> qui replace `touse'=1
>
> // Calculation of partial effects and standard errors
causes the information in the `touse' indicator, which points to the selected cases (78/2246 in the example Joanne gave) to be lost. Lower down, a calculation like
> // Partial effect
> tempname me
> CalcME_B_`method' `hat1' `hat2' `dx1' `dx2' `touse' `weight'
passes the `touse' indicator to the subroutine CalcME_B_av to calculate AMEs, but the `touse' is set on for all cases. Thus
margeff is calculating AMEs for all available observations, not only those selected by if or in.
Kit Baum | Boston College Economics & DIW Berlin | http://ideas.repec.org/e/pba1.html
An Introduction to Stata Programming | http://www.stata-press.com/books/isp.html
An Introduction to Modern Econometrics Using Stata | http://www.stata-press.com/books/imeus.html
*
* 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/