Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: the xi: command


From   Chris Bojke <cb23@york.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: the xi: command
Date   Thu, 04 Jul 2002 11:17:49 +0100

and to avoid the dummy variable trap you should use the noconstant
option on the regression.

If there are too many dummy variables to create easily you could use xi
as a command in itself rather than a command prefix and then just
compute the omitted dummy yourself.

so

xi i.varname to create a list of n-1 dummies and then create the last
dummy in the normal manner

then

reg y x dummies, noconstant 

Daniel Muller wrote:
> 
> that'll do it:
> 
> gen a = (var==1) if var ~=.
> gen b = (var==2) if var ~=.
> gen c = (var==3) if var ~=.
> gen d = (var==4) if var ~=.
> 
> etc.
> 
> Daniel
begin:vcard 
n:Bojke;Chris
tel;cell:0795 818 3140
tel;fax:(01904) 432700
tel;work:(01904) 432694
x-mozilla-html:FALSE
org:National Primary Care Research & Develpoment Centre;Centre for Health Economics
version:2.1
email;internet:cb23@york.ac.uk
title:Research Fellow
adr;quoted-printable:;;Room D146=0D=0AAlcuin College=0D=0AUniversity of York;York;;YO10 5DD;United Kingdom
fn:Chris Bojke
end:vcard



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index