HW6_st524.doc

advertisement
ST 524
Homework 6
1.
NCSU - Fall 2008
Due: 10/30/08
A two-factor experiment, involving five levels of nitrogen and three rice varieties was conducted
by the department of Agronomy, IRRI, at Maligaya Experiment Station, Nueva Ecija, in the 1965
wet season. A randomized block design with four replicates was used. Varieties and Nitrogen
levels are fixed-effect factors.
Data
N level
(kg/ha)
Block
I
0
40
70
100
130
3.852
4.788
4.576
6.034
5.874
0
40
70
100
130
2.846
4.956
5.928
5.664
5.458
0
40
70
100
130
4.192
5.250
5.822
5.888
5.864
a)
Grain Yield (t/ha)
Block
Block
II
III
Variety 6966
2.606 3.144
4.936 4.562
4.454 4.884
5.276 5.906
5.916 5.984
Variety PI215936
3.794 4.108
5.128 4.150
5.698 5.810
5.362 6.458
5.546 5.786
Variety Milfor 6(2)
3.754 3.738
4.582 4.896
4.848 5.678
5.524 6.042
6.264 6.056
Block
IV
2.894
4.608
3.924
5.652
5.518
3.444
4.990
4.308
5.474
5.932
3.428
4.286
4.932
4.756
5.362
Field layout
Block
I
Block
II
Block
III
Block
IV
V3N2
V3N0
V2N4
V2N3
V1N3
V1N0
V1N1
V2N2
V2N0
V1N2
V1N3
V3N0
V2N1
V1N3
V3N1
V3N3
V3N2
V3N4
V3N0
V1N2
V3N2
V2N2
V3N1
V2N1
V1N4
V3N4
V2N0
V1N1
V1N2
V2N2
V1N0
V1N3
V2N1
V2N4
V1N4
V3N2
V1N1
V1N2
V1N0
V2N0
V1N4
V3N1
V3N1
V2N4
V2N3
V1N0
V1N1
V3N3
V2N3
V3N3
V2N2
V2N1
V2N4
V3N0
V1N4
V3N4
V3N3
V2N0
V2N3
V3N4
Run analysis of variance
proc glm data=rice;
class block n_level variety;
model yield = block n_level | variety;
output out = outglm r = residual
p = pred
student = studentresid
;
*lsmeans n_level/ stderr out=outlsmn;
*lsmeans n_level*variety/ stderr out=outlsmn2;
run;
b) Find a meaningful decomposition of Nitrogen effect. Test of hypothesis.
1. Graph interaction means vs Nitrogen Levels likely indicates a quadratic
response.
2. Fit a quadratic polynomial for N, and check significance of remaining
polynomial terms (LOF). Use sequential SS - Type I SS.
3. Run a mean separation procedure to analyze significance for variety.
4. Conclusion.
proc glm data=two;
class block LOF variety;
model yield = block n_level
n_level*n_level
LOF
variety
variety*n_level
variety*n_level*n_level
variety*LOF
/ss1;
means variety/lsd tukey bon waller;
run;
Hypothesis
Model: y        N   N 2   dev _ quad   N *Var   N 2 *Var   dev _ quad *  
ijk
...
k
j
1 i
2 i
i
5j i
j
6j i
j
ijk





ij
Block effect : 3 df
Variety effect: 2 df
N effect: 4 df
o
N linear ,1 df , H o : 1  0
o
N quad, 1 df , H o : 2  0
Tuesday September 18, 2007 Homework 4
1
ST 524
Homework 6
NCSU - Fall 2008
Due: 10/30/08
o

LOF 2 df , H o : 3  4  0
N*Variety, 8 df
o
N linear*Variety, 2 df ,
o
N quad*Variety, 2 df ,
o
N dev.quad*Variety, 4 df ,
H o : 51  52  53  0
H o : 61  62  63  0
H o :  dev.quad *   0
ij
c)
Alternative approach, if willing to explore the quasi significance of variety*N_level
proc glm data=two;
class block LOF variety;
model yield = block
variety
n_level
n_level*n_level
n_level*n_level*n_level
n_level*n_level*n_level*n_level
variety
variety
variety
variety
*
*
*
*
n_level
n_level*n_level
n_level*n_level*n_level
n_level*n_level*n_level*n_level
/ss1 solution;
run;
Model: y        N   N 2   N 3   N 4   N *Var   N 2 *Var   N 3 *Var   N 4 *Var  
ijk
...
k
j
1 i
2 i
3 i
4 i
5j i
j
6j i
j
7j i
j
8j i
j
ijk


Block effect : 3 gl
Variety effect: 2 gl

N linear 1 gl ,
H o : 1  0

N quad 1 gl ,
H o : 2  0

N cubic 1 gl ,

N dev. cubic 1 gl ,

N linear*Variety 2 gl ,
H o : 51  52  53  0

N quad*Variety 2 gl ,
H o : 61  62  63  0

N cubic*Variety 2 gl ,
H o : 71  72  73  0

N quad*Variety 2 gl ,
H o : 81  82  83  0
H o : 3  0
H o : 4  0
d) Is Variety effect significant? Test of hypothesis.
e)
f)
H o :1   2   3  0
Are the ANOVA assumptions met?
Conclusions.
2. The following table presents the yield of Irish potatoes in the Gibbs Farms, Portsmouth Sandy Loam
Data
BLOCKS
K
pH
level
Acid
30
Acid
50
Acid
70
Neutral
30
Neutral
50
Neutral
70
Alkaline
30
Alkaline
50
Alkaline
70
Standard (70-60-30)
Check
a)
trtid
I
II
III
IV
V
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
203
188
199
190
191
203
203
196
216
157
50
192
178
179
194
193
211
196
199
203
167
92
163
175
193
196
187
184
192
193
230
172
90
167
196
183
175
200
203
192
194
169
158
97
198
192
188
180
194
187
193
205
192
158
88
Run analysis of variance.
proc glm data=potato;
Tuesday September 18, 2007 Homework 4
2
ST 524
Homework 6
NCSU - Fall 2008
Due: 10/30/08
class block trtid;
model yield = block trtid;
output out = outglm r = residual
p = pred
student = sres
;
lsmeans trtid/ pdiff adjust=tukey stderr out=outlsmn;
run;
b) Find a meaningful decomposition of Treatments effect. Test of hypothesis.
**** 2 controls + k_level pH k_level*pH
proc glm data=potato;
class block pH k_level trtid;
model yield = block trtid;
output out = outglm r = residual
p = pred
student = sres
;
run;
a)
Compare Alkaline vs Acid pH
************;
 1  2  3 
3   7  8  9  3
b) Compare Neutral vs average of (Alkaline, Acid) pH
 1  2  3  3   7  8  9  3 2   4  5  6  3
c) K linear  3  6  9  3   1  4  7  3
d) Deviations from linear K  1  4  7  3   3  6  9  3 2   2  5  8  3
 1  3    7  9 
e)
Interaction effect K linear*(Alkaline vs Acid pH)
f)
Interaction effect K dev_from_linear*(Alkaline vs Acid pH)
 7  9  2  8    1  3  2  2 
g) Interaction effect K linear*(neutral vs (Alk, Acid) pH)
 3  9  2  6    1  7  2  4 
Interaction effect K dev_from_linear*(neutral vs (Alk, Acid) pH)
 7  9  2  8    1  3  2  2 
  4  6  2  5 
2
h) Standard vs Check 10  11
i)
Controls vs Factorial
 1  2  3  4  5  6  7  8  9 
contrast "acid vs alc "
contrast "neutral vs ( acid, alc)"
contrast "k_devLin"
contrast "k_linear"
contrast "k_linear* (acid vs alc)"
contrast "k_devLin*(acid vs alc)"
contrast "k_lin *(neutral vs (acid,alc))"
contrast "k_devlin *(neutral vs (acid,alc))"
contrast "Standard vs check"
contrast "control vs factorial"
*lsmeans trtid/ stderr out=outlsmn;
a.
b.
9   10  11  2
trtid -1 -1 -1
0
0
0
1 1 1 0 0;
trtid
1 1 1 -2 -2 -2
1 1 1 0 0;
trtid
1 -2 1
1 -2
1
1 -2 1 0 0;
trtid -1 0 1 -1
0
1 -1 0 1 0 0;
trtid
1 0 -1
0
0
0 -1 0 1 0 0;
trtid -1 2 -1
0
0
0
1 -2 1 0 0;
trtid -1 0 1
2
0 -2 -1 0 1 0 0;
trtid
1 -2 1 -2
4 -2
1 -2 1 0 0;
trtid
0 0 0
0
0
0
0 0 0 1 -1;
trtid
2 2 2
2
2
2
2 2 2 -9 -9;
Are the ANOVA assumptions met?
Conclusions. - You may consider the effects of the inclusion of controls in the analysis of variance.
See residual plot.
Note: An alternative way to check for heterogeneity of variances is to plot
residual vs predicted , as in the
regular residual vs predicted plot, we should look for patterns in the distribution of the points along the
x-axis (y-axis).
Tuesday September 18, 2007 Homework 4
3
ST 524
Homework 6
NCSU - Fall 2008
Due: 10/30/08
3.
Reference: http://www.stat.ncsu.edu/people/dickey/st512/lab12/demo1+.html
Tuesday September 18, 2007 Homework 4
4
Download