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

st: RE: question from statalist

From   "Paley, Irina" <>
To   "" <>, stata list <>
Subject   st: RE: question from statalist
Date   Wed, 8 Apr 2009 18:59:07 -0400


Thanks so much for the detailed reply!

I already have one more question--I am having difficulties using the margeff command.

I have two specifications-- with state dummies and without. When I include state dummies, stata issues an error after margeff saying:

estimates post: matrix has missing values

Question number 2 is the following. When I don't include state dummies, stata computes margeff and shows it to be positive, while the coefficient itself is negative  (and mfx estimate is negative). What are the conditions under which this can take place? I thought that unlike magnitudes, the direction of the coefficients should stay the same whichever way we estimate the marginal effects...

Thanks so much for your help!


-----Original Message-----
From: Maarten buis [] 
Sent: Wednesday, April 08, 2009 9:13 AM
To: stata list
Subject: Re: question from statalist

--- Irina Paley has trouble posting to statalist and asked ma privately:
> Basically, I am running an mlogit for a choice between 4 products, and 
> when I don't include state dummies in the regression, mfx gives me 
> statistically significant result for gender. But if I include state 
> dummies in mlogit, mfx gives gender effect that is not stat sig. 
> However, I also get this:
> run mlogit controlling for state, and set state dummies to 0 when 
> asking for mfx: gender effect is stat sig, and similar to when I don't 
> control for states in mlogit run mlogit controlling for state, and ask 
> mfx for a specific state: gender effect is stat sig, and similar to 
> when I don't contorl for states in mlogit
> probits also give stat sig effect of gender.
> why are results not stat sig when I ask for marginal effects after 
> controlling for state? is it legitimate here to control for states in 
> regressions but not include states in the mfx calculation? why does 
> dprobit not have the same problem?

I don't think this is a problem. The marginal effect of any variable in a non-linear model like -mlogit- or -probit- depends on the values of all the covariates in the model, so it could very well happen that the coefficient is significant and the marginal effect of that variable is  not significant for some combinations of values for the covariates. 

The key is to decide what combination of values makes sense to you. If you include the variable in the -mlogit- model but don't specify in -mfx- it will be set at the mean, which I don't think makes sense. 

Below I will give you a probably incomplete list of your options, and at the bottom an example that implements these.

If you set all the dummies at zero you estimate the effect of gender in the state you left out (the reference category), which may or may not make sense. 

If you can added the state dummies using effect coding and in
-mfx- set the state dummies to zero then you estimate the effect of gender for the average state. You can include dummies as effect coding using Michael Mitchell's and Phil Ender's -xi3-.
Type -findit xi3- to find it. 

You can interpret the exponentiated coefficients as odds ratios.
These don't depend on the values of the other varialbes, which greatly simplifies the interpretation. You can get thos by just specifying the -rrr- option in -mlogit- (some people just like to call these relative risk ratios, see here for my vies on it: .)

Yet another reasonable approach is to estimate the partional effects for each individual and average these. This way you get the average effect. You can do that with Tamas Bartus'
-margeff- package. Type -findit margeff- to find it.

In sum you are trying to summarize a non-linear relationship with a single number. The odds ratios provide an exact representation of the results of your model, but all other approaches further simplify your model. As with any simplification this requires a judgement call about which simplification makes most sense in your particular situation.

*------------------ begin example ------------------------ sysuse auto, clear egen prclass = cut(price), group(3) recode rep78 1/2=3
xi3: mlogit rep78 i.prclass foreign

// this doesn't make sense
mfx, predict(pr eq(#1)) var(foreign)

// the effect of foreign in the lowest price class
mfx, predict(pr eq(#1))                       ///
   at(_Iprclass_1=0 _Iprclass_2=0 foreign =0) ///

// the effect of foreign in the highest price class
mfx, predict(pr eq(#1))                       ///
   at(_Iprclass_1=0 _Iprclass_2=1 foreign =0) ///

// the effect of foreign for an averagely priced car
xi3: mlogit rep78 e.prclass foreign
mfx, predict(pr eq(#1))                       ///
   at(_Iprclass_1=0 _Iprclass_2=0 foreign =0) ///

// report the odds ratios
xi: mlogit rep78 i.prclass foreign, rrr

// averaged partial effects
*------------------ end example -----------------------

Hope this helps,

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen


*   For searches and help try:

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