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: Question about average marginal effects for logit models with dummy variables

From   Richard Williams <>
Subject   Re: st: Question about average marginal effects for logit models with dummy variables
Date   Mon, 08 Oct 2012 07:14:37 -0500

At 05:45 AM 10/8/2012, Tirthankar Chakravarty wrote:
-margins- inherits whether variables are discrete or continuous from
the estimation command that precedes it (in your case -logit-). In
turn, the estimation command does its best to gauge whether included
variables are discrete or continuous.

The part about the estimation command isn't quite right. Even if a variable is coded 0/1 margins will treat it as continuous unless you use factor variable notation. As Nick Cox explained once, margins needs to know if a variable is discrete, as opposed to, say, being a continuous variable that only happens to take on the values of 0 and 1 in the sample.

To change the default behaviour, or indeed to be cautious, it is
advisable to use the unary operators to denote continuous and
indicator variables, "c." and "i." (as documented in -help fvvarlist-)

Again, in the absence of any factor variable notation, the default behavior of margins is to assume variables are continuous. mfx, on the other hand, would assume a variable coded 0/1 was discrete. It is more than just being cautious -- margins won't handle discrete variables correctly if you are not using factor variable notation. If x1 is coded 0/1, the estimation command won't care if you refer to it as x1 or i.x1, but margins will.

The documentation for the -margins- command goes into great details on
these matters (-help margins-).


On Mon, Oct 8, 2012 at 3:41 PM, Bob Reed <> wrote:
> Hi, When Stata calculates AMEs for logit models with dummy variables, does it "know" that the dummy variable is discrete, and calculate its marginal effect accordingly?
> Bob Reed
> --------------------------------------------------------------------
> W. Robert Reed
> Professor and Head of Department
> Department of Economics and Finance
> University of Canterbury
> Private Bag 4800
> Christchurch
> New Zealand
> Phone: +64-3-3642846
> Fax: +64-3-3642635
> Email:
> Homepage:
> Replications Co-Editor, Public Finance Review
>  --------------------------------------------------------------------
> The curious task of economics is to demonstrate to men how little they really know about what they imagine they can design. - F.A. Hayek
> This email may be confidential and subject to legal privilege, it may
> not reflect the views of the University of Canterbury, and it is not
> guaranteed to be virus free. If you are not an intended recipient,
> please notify the sender immediately and erase all copies of the message
> and any attachments.
> Please refer to for more
> information.
> *
> *   For searches and help try:
> *
> *
> *
*   For searches and help try:

Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  Richard.A.Williams.5@ND.Edu

*   For searches and help try:

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