Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: using multiple variable lists in ancova


From   "Cathy L. Antonakos" <cathya@umich.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: using multiple variable lists in ancova
Date   Sat, 10 Nov 2007 23:43:41 -0500 (EST)

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/



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