/* Example SAS code for two-way nested model (Table 7.7) */

 

Data table7_7;

 input Day Run Rep Y;

 Datalines;

1 1 1 42.5

1 1 2 43.3

1 1 3 42.9

1 2 1 42.2

1 2 2 41.4

1 2 3 41.8

2 1 1 48.0

2 1 2 44.6

2 1 3 43.7

2 2 1 42.0

2 2 2 42.8

2 2 3 42.8

3 1 1 41.7

3 1 2 43.4

3 1 3 42.5

3 2 1 40.6

3 2 2 41.8

3 2 3 41.8

;

 

Proc glm;

        class Day Run;

        model Y=Day Run(Day)/ E1;

        random Day Run(Day)/test;

            output out=ta77 p=yhat r=resid;

run;

 

Proc gplot;

        plot resid*yhat='R';

run;