Math 558 Lecture #19
Orthogonal Contrasts Continued
For a set of t treatments (or t factor levels), there are t − 1 orthogonal contrasts
Copyright By PowCoder代写 加微信 powcoder
The set of orthogonal contrasts is not unique.
Example: Tensile strength; two Set of Orthogonal Contrasts
l1 =(0,0,0,1,−1) l2 =(1,0,1,−1,−1) l3 =(1,0,−1,0,0) l4 =(1,−4,1,1,1)
l2 =(−2,−1,0,1,2) l2 =(2,−1,−2,1,2) l3 =(−1,2,0,−2,1) l4 =(1,−4,6,−4,1)
Orthogonal Contrasts Continued
Orthogonal contrasts (estimates) are independent of each other.
The estimates of the orthogonal contrasts add up to SSTr
F = F1+F2+…Ft−1 , where Fi = SSl /MSE t−1 i
Orthogonal contrasts can be used to perform trend comparisons if the treatment levels are quantitative and equally spaced. Examples: time in Bread rise experiment, cotton percentages in the tensile strength experiment.
Orthogonal Contrasts for trends
Orthogonal Contrasts for trends also known as orthogonal polynomial contrasts. These contrasts are useful when the objective of the experiment is to characterize the effect of increasing levels of a factor (e.g. increments of a fertilizer, doses of a medicine, incremental changes in time ) on some response variable (e.g. yield, disease severity, baking products, etc.). In these situations, the experimenter is interested in the explanatory variable and response relationship. Such an analysis is concerned with overall trends and not with just with pairwise comparisons.
Orthogonal Contrasts for trends
As an example consider the bread rise experiment. We have three equally spaced treatments; 35, 40, 45 minutes. With three levels of treatments the most complicated response the data can reveal is a quadratic relationship between Time, T and Height, H:
H = aT2 + bT + c
This quadratic relationship is comprised of two components: A linear component (slope b), and a quadratic component (curvature a). Therefore, with two treatment degrees of freedom (dfTr = t – 1 = 3 – 1 = 2), we can construct orthogonal contrasts to investigate each of these components.
Orthogonal Contrasts for trends: Bread rise experiment
To test the hypothesis that b = 0 (i.e. there is 0 slope in the overall Time- Height relationship), we choose H0 : μC = μA. If the means of the two extreme treatments are equal, b = 0. As a contrast we can test H0 : 1μC + 0μB − 1μA = 0.
To test the hypothesis that a = 0 (i.e. there is zero curvature in the overall Time-Height relationship), we choose
H0 : μB = (1/2) ∗ (μA + μC) Because the treatment levels are equally spaced (0(35), 1(40), 2(45), a perfectly linear relationship (i.e. zero curvature) would require that the average of the extreme Time levels [(1/2) ∗ (μA + μC)] exactly equal the mean μB. As a contrast,
H0 : 1μC − 2μB + μA = 0.
Example: Bread rise
c1 <- c(-1,0,1)
c2 <- c(1,-2,1)
mat <- cbind(c1,c2)
contrasts(tf) <- mat
model2 <- aov(Height
summary.aov(model2,split= list(tf =
list(”l1 =μB−μA”=1,”l2=μA−2μB+μC”=2)))
tf, data = loaf )
Example: Bread rise
> summary.aov(model2,split= list(tf = list(”l1” = 1 ,”l2” = 2) ) )
Df tf 2 tf: l1 1 tf: l2 1 Residuals 9
Sum Sq 21.573 16.531 5.042 21.094
Mean Sq 10.786 16.531 5.042 2.344
F value 4.602 7.053 2.151
Pr(>F) 0.0420 * 0.0262 * 0.1765
Frame Title
The fact that the contrast sum of squares add perfectly to the SSTr is a verification of their orthogonality. The significant linear contrast (p =0.0262 ) leads us to the reject its H0 at 5% level of significance. There does appear to be a significant, nonzero linear component to the response. The non-significant quadratic contrast (p = 0.1765), however, leads us not to reject its H0.
Orthogonal Contrasts for trends
Notice that the F value of the linear response (7.053) is quite large as compared to the Model F value (4.602). The reason is that in the linear contrast,MS = SS/1, while in the complete Model, MS = SS/2 (i.e. the full SSTr is divided in two effects). When a quantitative factor exhibiting a significant linear predictor-response relationship is measured at several levels, it is possible to have a non-significant overall treatment F test but a significant linear response. This is because the overall treatment F test divides the full SST equally across many effects, most of which are non-significant. In such cases, contrasts significantly increase the power of the test.
Example: Rat behaviour experiment
model2 <- aov( rate rat + dose, data = drug)
> summary.aov(model2,split = list(dose = list(“Linear” = 1, “Quadratic” = 2,”Cubic” = 3, “Quartic”= 4)))
rat 9 dose 4 dose: Linear 1 dose: Quadratic 1 dose: Cubic 1 dose: Quartic 1
Residuals 36
1.6685 0.4602 0.0610 0.3943 0.0041 0.0008 0.3006
Mean Sq 0.1854 0.1151 0.0610 0.3943 0.0041 0.0008 0.0083
F value 22.205 13.781 7.308 47.232 0.491 0.094
Pr(>F) 3.75e-12 *** 6.53e-07 *** 0.0104 * 4.83e-08 *** 0.4882 0.7613
Contrast coefficients for trend comparisons for equally spaced treatments
The coefficients used for trend comparisons (linear, quadratic, cubic, quartic, etc.) among equally spaced treatments are listed below, taken from (Cox and Cochran)
No. of Treat. 2
Response c1 Linear -1 Linear -1
Quadratic 1 Linear -3 Quadratic 1 Cubic -1 Linear -2
c2 c3 c4 c5 1
-1 1 3 -1 -1 1
-1 0 1 2 -1 -2 -1 2
Quadratic 2
Cubic -1 2 0 -2 1
Finding orthogonal contrasts using contr.helmert Contrasts for unordered data; nominal scale variables
contr.helmert(n=5)
[,1] [,2] [,3] [,4] 1 -1 -1 -1 -1 2 1 -1 -1 -1 3 0 2 -1 -1 4 0 0 3 -1 50004
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com