Bookmark and Share

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   John Ataguba <johnataguba@yahoo.co.uk>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Categorical variable in regression
Date   Thu, 24 Jan 2013 12:06:55 +0000 (GMT)

Dear Maarten

Thank you very much for the brilliant suggestions!

You're a star!

Regards

Jon 

>________________________________
> From: Maarten Buis <maartenlbuis@gmail.com>
>To: statalist@hsphsun2.harvard.edu 
>Sent: Wednesday, 23 January 2013, 15:37
>Subject: Re: st: Categorical variable in regression
> 
>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/
>
>
>   

*
*   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/


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