Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: Cannot use eyex(*) option after logit with factor variables

From   Marcelo Lafleur <>
Subject   st: Cannot use eyex(*) option after logit with factor variables
Date   Fri, 22 Feb 2013 13:59:00 -0500

Dear listmembers,

I'm attempting to estimate elasticities using a logit model:

. logit neting1 gastpc atenpre##saneamiento
. margins, eyex(*) atmeans

        ERROR: "factor variables not allowed in option eyex()"

However, using dydx, there is no problem:
. margins, dydx(*) atmeans

To get around this problem, I have created the categorical variables of 
interaction using either the command -xi- or  -tabulate ,generate()-.Then 
I run the same -logit- using the categorical variables created:

. xi i.atenpre|saneamiento, prefix(_S)

. logit neting1 gastpc atenpre saneamiento  _SateXsanea_1
. margins, eyex(*) atmeans

        This produces the output.

I'm not 100% sure if this is a statistical/mathematical issue, or just a 
limitation of the margins command using factor variables. Needless to say, 
this is annoying as it requires preprocessing many variables in my model 
to create the proper categorical variables, which could easily be done 
with factor variables. I spent an entire afternoon trying to figure out 
what -xi- is actually outputting and how to make it equivalent to the 
var1##var2 option (as opposed to the var1#var2 option).

Hope someone can shed light on this issue.

Stata version:
Stata/SE 12.1 for Windows (32-bit)
Revision 30 Jan 2013
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index