Statalist The Stata Listserver


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

Re: st: repeated anova


From   Joseph Coveney <[email protected]>
To   Statalist <[email protected]>
Subject   Re: st: repeated anova
Date   Tue, 28 Feb 2006 02:38:59 +0900

Ricardo Ovaldia wrote:

I am struggling with this seemly simple ANOVA, but I
can't get it set correctly. I have 40 students
randomly allocated to 4 experimental stress groups.
The diastolic blood pressure was measured for each
student at baseline and at five additional times. The
lay out is something like this:

[redacted]

Note that there are 10 students in each -group-, but
each student was measured at 6 different times. Could
someone please tell me what is the correct Stata
command for this repeated ANOVA?

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

Using the baseline blood-pressure value as a covariate in repeated-measures
ANCOVA might be a better option.  I believe that the ANCOVA set-up that's
shown in Winer is the first model fit procedure in the illustration below.
See www.stata.com/statalist/archive/2004-01/msg00032.html for the
references.

Joseph Coveney

clear
set more off
set seed `=date("2006-02-28", "ymd")'
set obs 6
forvalues i = 1/6 {
   generate float a`i' = 0.7 + 0.3 * (`i' == _n)
}
mkmat a*, matrix(A)
drawnorm bp0 bp1 bp2 bp3 bp4 bp5, corr(A) n(40) clear
generate byte student = _n
generate byte group = mod(_n, 4) + 1
* Begin here
rename bp0 baseline
reshape long bp, i(student) j(time)
anova bp baseline group / student|group ///
 time group*time, continuous(baseline) repeated(time)
exit

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