Mar 282011

Seems that I am not the only one who is startled by Stata 11’s margins command, which does all sorts of amazing things. At a mere 50 pages (not counting the remarks on margins postestimation), the documentation is a little overwhelming, and there are just too many options. There are two separate issue that seem to confuse a lot of people (see this discussion on statalist on the then new margins command).

Marginal Effects at the Mean vs Average Marginal Effects

The first is that in the past when studying the implications from nonlinear (i.e. logit) models, many people including me used to analyse “marginal effects at the margin”. In short, this boils down to holding most  independent vars constant at their grand means/modes while plugging a range of hopefully relevant values for one or two focal variables into the equation.  This approach, which is known as analysing marginal effects at the mean, is easier to understand than to explain but can result in highly unrealistic scenarios if your independent variables are highly correlated (think of holding age constant while varying pensioner/non-pensioner status).

Therefore, looking at average marginal effects might make more sense. These are calculated by varying the focal variable while holding everything else at their variables. This is was the margins command does by default. Michael Norman Mitchell has a post that clearly illustrates the differences between the two approaches to the estimation of margins.   Moreover, there is an older article by Tamás Bartus on his margeff command that is also quite instructive.

Dubious Confidence Intervals

But one problem remains: margins uses a normal approximation for calculating confidence intervals. As a result, after estimating a model for categorical dependent variables, you might end up with a CI for your margins that includes zero, which obviously does not make much sense. Roger Newson seems to know how to get around this issue, but I haven’t tested this approach yet.

Click to share
  • 2

  3 Responses to “Me at the Margins: Average Marginal Effects, Marginal Effects at the Mean, and Stata's margins command”

  1. Hey Kai, looks like the Facebook SocialSync is working great on your site! 🙂 Very happy to see that! Pumped to have you using Livefyre. Welcome to the community!

  2. Thanks Ben – very useful indeed

Agree? Disagree? Leave a reply (also works with Facebook, G+, Disqus ...)