Hui Wang wrote:
The -anova- seems to be useful to my problem. The additional question is
that when I run your example program, it automatically take x1=5 as the base
group in the regression. Is there any way to specify which value of x1 we
want to set as the base group? (I know it is fairly easy to do with -xi-.
Just type char x1[omit] 1 before the regression if we want x1=1 as the
base.)
--------------------------------------------------------------------------------
-anova-'s use of the highest-valued level follows the same convention as
SAS's PROC GLM and PROC ANOVA. (I don't know, but SPSS might choose the
same level, too.)
You can't specify the base group for -anova- with -char x1[omit]- to my
knowledge. You can do it in a couple of alternative ways, however.
First is to use -recode- to exchange value of the level of x1 that you want
to use as a base with that of the highest level. This is the easiest way.
(Take care with any value labels.)
Second is to use -xi3- or -desmat- to create effect-coding or deviation
indicator variables (what ANOVA typically uses). This way, you can
use -char x1[omit]- to specify the base level. (I think that both commands
have either an option or satellite command to specify the base or reference
level, too.) You'd use -regress- for the model fit, here.
The third possibility you might want to look into is to go ahead and
allow -anova- to use the highest level, and then use -lincom- afterward to
get what you want.
Joseph Coveney
*
* 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/