Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[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 <[email protected]>
To
[email protected]
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:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/