4.2.1 - Nested Model in SAS

Here is the example given in the textbook in Section 26.1.

data nested1;
input School $ Instructor response;
datalines;
Atlanta      1      25
Atlanta      1      29
Atlanta      2      14
Atlanta      2      11
Chicago      1      11
Chicago      1      6
Chicago      2      22
Chicago      2      18
SanFran      1      17
SanFran      1      20
SanFran      2      5
SanFran      2      2
; run;

proc mixed data=nested1 method=type3;
class School Instructor;
model response = School Instructor(School);
store nested1;
run;

ods graphics on;
ods html style=statistical sge=on;
proc plm restore=nested1;
lsmeans School / adjust=tukey plot=meanplot cl lines;
lsmeans Instructor(School) / adjust=tukey plot=meanplot cl lines;
ods exclude diffs diffplot;
run;;

When we run this SAS program, here is the output that we are interested in:

Type 3 Analysis of Variance
Source DF Sum of Squares Mean Square Expected Mean Square Error Term Error DF F Value Pr > F
School 2 156.500000 78.250000 Var(Residual)+Q(School,Instructor(School)) MS(Residual) 6 11.18

<.0095

Instructor(School) 3 567.500000 189.166667 Var(Residual)+Q(Instructor(School)) MS(Residual) 6 27.02 0.0007
Residual 6 42.000000 7.000000 Var(Residual)        
sas output

Tukey Grouping for School

Least Squares Means (Alpha=0.05)

LS-means with the same letter are not significantly different
fert Estimate    
Atlanta 19.7500   A
      A
Chicago 14.2500 B A
    B  
SanFran 11.0000 B  

 

Instructor(School) Least Squares Means
School Instructor Estimate Standard Error DF t Value Pr > |t| Alpha Lower Upper
Atlanta 1 27.0000 1.8708 6 14.43 <.0001 0.05 22.4222 31.5778
Atlanta 2 12.5000 1.8708 6 6.68 0.0005 0.05 7.9222 17.0778
Chicago 1 8.5000 1.8708 6 4.54 0.0039 0.05 3.9222 13.0778
Chicago 2 20.0000 1.8708 6 10.69 <.0001 0.05 15.4222 24.5778
SanFran 1 18.5000 1.8708 6 9.89 <.0001 0.05 13.9222 23.0778
SanFran 2 3.5000 1.8708 6 1.87 0.1106 0.05 -1.0778 8.0778
 
 
 
sas output

Tukey Grouping for Instructor(School)

Least Squares Means (Alpha=0.05)

LS-means with the same letter are not significantly different
fert species Estimate      
Atlanta 1 27.0000   A  
        A  
Chicago 2 20.0000 B A  
      B A  
SanFran 1 18.5000 B A C
      B  

C

Atlanta 2 12.5000 B D C
        D C
Chicago 1 8.5000   D C
        D  
SanFran 2 3.5000   D