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]
Re: st: Categorical variable in regression
From
Maarten Buis <[email protected]>
To
[email protected]
Subject
Re: st: Categorical variable in regression
Date
Wed, 23 Jan 2013 14:37:58 +0100
On Wed, Jan 23, 2013 at 1:00 PM, John Ataguba wrote:
> Note that I have suppressed the constant term in my regression - xi: reg y i.region, noconst noomit -. In that case there is no problem of the dummy trap. Based on Stata's documentation, the regression model I have specified is expected to run. Unfortunately, it is not running for me.
It is best to avoid the -xi:- prefix if you can; the current way of
handeling categorical variables are as factor variables, see: -help
fvvarlist-. So what you want is : -reg y ibn.region, noconst-. There
are a number of examples in this Stata tip: M.L. Buis (2012) "Stata
tip 106: With or without reference", The Stata Journal, 12(1), pp.
162-164.
If you really need to use the -xi:- prefix (e.g. you are using -qreg-
instead of -reg-) than the -noomit- option should be part of the -xi:-
prefix not -regress-, so: -xi, noomit: reg y i.region, nocons-
-- Maarten
---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany
http://www.maartenbuis.nl
---------------------------------
*
* 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/