This question relates to the use of multiple variable lists (parallel lists).
I have a dataset with many physiologic measures collected at two time points.
There are three grouping variables (gp1, gp2, gp3).
I'm running ANCOVAs to determine whether the physiologic data at time 2 differ between groups controlling for time 1.
Each grouping variable is tested separately, so I have a set of ANCOVA's for each grouping variable.
The leading character in the variable name denotes the time point, and it is an alpha character.
Ex.
anova bt at gp1, cont(at)
anova btx atx gp2, cont(atx)
anova btz atz gp3, cont(atz)
etc.
The set of physiologic measures is long, so I want to call two lists in the anova command. I can't figure out how to do that.
I don't want to change the variable names, as this dataset is familiar to the investigators.
I can use -foreach- to call each group variable separately, saving some time, as follows:
local gp "gp1 gp2 gp3"
foreach var of varlist `gp' {
anova bt at `var'
anova btx atx `var'
anova btz atz `var'
}
But I'd like to figure out a way to call the lists of variables to reduce the number of anova commands, something like:
anova `var2' `var1' `gp', cont(`var1')
Is there a way to do that?
Thanks for your help.
Cathy
*
* 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/