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

Re: st: Repeated ANOVA


From   [email protected]
To   [email protected]
Subject   Re: st: Repeated ANOVA
Date   Tue, 26 Aug 2003 09:53:50 -0500

Ricardo Ovaldia <[email protected]> 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

    http://www.stata.com/support/faqs/stat/anova2.html

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

    http://www.stata.com/bookstore/sped.html

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

    http://www.stata.com/support/faqs/stat/anova2.html#half713

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
    meth*subj
    --------------
    temp                 temp*subj
    temp*subj
    --------------
    temp*meth            temp*meth*subj
    temp*meth*subj
    --------------
    inctime              inct*subj
    inct*subj
    --------------
    inct*meth            inct*meth*subj
    inct*meth*subj
    --------------
    inct*temp            inct*temp*subj
    inct*temp*subj
    --------------
    inct*temp*meth       inct*temp*meth*subj
    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
matsize.

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    [email protected]
StataCorp     1-800-STATAPC

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index