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, 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 <>
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   |
                              An Introduction to Stata Programming  |
   An Introduction to Modern Econometrics Using Stata  |

*   For searches and help try:

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