Professional Documents
Culture Documents
Lec Mar 1C Contrast
Lec Mar 1C Contrast
Contrasts
• Many multiple comparison methods use the
idea of a contrast.
• Considering the plasma etching experiment as
we studied previously, the null hypothesis and
the alternative hypothesis are:
H 0 : 1 = 2 = 3 = 4
vs.
H1 : not all i are equal
Figure: A single-wafer plasma etching tool.
Table: Etch Rate Data (in Å/min) from the Plasma Etching
Experiment)
We may state our Null hypothesis differently
such as:
H 0 : 3 = 4
H1 : 3 4
or
H 0 : 1 + 2 = 3 + 4
H1 : 1 + 2 3 + 4
The above two hypothesis testing are dealing with
“Contrasts”. In general, a “contrast” is a linear
combination of parameters of the following form:
k
ci i
i =1
where the contrast constants c1, c2, c3, …ck sum to zero,
k
i.e.,
ci = 0
i =1
The hypothesis are then in the form of
k
H 0 : ci i = 0
i =1
k
H1 : ci i 0
i =1
Orthogonal Contrasts
A useful special case of the contrasts is that of
orthogonal contrasts. Two contrasts with
coefficients (ci) and (di) are orthogonal if
k
ci di = 0 (balanced)
i =1
k
ni ci di = 0
i =1 (unbalanced)
Orthogonal Contrasts
For example, if there are k=3 levels (treatments) for
a factor, then the following are two possible
orthogonal contrasts for these 3 levels (treatments):
Hypothesis Contrast
H 0 : 1 = 2 C1 = y1. − y2.
H 0 : 1 + 2 = 3 + 4 C2 = y1. + y2. − y3. − y4.
H 0 : 3 = 4 C3 = y 3 . − y 4 .
The above 3 contrasts
are Orthogonal
(−36.2) 2
C1=+1(551.2)-1(587.4)=-36.2 SSC1 = = 3276.10
1
( 2)
5
C2=+1(551.2)+1(587.4) (−193.8) 2
-1(625.4)-1(707.0)=-193.8 SSC2 = = 46,948.05
1
(4)
5
C3=+1(625.4)-1(707.0)=-81.6 (−81.6) 2
SSC3 = = 16,646.40
1
(2)
5
We can conclude from the P-Values that there are significant
differences in mean etch rates between levels 1 and 2, and
between levels 3 and 4 of the power setting, and the average
of levels 1 and 2 does differ significantly from the average
of Levels 3 and 4.
More discussion about contrasts
What ANOVA and F-Test Don’t Tell…
The ANOVA and F test as discussed were
limited to testing whether or not an overall
significant difference existed among the sample
means. We are often more interested in
specific comparisons or contrasts (the two
terms will be used interchangeably) between
two or more sample means than we are in an
overall test of significance. Just now, we
examined the procedures that can be used to
test hypotheses about specific differences
between two or more sample means when doing
an analysis of variance – CONTRASTS!
Linear Contrasts and Multiple Comparisons
If we reject H0 of no differences in treatment means
and in favor of H1, we conclude that at least one of the k
population means differs from the other k-1.
The Question is:
Which means differ from each other?
Multiple comparison procedures have been developed to help
determine which means are significantly different from each other.
Many different approaches - not all produce the same result.
Data dredging and data snooping - analyzing only those
comparisons which look interesting after looking at the data.
ˆ y2 + y3
C1 = y1 − Compare average of treatments 2 & 3 to treatment 1.
2
Contrast treatments 2 and 3.
Cˆ 2 = y2 − y3
c1 = 1
1
c2 = 01
1 Orthogonal
c1 = − c2 = 1
2
2 2
Cˆ 1= y1 − y2
1
c1 = − c2 = −1
3
2 3
Cˆ 2 = y1 − y3
c1 = 1 c2 = 1
Non-orthogonal 1 1
c = −1
Contrast treatment 2 to treatment 1. 1 2
c2 = 0 2
Contrast treatment 3 to treatment 1.
c1 = 0
3
c2 = −1 3
• To use this method, all your tests of significance must be
planned before looking at your data, and the tests of
significance must be independent of each other - which is
what limits it to (k-1) tests of significance.
• Suppose we are interested in the effects of six different
percentages of carbon contents in a new alloy on the
associated hardness, we have (6-1)=5 degrees of freedom
which means we can perform up to five independent tests.
• To figure out which comparisons we can perform, we must
first define “comparison” (or contrast). A comparison, Ci , is
defined as
C = c + c + ... + c
i 1 1 2 2 k k
where k
ci = 0
i =1
• For example, a contrast (comparison) between the first and second
mean would be a valid comparison by this formula because coefficient
c1 would equal a "+1" and coefficient c2 would equal a "-1" and all the
other coefficients would equal zero--thus all the ci would add up to zero.
Such a comparison would look like the following:
and
[( +1) y1. + (−1) y2. + (0) y3. + (0) y4. + (0) y5. + (0) y6. ]2 [ y1. − y2. ]2
SSC1 = =
1 1
[( +1) + (−1) + (0) + (0) + (0) + (0) ]
2 2 2 2 2 2
[2]
n n
[( +1) y1. + (+1) y2. + (−1) y3. + (−1) y4. + (0) y5. + (0) y6. ]2
SSC2 =
1
[( +1) 2 + (+1) 2 + (−1) 2 + (−1) 2 + (0) 2 + (0) 2 ]
n
[ y1. + y2. − y3. − y4. ]2
=
1
[ 4]
n
[( +1) y1. + (+1) y2. + (+1) y3. + (+1) y4. + (−2) y5. + (−2) y6. ]2
SSC3 =
1
[( +1) 2 + (+1) 2 + (+1) 2 + (+1) 2 + (−2) 2 + (−2) 2 ]
n
[ y1. + y2. + y3. + y4. − 2 y5. − 2 y6. ]2
=
1
[12]
n
[(0) y1. + (0) y2. + (+1) y3. + (−1) y4. + (0) y5. + (0) y6. ]2 [ y3. − y4. ]2
SSC4 = =
1 1
[(0) + (0) + (+1) + (−1) + (0) + (0) ]
2 2 2 2 2 2
[2]
n n
[(0) y1. + (0) y2. + (0) y3. + (0) y4. + (+1) y5. + (−1) y6. ]2 [ y5. − y6. ]2
SSC5 = =
1 1
[(0) + (0) + (0) + (0) + (+1) + (−1) ]
2 2 2 2 2 2
[2]
n n
ANOVA FOR CONTRASTS
Source SS df MS F Fcv
Between k-1=5
Error SSe/
k(n-1)
(Within) k(n-1)
Total kn-1
Additional Example of Linear Contrasts
Q1: Is the average life on hardwood the same as average life on softwood?
1 + 2 3 + 4 1 + 2 3 + 4
1
H0 : = OR − 2 = 0
2 2 2
1 1 1 1
C1 = ( ) 1 + ( ) 2 + (− ) 3 + (− ) 4
Comparison: 2 2 2 2
ˆ 1 1 1 1
Estimated Contrast C1 = ( ) y1 + ( ) y2 + (− ) y3 + (− ) y4
2 2 2 2
Test H0: C1 = 0 versus H1: C1 0
MS C1
Test Statistic:F =
MS e
Rejection Region: Reject H0 if F F1,( n −1) k ,a
k
1
( c1i yi ) 2 1 1 1
[( )13 + ( )14 + (− )20 + (− )21]2
MS C = 1 k 2 = 2 2 2 2 = 147
1
c1i 1 2 1 2 1 2 1 2
( ) ( ) ( ) ( − ) ( − )
i =1 ni [ 2 + 2 + 2 + 2
3 3 3 3
MS C
F= 1
= 147 / 5 = 29.4
MS e
F1,8, 0.05 = 5.32
13
B
14
C
20
D
21
Q2
ni 3 3 3 3 MSe= 5
Population k= 4
parameter 1 2 3 4 (n-1)k 8
Q2: Is the average life in dry climate the same as average life in wet climate?
1 + 3 2 + 4 1 + 3 2 + 4
H0 : = OR − =0
2 2 2 2
1 1 1 1
Comparison: C2 = ( 2 ) 1 + (− 2 ) 2 + ( 2 ) 3 + (− 2 ) 4
1 1 1 1
Estimated Contrast Cˆ 2 = ( ) y1 + (− ) y2 + ( ) y3 + (− ) y4
2 2 2 2
Test H0: C2 = 0 versus H1: C2 0
MS C
Test Statistic: F= 2
MS e
Rejection Region: Reject H0 if F F1,( n −1) k ,a
k
( c 2 yi ) 21 1 1 1
[( )13 + (− )14 + ( )20 + (− )21]2
MS C = 1k 2 = 2 2 2 2 =3
2
c2 i 1 2 1 2 1 2 1 2
( ) ( ) (− ) ( ) (− )
i =1 ni [ 2 + 2 + 2 + 2
3 3 3 3
MS C
F= 2
= 3 / 5 = 0.6
MS e
F1,8, 0.05 = 5.32
Conclusion: Since F=0.6 < 5.32 we do not reject H0 and
conclude that there is not a significant difference in average life
in wet versus dry climates.
Treatment
Mean
A B C D Q3
(in years) 13 14 20 21
ni 3 3 3 3 MSe= 5
Population t= 4
parameter 1 2 3 4 (n-1)k= 8
Q3: Does the difference in paint life between wet and dry climates depend
upon whether the wood is hard or soft?
H30 : 1 − 2 = 3 − 4 OR (1 − 2 ) − (3 − 4 ) = 0
MS e
Rejection Region: Reject H0 if F F1,( n −1) k ,a
k
( c3 yi ) 2
[(1)13 + ( −1)14 + ( −1) 20 + (1) 21]2
MS C = 1k 2 = =0
3
c3i (1) (−1) (−1) (1)
2 2 2 2
( ) [ + + +
i =1 ni 3 3 3 3
MS C
F= 3
= 0 / 5 = 0.0
MS e
F1,8, 0.05 = 5.32
Why?
It is not necessary to perform all k-1 tests of
significance. Two or more of the sums of squares
could be lumped together as a sums of squares
residual. For instance, in the earlier example
with 5 contrasts, SSC4 and SSC5 could be
lumped together into a SSres and its degrees of
freedom would be equal to 2. SSres/2 would give
us MSres with 2 degrees of freedom. If we lumped
all the five sums of squares comparisons
together we would have SSbt-treatment,
i.e.,
SSbt-treatment = SSC1+SSC2 + SSC3 + SSC4 + SSC5.
Planned orthogonal comparisons control the error rate,
or probability of committing a type one error (calling a null
hypothesis false when it is true), on a per-comparison
basis. In other words, the level of alpha (usually .01 or
.05), or probability of committing a type one error, is set
individually for each comparison irrespective of however
many tests of significance are performed. This means that
the degree of improbability considered sufficient to reject
the null hypothesis is considered for each comparison as
if it were the only one being performed. When we perform
k-1 independent tests of significance the probability that
we have committed at least one type one error is equal
to k −1
1 − (1 − a )
where alpha, is the level of significance or probability of
committing a type one error given that the null hypothesis
is true.
Types of Error Rates
Number of Type I Experimentwise
Comparison-wise Error Rate - the comparsons Error Rate
1 0.05
Error Rate
0.050
probability of making a Type I error in 2 0.05 0.098
3 0.05 0.143
the comparison of two means. (what 4 0.05 0.185
we have been discussing for all tests 5 0.05 0.226
6 0.05 0.265
up to this point). 7 0.05 0.302
8 0.05 0.337
9 0.05 0.370
10 0.05 0.401
11 0.05 0.431
Experiment-wise Error Rate - the 12 0.05 0.460
13 0.05 0.487
probability of observing an 14 0.05 0.512
experiment in which one or more of 15 0.05 0.537
16 0.05 0.560
the pair-wise comparisons are 17 0.05 0.582
18 0.05 0.603
incorrectly declared significantly 19 0.05 0.623
different. 20 0.05 0.642
In our example, had we used an alpha level of .05 (5%)
for each comparison, our overall probability of
committed at least one Type-I error, if all five of our null
hypotheses were true, would be about .226 (23%)
instead of .05 (5%).
[1-(1-0.05)5]=22.6%
e = 1 − (1 − a ) k −1 8 0.05 0.337
9 0.05 0.370
10 0.05 0.401
11 0.05 0.431
12 0.05 0.460
(If the comparisons are not orthogonal, then the 13
14
0.05
0.05
0.487
0.512
15 0.05 0.537
experiment-wise error rate is smaller.) 16 0.05 0.560
17 0.05 0.582
Solution (by Bonferroni): set e=0.05 and solve for 18 0.05 0.603