Solutions HW 10
1a) The following SAS will give you the needed output.
proc glm;
class block trt;
model numheads=block trt block*trt;
run;
Source DF Type III SS Mean Square F Value Pr > F
block*trt 8 1969.066667 246.133333 5.94 0.0016
F = 5.94 with 8 and 15 df.
p = 0.0016
There is significant evidence of a treatment-by-block interaction.
1b) The following SAS will give you the needed output for parts b and c.
proc glm;
class block trt;
model numheads=block trt block*trt;
lsmeans block*trt / slice=block;
run;
The GLM Procedure
Least Squares Means
numheads
block trt LSMEAN
1 0 109.000000
1 50 132.000000
1 100 144.000000
1 150 153.500000
1 200 139.500000
2 0 116.500000
2 50 159.000000
2 100 154.000000
2 150 161.500000
2 200 158.500000
3 0 156.000000
3 50 156.000000
3 100 160.500000
3 150 152.000000
3 200 167.500000
The main reason for the interaction being significant is as follows.
In blocks 1 and 2, there is a large difference between the yield of
the 0 treatment and the other treatment means. In block 3, the
difference between the 0 treatment and the others disappears.
Thus the differences among the treatment means are not the same for
all blocks, and we have a significant interaction.
1c) The GLM Procedure
Least Squares Means
block*trt Effect Sliced by block for numheads
Sum of
block DF Squares Mean Square F Value Pr > F
1 4 2253.400000 563.350000 13.60 <.0001
2 4 2847.400000 711.850000 17.18 <.0001
3 4 279.400000 69.850000 1.69 0.2054
Block 1:
F = 13.6 with 4 and 15 df.
p < 0.0001
There is significant evidence of a difference among treatment means.
Block 2:
F = 17.18 with 4 and 15 df.
p < 0.0001
There is significant evidence of a difference among treatment means.
Block 3:
F = 1.69 with 4 and 15 df.
p = 0.2054
There is no evidence of a difference among treatment means.
1d) The code in 1(a) provides the output.
Source DF Type III SS Mean Square F Value Pr > F
block 2 2655.266667 1327.633333 32.04 <.0001
trt 4 3411.133333 852.783333 20.58 <.0001
block*trt 8 1969.066667 246.133333 5.94 0.0016
F = 20.58 with 4 and 15 df.
p < 0.0001
There is significant evidence of a difference in treatment means.
1e) Use the following code.
proc mixed method=type3 data=one;
class block trt;
model numheads=trt;
random block block*trt;
run;
Type 3 Tests of Fixed Effects
Num Den
Effect DF DF F Value Pr > F
trt 4 8 3.46 0.0634
F = 3.46 with 4 and 8 df.
p = 0.0634
There is inconclusive evidence of difference in treatment means. There
is significant difference at the 0.1 level but not at the 0.05 level.
Note that the proper error term for testing treatment effects becomes
block*trt interaction when block*trt interaction is treated as a random
term.
1f) The following code will provide the necessary output.
proc means data=one;
var numheads;
by block trt;
output out=two mean=y;
run;
proc print;
run;
proc glm data=two;
class block trt;
model y=block trt;
run;
Source DF Type III SS Mean Square F Value Pr > F
block 2 1327.633333 663.816667 5.39 0.0329
trt 4 1705.566667 426.391667 3.46 0.0634
F = 3.46 with 4 and 8 df.
p = 0.0634
There is inconclusive evidence of difference in treatment means. There
is significant difference at the 0.1 level but not at the 0.05 level.
This is the same test as the one conducted in part 1(e).
2a) Source df
Diet 3 – 1 = 2
Drug 2 – 1 = 1
Diet*Drug 2 * 1 = 2
Dam(Diet Drug) (4-1)*6 = 18
Gender 2 – 1 = 1
Gender*Diet 1 * 2 = 2
Gender*Drug 1 * 1 = 1
Gender*Diet*Drug 1 * 2 = 2
Error 24 – 6 = 18
c. Total (4*6*2)-1 = 47
Note the term labeled "Error" can be written as
Gender*Dam(Diet Drug) with d.f.=(2-1)*(4-1)*6=18.
2b) For each of the 6 dams mated to any one sire, randomly assign
the 6 treatments. This is a RCBD with sires as blocks and the
dams mated to sires as the experimental units.
2c) Source df
Sire 4 – 1 = 3
Diet 3 – 1 = 2
Drug 2 – 1 = 1
Diet*Drug 2 * 1 = 2
Error(1)=Sire*Trt (4-1)*(6-1) = 15
Gender 2 – 1 = 1
Gender*Diet 1 * 2 = 2
Gender*Drug 1 * 1 = 1
Gender*Diet*Drug 1 * 2 = 2
Error(2) 47-sum above = 18
C. Total (4*6*2)-1 = 47
Note that the six combinations of Diet and Drug correspond to
what is called "Trt" in the table above.
The second error term called Error(2) consists of
Gender*Sire + Gender*Trt*Sire for a total of
(2-1)*(4-1)+(2-1)*(6-1)*(4-1)=18 d.f.
Note that we would not usually include separate lines for
Sire*Diet, Sire*Drug, Sire*Gender, Sire*Diet*Gender, or
Sire*Drug*Gender because these interaction terms do not
correspond to either a whole-plot or a split-plot experimental
unit.
To fit this model in SAS we would write
proc mixed method=type3;
class sire diet drug gender;
model y=diet|drug|gender;
random sire sire*diet*drug;
run;
The sire*diet*drug term corresponds to Error(1).
SAS will automatically add Error(2) in this case.
3) Type 3 Tests of Fixed Effects
Num Den
Effect DF DF F Value Pr > F
temp 1 4 19.21 0.0118
humidity 1 4 14.10 0.0199
temp*humidity 1 4 4.31 0.1064
variety 4 32 3.72 0.0135
temp*variety 4 32 0.75 0.5681
humidity*variety 4 32 1.72 0.1700
temp*humidit*variety 4 32 0.18 0.9449
The output shows that none of the interactions are significant, thus we
can consider the main effects across all factors. All three main
effects are significant (see p-values for temp, humidity, and variety
in the table above. Based on the lsmeans for temp and the p-value
of 0.0118, we can say that the seed quality mean was significantly
higher for 50 degrees than 70 degrees. Based on the lsmeans for
humidity and the p-value of 0.0199, we can see that seed quality
mean was significantly higher for low humidity than for high humidity.
(See the temp and humidity lsmeans below.)
Least Squares Means
Effect humidity variety temp Estimate
temp 50 48.1333
temp 70 39.9667
humidity high 41.0667
humidity low 47.0333
Differences of Least Squares Means
Effect variety _variety Pr > |t| Adjustment Adj P
variety A B 0.6598 Tukey-Kramer 0.9915
variety A C 0.0335 Tukey-Kramer 0.1979
variety A D 0.0631 Tukey-Kramer 0.3252
variety A E 0.0170 Tukey-Kramer 0.1118
variety B C 0.0119 Tukey-Kramer 0.0820
variety B D 0.0240 Tukey-Kramer 0.1500
variety B E 0.0057 Tukey-Kramer 0.0423
variety C D 0.7690 Tukey-Kramer 0.9982
variety C E 0.7690 Tukey-Kramer 0.9982
variety D E 0.5578 Tukey-Kramer 0.9753
There was a significant difference between varieties B and E
(p = 0.0423).
There was weak evidence of a difference between varieties B and C
(p = 0.082).
All other varieties were not significantly different from each other.
Least Squares Means
Standard
Effect variety Estimate Error DF
variety A 44.7500 0.9974 32
variety B 45.0000 0.9974 32
variety C 43.5000 0.9974 32
variety D 43.6667 0.9974 32
variety E 43.3333 0.9974 32
In conclusion, the lower temperature and humidity significantly raised
the seed quality for all varieties. Variety B has a significantly
higher seed quality than variety E. No other differences among varieties
were detected at the 0.05 level.