CROP 590 Experimental Design in Agriculture

advertisement
CROP 590 Experimental Design in Agriculture
Lab exercise – 7th week
Orthogonal Polynomials
Split Plot Analysis
Strip Plot
Suggested reading: Kuehl Pages 469-513
SAS On-line Documentation
GLM Procedure
MIXED Procedure
Part I. Using orthogonal polynomial contrasts in a factorial experiment
An agricultural chemist suspected that the activity of root growth hormone was dependent on
temperature and concentration. He designed an experiment using two different temperature baths
of a nutrient solution containing 2 ppm, 4 ppm, and 6 ppm of the root growth hormone. He had
two assistants to help measure the root growth response so the experiment was run as a
randomized block design with two blocks.
TEMP CONC BLOCK ROOTS
Cold
Cold
Cold
Cold
Cold
Cold
Warm
Warm
Warm
Warm
Warm
Warm
2
2
4
4
6
6
2
2
4
4
6
6
1
2
1
2
1
2
1
2
1
2
1
2
76
60
63
58
50
45
23
15
36
25
47
36
1) Copy this data into a SAS data step using the appropriate input statement and a datalines
statement.
2) Develop a set of orthogonal contrasts to answer the following questions:
a.
b.
c.
d.
Is there a difference in root growth due to temperature?
Is there a linear response to concentration?
Is there a quadratic response to concentration?
Does the nature of the response to concentration (linear or quadratic) depend on the
temperature?
Cold, 2 ppm
Cold, 4 ppm
Cold, 6 ppm
Warm, 2 ppm
1
Warm, 4 ppm
Warm, 6 ppm
3) Run a SAS program on this data to address these questions.
PROC GLM plots=diagnostics;
TITLE 'contrasts in a factorial experiment';
CLASS block temp conc;
MODEL roots = block temp conc temp*conc;
/*make sure that your coefficients correspond to the order of your
means*/
CONTRAST
CONTRAST
CONTRAST
CONTRAST
CONTRAST
'main
'conc
'conc
'temp
'temp
effect of temp' temp -1 1;
lin' conc -1 0 1;
quad' conc 1 -2 1;
x conc lin' temp*conc 1 0 -1 -1 0 1;
x conc quad' temp*conc -1 2 -1 1 -2 1;
LSMEANS conc temp;
LSMEANS temp*conc/out=new;
PROC GPLOT data=new;
TITLE 'Effect of conc and temp on root growth';
SYMBOL1 i=join v=dot;
AXIS1 label=('Root growth');
PLOT lsmean*conc=temp/ vaxis=axis1;
RUN;
4) How would you interpret the output?
5) You can also use the “ESTIMATE” statement in PROC GLM rather than contrast statements.
The syntax is very similar, but you may want to use the “divisor” option to get the proper
scaling of the linear contrast estimates. The results of the t tests will be the same as before.
Use a CONTRAST statement if you are most interested in determining the proportion of the
treatment Sum of Squares that is due to the contrast. Use the ESTIMATE statement if you are
interested in the actual value of the linear contrast.
Estimate 'main effect of temp' temp -1 1;
Estimate 'conc lin' conc -1 0 1;
Estimate 'conc quad' conc 1 -2 1/divisor=2;
Estimate 'temp x conc lin' temp*conc 1 0 -1 -1 0 1;
Estimate 'temp x conc quad' temp*conc -1 2 -1 1 -2 1/divisor=2;
You can also use the ESTIMATE statement to get an unbiased estimate of a single mean. For
example, for the low temperature treatment:
Estimate 'BLUE mean of low temp' intercept 1 temp 1 0;
Compare your results using Estimate statements to the output from the Contrasts and
lsmeans statements.
2
Part II: Split Plot Analysis
In agricultural experimentation, we may have a factor in our treatment arrangement that
requires large plots for application. To conserve space and resources, we may apply another factor
to sub-plots of the larger treatment factor. In agricultural application, this is called split-plot. In
the broader context of experimentation, it is called repeated measure in one factor.
1. From the class website, download the data file Lab7_split-plot.xlsx. This experiment is a
split-plot, with nitrogen levels as main plots and rice varieties as sub-plots. The response
variable is yield. Write a SAS program to input your data. You may assume that the data
conforms to the assumptions for ANOVA.
2. For a split-plot analysis, you must specify the block*main plot interaction (error a) in your
model statement:
PROC GLM DATA = Nitro;
TITLE 'SPLIT-PLOT Analysis';
CLASS Block Nitrogen variety;
MODEL Yield = Block Nitrogen Block*Nitrogen Variety
Nitrogen*variety;
3. You will also need to tell SAS to use ‘error a’ to test your main plot and block effects, and to
calculate standard errors.
TEST H=Nitrogen E=Block*Nitrogen;
TEST H=Block E=Block*Nitrogen;
LSMEANS Nitrogen /stderr E=Block*Nitrogen;
LSMEANS Variety /stderr;
LSMEANS Nitrogen*Variety/stderr;
RUN;
Why are the resulting F values different for the TEST output and the initial ANOVA? Which is
the correct value to use for testing significance? Explain why.
4. Based on the ANOVA, how would you interpret the results of this experiment?
5. We must also specify the appropriate error term for any contrast involving main effects. We
also need to be careful that the order of contrast coefficients we define for the interactions
corresponds to the order in which SAS is sorting the means.
CONTRAST 'N linear' Nitrogen -1 0 1/ E=Block*Nitrogen;
CONTRAST 'N quadratic' Nitrogen -1 2 -1/ E=Block*Nitrogen;
CONTRAST 'Variety x N linear' Nitrogen*variety -1 1 0 0 1 -1;
CONTRAST 'Variety x N quadratic' Nitrogen*variety -1 1 2 -2 -1 1;
RUN;
What do the results of the contrasts tell us about the response of these varieties to nitrogen?
3
6. Obtain a graph of the results to aid in interpretation.
PROC MEANS nway data=nitro;
Title 'Means for interactions';
CLASS Nitrogen variety;
VAR Yield;
OUTPUT out=plotmeans mean=;
RUN;
PROC GPLOT data= plotmeans;
Title 'Effect of Nitrogen on Yield';
PLOT Yield*Nitrogen=variety;
SYMBOL1 i=join value=dot;
RUN;
7. As an alternative to using the TEST statement to obtain appropriate F tests, you can use a
RANDOM statement to specify which effects are random, which will generate Expected Mean
Squares for the model. The RANDOM statement with the TEST option tells SAS to go ahead
and perform the appropriate F tests.
PROC GLM DATA = Nitro;
TITLE 'SPLIT-PLOT Analysis with a RANDOM statement';
CLASS Block Nitrogen Variety;
MODEL Yield = Block Nitrogen Block*Nitrogen Variety
Nitrogen*variety;
RANDOM Block Block*Nitrogen/TEST;
RUN;
You would still need to specify the appropriate error term for standard errors, mean
comparison tests, and contrasts.
8. PROC MIXED can also be used to analyze a split-plot experiment. The MODEL statement
should only include fixed effects. PROC MIXED will determine the appropriate F tests for fixed
effects, and use the appropriate error terms to calculate standard errors and contrasts, and to
perform mean comparison tests. Additionally, PROC MIXED will perform mean comparison tests
at the sub-plot level (Nitrogen*Variety). The ‘residual’ option in the Model statement produces
diagnostic plots that can be used to check for outliers, heterogeneous variances, and
normality. The option ‘outp=nres’ creates a data set of residuals and predicted values, which
could be used to find specific outliers if they are detected in the diagnostic plots.
PROC MIXED DATA = Nitro;
TITLE 'SPLIT-PLOT Analysis using PROC MIXED';
CLASS Block Nitrogen Variety;
MODEL Yield = Nitrogen Variety Nitrogen*Variety/outp=nres residual;
RANDOM Block Block*Nitrogen;
LSMEANS Variety Nitrogen Nitrogen*Variety/pdiff;
CONTRAST 'N linear' Nitrogen -1 0 1;
CONTRAST 'N quadratic' Nitrogen -1 2 -1;
CONTRAST 'Variety x N linear' Nitrogen*Variety -1 1 0 0 1 -1;
CONTRAST 'Variety x N quadratic' Nitrogen*Variety -1 1 2 -2 -1 1;
RUN;
4
Part III. Strip-plot (Split-block) analysis
To analyze a strip-plot experiment, we can easily extend the principles we learned for analyzing a
split-plot in SAS.
An agronomist wanted to measure the effect of irrigation and nitrogen fertilizer on the yield of
durum wheat. He decided to use a factorial set of treatments with the following levels:
Irrigation: I0=None, I1=once, I2=twice
Nitrogen: N1=25kg/ha, N2=50kg/ha, N3=75kg/ha
1. Input the data from the Lab7_strip-plot.xlsx file into SAS.
2. To analyze the strip plot we will specify which variables are random (in this case all of the error
terms). SAS will then determine the Expected Mean Squares for each effect in the model. The
‘test’ option tells SAS to go ahead and perform the appropriate F tests.
PROC GLM;
CLASS block irrigation nitrogen;
MODEL yield = block irrigation block*irrigation nitrogen
block*nitrogen irrigation*nitrogen;
RANDOM block block*irrigation block*nitrogen/test;
RUN;
3. Based on the output for Expected Mean Squares, what is the appropriate F test for the Main
effects (irrigation and nitrogen) in a strip-plot experiment? For the Blocks? (the answer should
be straightforward for main effects, but tricky for blocks)
4. Based on the ANOVA, how would you interpret the results of this experiment?
5. If time permits, develop appropriate contrast statements to look at the nature of the response
to irrigation and nitrogen (linear, quadratic, etc.)
6. The SAS code for running this analysis using PROC MIXED is shown below (fyi):
PROC MIXED data=strip;
CLASS block irrigation nitrogen;
MODEL yield = irrigation nitrogen irrigation*nitrogen/outp=resdata
residual;
RANDOM block block*irrigation block*nitrogen;
LSMEANS irrigation nitrogen irrigation*nitrogen/pdiff;
RUN;
5
Download