[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: marginal effect

From   Maarten buis <>
Subject   Re: st: RE: marginal effect
Date   Tue, 19 Feb 2008 15:15:12 +0000 (GMT)

--- "Tamas Bartus (tbartus)" <> wrote:
> There is another difference between mfx and margeff: for continuous
> variabels, the former calculates marginal change, the latter discrete
> change. The unit of the discrete change is the unit of measurement of
> the variable. 

Ah, I did not see that (I was still used to old -margeff-, which
computed the average marginal effect). I can now exactly reproduce the
results of -margeff-: 

*----------------------- begin example -----------------------------
sysuse auto, clear
logit foreign mpg length

predict double xb if e(sample), xb
gen double mfx_mpg = (invlogit(xb + _b[mpg]) - ///
                      invlogit(xb - _b[mpg])) / 2
gen double mfx_length = (invlogit(xb + _b[length]) - ///
                         invlogit(xb - _b[length])) / 2

sum mfx*

*------------------------ end example -----------------------------
(For more on how to use examples I sent to the Statalist, see )

It might be an idea to add an option for average marginal effects. I
believe some economists are pretty fond of average marginal effects
(though, in the example in my previous post in this thread, the two
happened to be the same up to 4 digits...) 


Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

Support the World Aids Awareness campaign this month with Yahoo! For Good
*   For searches and help try:

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