Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Richard Williams <richardwilliams.ndu@gmail.com> |
To | statalist@hsphsun2.harvard.edu, statalist@hsphsun2.harvard.edu |
Subject | Re: st: marginal effect after xtlogit model |
Date | Tue, 25 Oct 2011 22:49:40 -0500 |
At 09:15 PM 10/25/2011, ramesh wrote:
Hello, I am using xtlogit model, which is in the form of: y= b0+b1.x1+b2.x1*x1+b3.x3 +b4.x4). I have one squared term (x1*x1) and two of my independent variables (x3 and x4) are binary and after using the 'xtlogit y x1 c.x1#c.x1 x3 x3' followed by 'margins, dydx(*) atmeans' I got the same beta coefficient as marginal effect, which is not correct. Is there any idea to correctly specify the marginal effect?
For binary and other categorical variables, you should explicitly indicate that the variable is categorical by using the i. notation. Otherwise margins will assume the variable is continuous. In this case,
xtlogit y x1 c.x1#c.x1 i.x2 i.x3I also prefer to not use the atmeans option, but some people disagree about this and it may not make much difference in practice.
I think your main problem, though, is that the default predict option for xtlogit is (I think) xb. See help xtlogit postestimation##predict and figure out what option you want to use instead, and specify it as part of the -predict- option on margins.
------------------------------------------- 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 WWW: http://www.nd.edu/~rwilliam * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/