* do-file to demonstrate commands in the STB insert for aovsum * John R. Gleason * Syracuse University * 430 Huntington Hall * Syracuse, NY 13244-2340 * loesljrg@accucom.net * 04Jan2000 di in red "OK to clear?" more clear ** Example 1: aovsum, n(12 11 9 9) m(18.1 28.2 48.3 70.2) sd(8.54 14.3 12.4 14.0) * Repeat quietly, to get the synthetic data: more quietly aovsum, n(12 11 9 9) m(18.1 28.2 48.3 70.2) sd(8.54 14.3 12.4 14.0) keep list freq_ y_ cond_ ** Create a copy of the group variable: more gen byte Cond_ = cond_ ** Test for linear trend and deviation from linear trend: more anova y_ cond_ Cond_ [fw=freq_], cont(cond_) seq ** Repeat the trend tests, using the actual raw data: more use ldose, clear describe ** Create a copy of the group variable, again: more gen byte Rate = rate ** And run -anova-, again: more anova ldose rate Rate, cont(rate) seq more ** Example 2: ** Create synthetic data for 8 groups: more clear quietly aovsum, n(13 14 20 26 20 20 16 17) /* */ m(13.62 15.79 16.55 7.00 31.75 10.45 20.06 19.18) /* */ sd(12.07 17.49 14.75 6.11 22.07 10.68 14.22 17.90) /* */ keep names(days group) ** Create factors for race and grade in school: more gen byte race = mod(group-1, 2) gen byte grade = int((group-1)/2) ** Run the usual 2-way ANOVA with interaction: more anova days race grade race*grade [fw=freq_] ** Repeat, this time using the actual raw data: more use absences, replace describe ** And the ANOVA: more anova days race grade race*grade ** Done