
From  Christian Genova <cagenova@avrdc.org> 
To  statalist@hsphsun2.harvard.edu 
Subject  Re: st: wsanova syntax 
Date  Wed, 04 Oct 2006 16:46:52 +0800 
Christian Genova wrote:
Can someone kindly lend assistance on the wsanova syntax for repeated
measures. I'm still a novice with STATA so hope anyone can assist.
There are 2 repeated variables: id and control. ID is person belonging
to group "control". Tthe same persons in year 1 (id) belonging to group
(control) were analyzed in time 2.
I want to compare the scores in time 1 and 2, between time (scores in
time 1 compared with scores in time 2) and control in time 1 and 2
(whether there was signicant difference in scores of "control 1" at time
1 to scores at time 2, and within "control" in time 1 and 2 (whether
there was significant difference between scores of "control 1 and 2" in
time 1 compared to time 2).
time id control score

1 1 1 5
1 2 1 6
1 3 1 5
1 1 2 3
1 2 2 4
2 1 1 7
2 2 1 8
2 3 1 5
2 1 2 2
2 2 2 10
I used: wsanova SCORE CONTROL, id(ID) between(TIME). Is this correct?

The syntax for wsanova doesn't look right.
>From your description, I'm assuming that id is nested under control, that
is, that id #1 under control #1 is not the same person as id #1 under
control #2. If that's the case, then the syntax for wsanova would look
more like that below for your setup. (Note that repeated() or epsilon
is superfluous with only two levels of the time factor.)
Keep in mind that what you've displayed is an unbalanced dataset. And that
some of the of contrasts you're after (if I followed your description
correctly) would involve Satterthwaite weighting of between and within
variances.
Have you considered forgoing ANOVA and just use Student's ttest for the
specific comparisons of interest?
Type help ttest for syntax for paired and independent samples.
Alternatives could be the MannWhitney U / Wilcoxon ranksum (ranksum) and
Wilcoxon signrank(signrank) tests.
Joseph Coveney
clear
set more off
input time id control score
1 1 1 5
1 2 1 6
1 3 1 5
1 1 2 3
1 2 2 4
2 1 1 7
2 2 1 8
2 3 1 5
2 1 2 2
2 2 2 10
end
compress
replace id = control * 10 + id
order control id time
sort control id time
list, noobs sepby(control)
anova score control / idcontrol time time*control, repeated(time)
wsanova score time, id(id) between(control) epsilon
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–2015 StataCorp LP  Terms of use  Privacy  Contact us  What's new  Site index 