Nested Designs #2

Spray Example

Program Listing

OPTIONS LS=76 NODATE NONUMBER NOCENTER;

DATA spray;
 DO spray = 1 TO 3;
  DO tree = 1 TO 4;
   DO leaf = 1 TO 6;
    INPUT nitrogen @@;
    OUTPUT;
   END;
  END;
 END;
 DATALINES;
  4.50  7.04  4.98  5.48  6.54  7.20    5.78  7.69 12.68  5.89  4.07  4.08
 13.32 15.05 12.67 12.42 10.03 13.50   11.59  8.96 10.95  9.87 10.48 12.79
 15.32 14.97 14.81 14.26 15.88 16.01   14.53 14.51 12.61 16.13 13.65 14.78
 10.89 10.27 12.21 12.77 10.45 11.44   15.12 13.79 15.32 11.95 12.56 15.31
  7.18  7.98  5.51  7.48  7.55  5.64    6.70  8.28  6.99  6.40  4.96  7.03
  5.94  5.78  7.59  7.21  6.12  7.13    4.08  5.46  5.40  6.85  7.74  6.81
;

TITLE1 'Nested Design';
TITLE2 'Spray Example';
PROC GLM DATA=spray;
 CLASS spray tree;
 RUN;
 TITLE3 'ANOVA for Fixed-Effect Model';
 FOOTNOTE 'Note: Type I & III output inappropriate for mixed-effect model';
 MODEL nitrogen = spray tree(spray);
 RUN;
 TITLE3 'Random Statement Output';
 FOOTNOTE;
 RANDOM tree(spray) / TEST;
 RUN;
 TITLE3 'Test Statement Output';
 TEST H=spray    E=tree(spray);
 RUN;
 TITLE3 'Protected Tests for Fixed-Effects';
 MEANS spray/LSD E=tree(spray);
 RUN;
 TITLE3 'Least Squares Means';
 LSMEANS spray/TDIFF E=tree(spray);
 RUN;
QUIT;

Output Listing

Nested Design
Spray Example
ANOVA for Fixed-Effect Model

The GLM Procedure

    Class Level Information

Class         Levels    Values
spray              3    1 2 3
tree               4    1 2 3 4


Number of Observations Read          72
Number of Observations Used          72


Dependent Variable: nitrogen
                            Sum of
Source            DF       Squares   Mean Square  F Value  Pr > F
Model             11    880.263571     80.023961    37.18  <.0001
Error             60    129.142517      2.152375
Corrected Total   71   1009.406088


R-Square     Coeff Var      Root MSE    nitrogen Mean
0.872061      14.98504      1.467098         9.790417


Source            DF     Type I SS   Mean Square  F Value  Pr > F
spray              2   633.3441083   316.6720542   147.13  <.0001
tree(spray)        9   246.9194625    27.4354958    12.75  <.0001


Source            DF   Type III SS   Mean Square  F Value  Pr > F
spray              2   633.3441083   316.6720542   147.13  <.0001
tree(spray)        9   246.9194625    27.4354958    12.75  <.0001


Note: Type I & III output inappropriate for mixed-effect model




Nested Design
Spray Example
Random Statement Output

The GLM Procedure

Source                  Type III Expected Mean Square
spray                   Var(Error) + 6 Var(tree(spray)) + Q(spray)
tree(spray)             Var(Error) + 6 Var(tree(spray))


Tests of Hypotheses for Mixed Model Analysis of Variance
Dependent Variable: nitrogen

Source            DF   Type III SS   Mean Square  F Value  Pr > F
spray              2    633.344108    316.672054    11.54  0.0033
Error              9    246.919463     27.435496
Error: MS(tree(spray))


Source            DF   Type III SS   Mean Square  F Value  Pr > F
tree(spray)        9    246.919463     27.435496    12.75  <.0001
Error: MS(Error)  60    129.142517      2.152375



Nested Design
Spray Example
Test Statement Output


Dependent Variable: nitrogen

                 Tests of Hypotheses Using the Type III
                   MS for tree(spray) as an Error Term

Source          DF   Type III SS   Mean Square  F Value  Pr > F
spray            2   633.3441083   316.6720542    11.54  0.0033



Nested Design
Spray Example
Protected Tests for Fixed-Effects


t Tests (LSD) for nitrogen

NOTE: This test controls the Type I comparisonwise error rate, not the
experimentwise error rate.


Alpha                            0.05
Error Degrees of Freedom            9
Error Mean Square             27.4355
Critical Value of t           2.26216
Least Significant Difference   3.4205


Means with the same letter are not significantly different.

t

G
r
o
u
p
i
n
g          Mean      N    spray

A        13.731     24    2

B         9.065     24    1
B
B         6.575     24    3



Nested Design
Spray Example
Least Squares Means


Least Squares Means
Standard Errors and Probabilities Calculated Using the Type III MS for
tree(spray) as an Error Term

             nitrogen      LSMEAN
spray          LSMEAN      Number
1           9.0650000           1
2          13.7308333           2
3           6.5754167           3


     Least Squares Means for Effect spray
   t for H0: LSMean(i)=LSMean(j) / Pr > |t|

         Dependent Variable: nitrogen

i/j              1             2             3
   1                    -3.08577      1.646497
                          0.0130        0.1341
   2      3.085769                    4.732266
            0.0130                      0.0011
   3       -1.6465      -4.73227
            0.1341        0.0011

NOTE: To ensure overall protection level, only probabilities associated
      with pre-planned comparisons should be used.