Another solution is to use the -unab- command. See the example below:
*----------- begin example -----------
sysuse auto, clear
xi: reg price mpg i.rep78
unab rep : _Irep*
test `rep'
*----------- end example -------------
Hope this helps,
Maarten
--- Nick Cox <[email protected]> wrote:
> One answer to this is to recast your problem
> as an -anova- problem. Then you have one continuous
> and one categorical predictor.
>
> anova y x1 x2, continuous(x1)
>
> Nick
> [email protected]
>
> Hui Wang
>
> > When we use xi command in regression, say "xi: reg y x1
> > i.x2", and suppose
> > that the discrete variable x2 takes 10 possible value. After
> > the regression,
> > what is the command to test the joint significance of the x2
> dummies
> > generated by stata?
> >
> > I've tried the following:
> >
> > xi: reg y x1 x2
> >
> > xi: test i.x2;
> > test _Ix2_*;
> > test _Ix2_1-_Ix2_9;
> >
> > Neither of them works. (I really do not want to enter
> > something like: test
> > _Ix2_1 _Ix2_2 ... _Ix2_9.)
>
> *
> * 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/
>
-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands
visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434
+31 20 5986715
http://home.fsw.vu.nl/m.buis/
-----------------------------------------
___________________________________________________________
All New Yahoo! Mail � Tired of unwanted email come-ons? Let our SpamGuard protect you. http://uk.docs.yahoo.com/nowyoucan.html
*
* 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/