# st: Re: ancova for repeated designs

 From Joseph Coveney To Statalist Subject st: Re: ancova for repeated designs Date Sun, 15 Aug 2004 13:08:00 +0900

```tmmanini wrote:

I'm trying to run a supposed simple ancova model, controlling for pre-test
values.  subjects are placed in three groups and then tested at three different
time points. I would like to covary for the first time point, examine the
group*covariate interaction and calculate the adjusted means.  I've listed 10
subjects (I really have 32) below (g=group, t=time, y=depvar, x=covariate).  g
is a between factor, t is a repeated factor.
[excerpted]
When I run this with the 10 subjects listed above, I can't get the interaction
term b/c the df=0 (see below)

anova y x g / id | g t g*t x*g, cont(x) rep(t)
[excerpted]
when I try the adjust command, I come up with blanks (below)

--------------------------------------------------------------------------------

It seems that you have used the response (dependent) variable's value at the
first timepoint (t ==1) as the covariate, x, and this seems to be what you mean
by "covary for the first time point."  If so, I imagine that you'd want to
include -if t > 1-.

Anyway, there is no variation of x within id, so there won't be any within the
id|g error term, either, and it should be put to the right of the id|g random
error term.  Repeated-measures ANOVA for time-invarying (and time-varying)
covariates are discussed in B. J. Winer, D. R. Brown, and K. M. Michels.
_ Statistical Principles in Experimental Design _ Third Edition. (New York:
McGraw-Hill, 1991).  I don't have my copy at-hand, but try something like

-anova y g / id|g x x*g t g*t if t > 1, repeated(t) continuous(x)- .

Double-check with Winer on this.

As for predicted values, id is in the list of regressors in -anova-, so you'd
need to include it in the list of -by()- variables and then limit the values to
three that represent the three groups, as follows:

adjust x if id<=4, by(g t id)

Joseph Coveney

P.S.  It seems that y takes on only six values, and a plurality is 1.  Consider
methods for limited dependent values, such as -reoprob- or -gllamm-.

*
*   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/
```