Stata: repeated ANOVA 作法
Stata 在repeated ANOVA方面,文件不多,最近因為一個計畫需要用到這種方析方式,花了不少時間學習。用完之後趕快寫下一點心得,以免以後健忘。
Stata 的repeated ANOVA必須將資料將寬格式轉換成長格式,如果不知道這些名詞,請參考這篇 Stata: reshape 將資料從寬格式改成長格式。
下面的code有點複雜,請慢慢看。
anova dtest group / uid|group times times#group, repeated(times)
最前面的anova,是分析的指令,後面接的dtest,就是資料變成長格式之後,學生在不同時間的測試分數,所以就是要看不同時間測試分數的變化。
group的不同的組,這是一個categorical variable,不同的數值代表不同的實驗組別。
如果作一般的anova,就是這部分。
接下來會看到/,在stata 的說明文件裡是這麼說的:
The / symbol is allowed after a term and indicates that the following term is the error term for the preceding terms.…