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

Re: st: many dummy variables in one variable


From   Seb Buechte <[email protected]>
To   [email protected]
Subject   Re: st: many dummy variables in one variable
Date   Thu, 13 Oct 2005 08:55:11 +0200

Scott,

how about using -xi- instead of creating dummy variables (xi will
create dummy vars as needed)?

xi: reg y x i.industry

will do the same as

tab industry, gen(ids)
reg y x id1 ids2 ....

Kind regards,
seb

On 10/13/05, Scott Cunningham <[email protected]> wrote:
> On Oct 12, 2005, at 10:48 PM, FUKUGAWA, N. wrote:
>
> > Suppose we create dummy variables from ids1 to ids50 by writing
> > tab industry, gen(ids) ,
> > how can I include 50 dummies in the model instead of writing
> > reg y x ids1 ids2 ids3 ... ids50 ?
> > Thanks in advance.
>
> I usually do it like this:
>
> reg y x ids*
>
> So long as you don't have other variables, besides the dummies, with
> that kind of prefix (ids--), then regress y onto all fifty  dummies,
> as well as x.
>
> scott cunningham
> dept. of economics
> university of georgia
> athens, ga
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>


--
- Seb F Buechte
-
- Stay tuned!

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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