Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

Re: st: problem running mfx after glm

From   Richard Williams <[email protected]>
To   [email protected], "'[email protected]'" <[email protected]>
Subject   Re: st: problem running mfx after glm
Date   Mon, 15 Aug 2011 19:19:33 -0500

At 05:27 PM 8/15/2011, Marlis Gonzalez Fernandez wrote:

Did the following analysis last fall:

glm  ReadingCompCombdiv100 education, family(binomial) link(logit) robust

followed by:

mfx, at(mean)

This provided me with the marginal effects after glm (variable of interest is a proportion).

Any idea why this is giving me a problem.having trouble figuring out how to do this using margins instead of mfx.

Here is a simple example, that should work in Stata 11 or later:

use "";, clear
glm  warmlt3 yr89 male white age ed prst, link(logit) family(binomial) robust
mfx, at(mean)
glm warmlt3 i.yr89 i.male i.white age ed prst, link(logit) family(binomial) robust
margins, dydx(*) atmeans

Note how, the 2nd time around, I added the i. before the names of the categorical independent variables. This is necessary so that margins will know they are categorical; otherwise it would treat them as continuous when computing the marginal effects.

Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  [email protected]

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index