Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: re: margeff/margins discrepancy


From   Kit Baum <baum@bc.edu>
To   statalist@hsphsun2.harvard.edu
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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index