Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Repeated ANOVA

Subject   Re: st: Repeated ANOVA
Date   Tue, 26 Aug 2003 09:53:50 -0500

Ricardo Ovaldia <> asks:

> I have a completly balance repeated anova (I think)
> and want to make sure that I am setting it up
> correctly. There are 3 factors: 
> Method (2 levels)
> Temperature(4 levels)
> Incubation time (3 levels)
> Therefore, I have 24 treatment combinations. The
> outcome is the amount of DNA (or log(DNA)). 
> There are 10 subjects, and each donated 24 samples,
> one sample for each treatment combination. Each
> individual's samples were randomly allocated to a
> treatment "group" to control for any order or sample
> effect.
> I set the anova as:
> . anova DNA method temp inctime subject, repeat(method
> temp inctime)
> Is this correct?
> Also, how do I specify two-way interactions so that
> they are tested with the correct error term?

You might find the repeated measures examples in "[R] anova"
helpful as well as the examples in

Before writing down your -anova- command you should first
determine which factors are fixed and which are random.  Then you
can determine the appropriate error terms based on that.  See the
book by Winer, Brown, and Michels

or some other experimental design / ANOVA book to see how you go
about determining which terms are used to test which other terms
in your ANOVA.

Your situation is similar to the example at

But in your case you have 3 instead of 2 repeated variables.

Just off the top of my head, if method, temp, and inctime are
fixed and subject random.  I would guess (I didn't go through the
steps to verify -- you should) that the full model would have the
following terms

    Term                 Tested with
    --------------       -----------
    subject              <doesn't matter, test is usually ignored>
    method               meth*subj
    temp                 temp*subj
    temp*meth            temp*meth*subj
    inctime              inct*subj
    inct*meth            inct*meth*subj
    inct*temp            inct*temp*subj
    inct*temp*meth       inct*temp*meth*subj

We drop the inct*temp*meth*subj and it becomes residual error.
(If we did not, then residual would have 0 degrees of freedom.)
So I would execute

    anova DNA sub meth / meth*subj                 ///
              temp / temp*subj                     ///
              temp*meth / temp*meth*subj           ///
              inct / inct*subj                     ///
              inct*meth / inct*meth*subj           ///
              inct*temp / inct*temp*subj           ///
              inct*temp*meth / , repeated(inct temp meth)

You will probably need to set your matsize larger; see help

If you do not care about the 3 way interactions (i.e., willing to
assume them zero) you might run

    anova DNA sub meth / meth*subj                 ///
              temp / temp*subj                     ///
              inct / inct*subj                     ///
              temp*meth                            ///
              inct*meth                            ///
              inct*temp / , repeated(inct temp meth)

Again, I urge you to verify which terms should be tested by which
other terms.  I provided the above off the top of my head.

Ken Higbee
StataCorp     1-800-STATAPC

*   For searches and help try:

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