/* ------------------------------------------------------ FILE: Example of a nested ANOVA with random effects and MANOVA DATA: An experimental educational intervention was introduced into 5 different schools (with 5 other schools acting as controls). Four fresheman homerooms within each school was tested. Testing consisted of a baseline measure and two post- intervention testings PURPOSE: illustrate random nested effects and MANOVA -------------------------------------------------------- */ OPTIONS NOCENTER NODATE PAGENO=1 LINESIZE=80; TITLE Nested ANOVA; TITLE2 AKA: Hierarchical Linear Models; DATA education; INPUT Treatment School Class Baseline Time1 Time2; DATALINES; 0 1 1 22.4 63.0 56.1 0 1 2 58.0 65.4 57.7 0 1 3 50.3 63.7 81.3 0 1 4 64.9 77.0 69.5 0 2 1 51.0 56.5 77.0 0 2 2 58.8 63.0 52.3 0 2 3 62.4 57.7 79.3 0 2 4 56.2 58.3 53.3 0 3 1 17.4 25.1 65.1 0 3 2 32.7 37.8 38.9 0 3 3 14.2 29.3 44.6 0 3 4 43.0 43.6 47.4 0 4 1 55.1 85.3 66.5 0 4 2 62.0 69.4 74.1 0 4 3 62.6 69.0 64.7 0 4 4 60.1 41.7 68.3 0 5 1 61.6 71.5 52.1 0 5 2 35.8 43.8 64.4 0 5 3 48.6 73.0 76.8 0 5 4 50.4 70.9 51.5 1 1 1 48.0 51.0 65.4 1 1 2 41.2 72.8 79.4 1 1 3 35.2 53.1 55.2 1 1 4 20.1 64.7 68.9 1 2 1 39.6 65.9 68.5 1 2 2 43.0 71.1 87.0 1 2 3 67.1 66.1 92.0 1 2 4 33.9 67.3 72.4 1 3 1 51.1 69.5 77.1 1 3 2 46.1 75.4 68.4 1 3 3 63.5 75.6 78.6 1 3 4 46.3 58.8 81.6 1 4 1 50.8 60.4 71.9 1 4 2 47.7 67.8 78.8 1 4 3 46.4 59.9 66.9 1 4 4 54.2 84.2 87.9 1 5 1 50.7 82.5 65.1 1 5 2 59.0 88.1 83.7 1 5 3 80.5 97.8 94.3 1 5 4 45.5 93.4 87.8 ; RUN; PROC GLM DATA=Education; TITLE3 Results ignoring random effects; CLASS Treatment School ; MODEL Time1 Time2 = Treatment School(Treatment) Baseline; RUN; TITLE3 Univariate tests using random effects; RANDOM School(treatment) / TEST; RUN; TITLE3 Manova using random effects; MANOVA H=Treatment E=school(treatment); RUN; QUIT;