• Keine Ergebnisse gefunden

An Analysis of Variance can give us an indication that not all the treatment groups have the same mean response, but an ANOVA does not, by itself, tell us which treatments are different or in what ways they differ. To do this, we need to look at the treatment means, or equivalently, at the treatment effects.

One method to examine treatment effects is called a contrast.

ANOVA is like background lighting that dimly illuminates all of our data,

but not giving enough light to see details. Using a contrast is like using a Contrasts examine specific differences

spotlight; it enables us to focus in on a specific, narrow feature of the data.

But the contrast has such a narrow focus that it does not give the overall picture. By using several contrasts, we can move our focus around and see more features. Intelligent use of contrasts involves choosing our contrasts so that they highlight interesting features in our data.

4.1 Contrast Basics

Contrasts take the form of a difference between means or averages of means.

For example, here are two contrasts:

(µ+α6)−(µ+α3) and µ+α2+µ+α4

2 −µ+α1+µ+α3+µ+α5

3 .

66 Looking for Specific Differences—Contrasts

The first compares the means of treatments 6 and 3, while the second com-pares the mean response in groups 2 and 4 with the mean response in groups 1, 3, and 5.

Formally, a contrast is a linear combination of treatment means or effects

Contrasts

Contrast coefficients add to zero.

Less formally, we sometimes speak of the set of contrast coefficients{wi}as being a contrast; we will try to avoid ambiguity. Notice that because the sum of the coefficients is zero, we have that

w({αi}) =

for any fixed constant x (say µor π). We may also make contrasts in the observed data: A contrast depends on the differences between the values being contrasted, but not on the overall level of the values. In particular, a contrast in treatment means depends on theαi’s but not onµ. A contrast in the treatment means

Contrasts do not depend on α-restrictions

or effects will be the same regardless of whether we assume that α1 = 0, or Pαi = 0, or Pniαi = 0. Recall that with respect to restrictions on the treatment effects, we said that “the important things don’t depend on which set of restrictions we use.” In particular, contrasts don’t depend on the restrictions.

We may use several different kinds of contrasts in any one analysis. The trick is to find or construct contrasts that focus in on interesting features of the data.

Probably the most common contrasts are pairwise comparisons, where we contrast the mean response in one treatment with the mean response in a second treatment. For a pairwise comparison, one contrast coefficient is 1,

Pairwise

comparisons a second contrast coefficient is -1, and all other contrast coefficients are 0.

For example, in an experiment withg = 4treatments, the coefficients (0, 1,

4.1 Contrast Basics 67

-1, 0) compare the means of treatments 2 and 3, and the coefficients (-1, 0, 1, 0) compare the means of treatments 1 and 3. Forgtreatments, there are g(g−1)/2different pairwise comparisons. We will consider simultaneous inference for pairwise comparisons in Section 5.4.

A second classic example of contrasts occurs in an experiment with a control and two or more new treatments. Suppose that treatment 1 is a con-trol, and treatments 2 and 3 are new treatments. We might wish to compare the average response in the new treatments to the average response in the control; that is, on average do the new treatments have the same response as the control? Here we could use coefficients (-1, .5, .5), which would sub-tract the average control response from the average of treatments 2 and 3’s

average responses. As discussed below, this contrast applied to the observed Control versus other treatments

treatment means ((y2• +y3•)/2 −y1•) would estimate the contrast in the treatment effects ((α23)/2− α1). Note that we would get the same kind of information from contrasts with coefficients (1, -.5, -.5) or (-6, 3, 3);

we’ve just rescaled the result with no essential loss of information. We might also be interested in the pairwise comparisons, including a comparison of the new treatments to each other (0, 1, -1) and comparisons of each of the new treatments to control (1, -1, 0) and (1, 0, -1).

Consider next an experiment with four treatments examining the growth rate of lambs. The treatments are four different food supplements. Treat-ment 1 is soy meal and ground corn, treatTreat-ment 2 is soy meal and ground oats, treatment 3 is fish meal and ground corn, and treatment 4 is fish meal and ground oats. Again, there are many potential contrasts of interest. A contrast with coefficients (.5, .5, -.5, -.5) would take the average response for fish

meal treatments and subtract it from the average response for soy meal treat- Compare related groups of treatments

ments. This could tell us about how the protein source affects the response.

Similarly, a contrast with coefficients (.5, -.5, .5, -.5) would take the average response for ground oats and subtract it from the average response for ground corn, telling us about the effect of the carbohydrate source.

Finally, consider an experiment with three treatments examining the ef-fect of development time on the number of deef-fects in computer chips pro-duced using photolithography. The three treatments are 30, 45, and 60 sec-onds of developing. If we think of the responses as lying on a straight line

function of development time, then the contrast with coefficients (-1/30, 0, Polynomial contrasts for quantitative doses

1/30) will estimate the slope of the line relating response and time. If instead we think that the responses lie on a quadratic function of development time, then the contrast with coefficients (1/450, -2/450, 1/450) will estimate the quadratic term in the response function. Don’t worry for now about where these coefficients come from; they will be discussed in more detail in Sec-tion 4.4. For now, consider that the first contrast compares the responses at

68 Looking for Specific Differences—Contrasts

the ends to get a rate of change, and the second contrast compares the ends to the middle (which yields a 0 comparison for responses on a straight line) to assess curvature.

4.2 Inference for Contrasts

We use contrasts in observed treatment means or effects to make inference about the corresponding contrasts in the true treatment means or effects. The kinds of inference we work with here are point estimates, confidence inter-vals, and tests of significance. The procedures we use for contrasts are similar to the procedures we use when estimating or testing means.

The observed treatment meanyi•is an unbiased estimate ofµi =µ+αi, so a sum or other linear combination of observed treatment means is an

un-w({yi•}) estimates w({µi})

biased estimate of the corresponding combination of theµi’s. In particular, a contrast in the observed treatment means is an unbiased estimate of the corresponding contrast in the true treatment means. Thus we have:

E[w({yi•})] =E[w({αbi})] =w({µi}) =w({αi}) .

The variance ofyi• isσ2/ni, and the treatment means are independent, so the variance of a contrast in the observed means is

Var[w({yi•})] =σ2 Xg i=1

w2i ni .

We will usually not knowσ2, so we estimate it by the mean square for error from the ANOVA.

We compute a confidence interval for a mean parameter with the general form: unbiased estimate±t-multiplier×estimated standard error. Contrasts are linear combinations of mean parameters, so we use the same basic form.

Confidence interval for w({µi})

We have already seen how to compute an estimate and standard error, so w({yi•})± tE/2,N−gpM SE

vu ut

Xg i=1

w2i ni

forms a 1− E confidence interval for w({µi}). As usual, the degrees of freedom for our t-percent point come from the degrees of freedom for our estimate of error variance, hereN−g. We use theE/2percent point because we are forming a two-sided confidence interval, withE/2error on each side.

4.2 Inference for Contrasts 69

The usualt-test statistic for a mean parameter takes the form unbiased estimatenull hypothesis value

estimated standard error of estimate .

This form also works for contrasts. If we have the null hypothesis H0 : w({µi}) = δ, then we can do at-test of that null hypothesis by computing the test statistic

t= w({yi•})−δ

√M SE qPgi=1wni2

i

.

Under H0, this t-statistic will have at-distribution with N −g degrees of t-test forw({µi})

freedom. Again, the degrees of freedom come from our estimate of error variance. Thep-value for thist-test is computed by getting the area under thet-distribution withN −gdegrees of freedom for the appropriate region:

either less or greater than the observedt-statistic for one-sided alternatives, or twice the tail area for a two-sided alternative.

We may also compute a sum of squares for any contrastw({yi•}):

SSw= (Pgi=1wiyi•)2 Pg

i=1 wi2

ni

.

This sum of squares has 1 degree of freedom, so its mean square isM Sw = SSw/1 =SSw. We may useM Swto test the null hypothesis thatw({µi}) = 0by forming the F-statisticM Sw/M SE. IfH0 is true, this F-statistic will

have an F-distribution with 1 andN−gdegrees of freedom (N−gfrom the SS and F-test for w({µi})

M SE). It is not too hard to see that this F is exactly equal to the square of thet-statistic computed for same null hypothesisδ = 0. Thus the F-test and two-sidedt-tests are equivalent for the null hypothesis of zero contrast mean.

It is also not too hard to see that if you multiply the contrast coefficients by a nonzero constant (for example, change from (-1, .5, .5) to (2, -1, -1)), then the contrast sum of squares is unchanged. The squared constant cancels from the numerator and denominator of the formula.

Rat liver weights Example 4.1

Exercise 3.1 provided data on the weight of rat livers as a percentage of body weight for four different diets. Summary statistics from those data follow:

i 1 2 3 4

yi• 3.75 3.58 3.60 3.92

ni 7 8 6 8 M SE =.04138

70 Looking for Specific Differences—Contrasts

If diets 1, 2, and 3 are rations made by one manufacturer, and diet 4 is a ration made by a second manufacturer, then it may be of interest to compare the responses from the diets of the two manufacturers to see if there is any difference.

The contrast with coefficients (1/3, 1/3, 1/3, -1) will compare the mean response in the first three diets with the mean response in the last diet. Note that we intend “the mean response in the first three diets” to denote the av-erage of the treatment avav-erages, not the simple avav-erage of all the data from those three treatments. The simple average will not be the same as the aver-age of the averaver-ages because the sample sizes are different.

Our point estimate of this contrast is w({yi•}) = 1

33.75 + 1

33.58 + 1

33.60 + (−1)3.92 =−.277 with standard error

SE(w({yi•})) =√ .04138

s (13)2

7 +(13)2

8 +(13)2

6 +(−1)2

8 =.0847 . The mean square for error has29−4 = 25degrees of freedom. To construct a 95% confidence interval for w({µi}), we need the upper 2.5% point of a t-distribution with 25 degrees of freedom; this is 2.06, as can be found in Appendix Table D.3 or using software. Thus our 95% confidence interval is

−.277±2.06×.0847 =−.277±.174 = (−.451,−.103) . Suppose that we wish to test the null hypothesisH0 :w({µi}) =δ. Here we will use thet-test and F-test to testH0 :w({µi}) = δ= 0, but thet-test can test other values ofδ. Ourt-test is

−.277−0

.0847 =−3.27 ,

with 25 degrees of freedom. For a two-sided alternative, we compute the p-value by finding the tail area under thet-curve and doubling it. Here we get twice .00156 or about .003. This is rather strong evidence against the null hypothesis.

Because our null hypothesis value is zero with a two-sided alternative, we can also test our null hypothesis by computing a mean square for the contrast

4.3 Orthogonal Contrasts 71

Listing 4.1:SAS PROC GLM output for the rat liver contrast.

Source DF Type I SS Mean Square F Value Pr > F

DIET 3 0.57820903 0.19273634 4.66 0.0102

Contrast DF Contrast SS Mean Square F Value Pr > F

1,2,3 vs 4 1 0.45617253 0.45617253 11.03 0.0028

Listing 4.2:MacAnova output for the rat liver contrast.

component: estimate (1) -0.28115 component: ss (1) 0.45617 component: se (1) 0.084674

and forming an F-statistic. The sum of squares for our contrast is (133.75 + 133.58 + 133.60 + (−1)3.92)2

(1/3)2

7 +(1/3)8 2 + (1/3)6 2 +(−1)8 2 = (−.277)2

.1733 =.443 .

The mean square is also .443, so the F-statistic is .443/.04138 = 10.7. We compute a p-value by finding the area to the right of 10.7 under the F-distribution with 1 and 25 degrees of freedom, getting .003 as for thet-test.

Listing 4.1 shows output from SAS for computing the sum of squares for this contrast; Listing 4.2 shows corresponding MacAnova output. The sum of squares in these two listings differs from what we obtained above due to rounding at several steps.

4.3 Orthogonal Contrasts

Two contrasts{w}and{w}are said to be orthogonal if Xg

i=1

wiwi/ni = 0 .

72 Looking for Specific Differences—Contrasts

If there aregtreatments, you can find a set ofg−1contrasts that are mutually orthogonal, that is, each one is orthogonal to all of the others. However, there are infinitely many sets ofg−1mutually orthogonal contrasts, and there are

g1orthogonal

contrasts no mutually orthogonal sets with more thang−1contrasts. There is an anal-ogy from geometry. In a plane, you can have two lines that are perpendicular (orthogonal), but you can’t find a third line that is perpendicular to both of the others. On the other hand, there are infinitely many pairs of perpendicular lines.

The important feature of orthogonal contrasts applied to observed means is that they are independent (as random variables). Thus, the random error of

Orthogonal contrasts are independent and partition variation

one contrast is not correlated with the random error of an orthogonal contrast.

An additional useful fact about orthogonal contrasts is that they partition the between groups sum of squares. That is, if you compute the sums of squares for a full set of orthogonal contrasts (g−1contrasts forggroups), then adding up thoseg−1sums of squares will give you exactly the between groups sum of squares (which also hasg−1degrees of freedom).

Example 4.2 Orthogonal contrast inference

Suppose that we have an experiment with three treatments—a control and two new treatments—with group sizes 10, 5, and 5, and treatment means 6.3, 6.4, and 6.5. TheM SE is .0225 with 17 degrees of freedom. The contrast w with coefficients (1, -.5, -.5) compares the mean response in the control treatment with the average of the mean responses in the new treatments. The contrast with coefficients (0, 1, -1) compares the two new treatments. In our example above, we had a control with 10 units, and two new treatments with 5 units each. These contrasts are orthogonal, because

0×1

10 +1× −.5

5 +−1× −.5 5 = 0 .

We have three groups so there are 2 degrees of freedom between groups, and we have described above a set of orthogonal contrasts. The sum of squares for the first contrast is

(6.3−.5×6.4−.5×6.5)2

1

10 +(−.5)5 2 +(−.5)5 2 =.1125 , and the sum of squares for the second contrast is

4.4 Polynomial Contrasts 73

(0 + 6.4−6.5)2

0

10+152 + (−1)5 2 = .01

.4 =.025 . The between groups sum of squares is

10(6.3−6.375)2+ 5(6.4−6.375)2+ 5(6.5−6.375)2 =.1375 which equals .1125 + .025.

We can see from Example 4.2 one of the advantages of contrasts over

the full between groups sum of squares. The control-versus-new contrast has Contrasts isolate differences

a sum of squares which is 4.5 times larger than the sum of squares for the difference of the new treatments. This indicates that the responses from the new treatments are substantially farther from the control responses than they are from each other. Such indications are not possible using the between groups sum of squares.

The actual contrasts one uses in an analysis arise from the context of the problem. Here we had new versus old and the difference between the two new treatments. In a study on the composition of ice cream, we might compare artificial flavorings with natural flavorings, or expensive flavorings with inexpensive flavorings. It is often difficult to construct a complete set of meaningful orthogonal contrasts, but that should not deter you from using an incomplete set of orthogonal contrasts, or from using contrasts that are nonorthogonal.

Use contrasts that address the questions you are trying to answer.

4.4 Polynomial Contrasts

Section 3.10 introduced the idea of polynomial modeling of a response when

the treatments had a quantitative dose structure. We selected a polynomial Contrasts yield improvementSS in polynomial dose-response models

model by looking at the improvement sums of squares obtained by adding each polynomial term to the model in sequence. Each of these additional terms in the polynomial has a single degree of freedom, just like a contrast. In fact, each of these improvement sums of squares can be obtained as a contrast sum of squares. We call the contrast that gives us the sum of squares for the linear term the linear contrast, the contrast that gives us the improvement sum of squares for the quadratic term the quadratic contrast, and so on.

74 Looking for Specific Differences—Contrasts

When the doses are equally spaced and the sample sizes are equal, then the contrast coefficients for polynomial terms are fairly simple and can be

Simple contrasts for equally spaced doses with equalni

found, for example, in Appendix Table D.6; these contrasts are orthogonal and have been scaled to be simple integer values. Equally spaced doses means that the gaps between successive doses are the same, as in 1, 4, 7, 10. Using these tabulated contrast coefficients, we may compute the linear, quadratic, and higher order sums of squares as contrasts without fitting a sep-arate polynomial model. Doses such as 1, 10, 100, 1000 are equally spaced on a logarithmic scale, so we can again use the simple polynomial contrast coefficients, provided we interpret the polynomial as a polynomial in the log-arithm of dose.

When the doses are not equally spaced or the sample sizes are not equal, then contrasts for polynomial terms exist, but are rather complicated to de-rive. In this situation, it is more trouble to derive the coefficients for the polynomial contrasts than it is to fit a polynomial model.

Example 4.3 Leaflet angles

Exercise 3.5 introduced the leaflet angles of plants at 30, 45, and 60 minutes after exposure to red light. Summary information for this experiment is given here:

Delay time (min)

30 45 60

yi• 139.6 133.6 122.4

ni 5 5 5

M SE = 58.13

With three equally spaced groups, the linear and quadratic contrasts are (-1, 0, 1) and (1, -2, 1).

The sum of squares for linear is

((−1)139.6 + (0)133.6 + (1)122.4)2

(−1)2

5 +05 +152 = 739.6 , and that for quadratic is

((1)139.6 + (−2)133.6 + (1)122.4)2

12

5 +(−2)5 2 +152 = 22.53 .

Thus the F-tests for linear and quadratic are 739.6/58.13 = 12.7 and 22.53/58.13 =.39, both with 1 and 12 degrees of freedom; there is a strong linear trend in the means and almost no nonlinear trend.

4.5 Further Reading and Extensions 75

4.5 Further Reading and Extensions

Contrasts are a special case of estimable functions, which are described in some detail in Appendix Section A.6. Treatment means and averages of treatment means are other estimable functions. Estimable functions are those features of the data that do not depend on how we choose to restrict the treat-ment effects.

4.6 Problems

An experimenter randomly allocated 125 male turkeys to five treatment Exercise 4.1 groups: 0 mg, 20 mg, 40 mg, 60 mg, and 80 mg of estradiol. There were

25 birds in each group, and the mean results were 2.16, 2.45, 2.91, 3.00, and 2.71 respectively. The sum of squares for experimental error was 153.4.

Test the null hypothesis that the five group means are the same against the alternative that they are not all the same. Find the linear, quadratic, cubic, and quartic sums of squares (you may lump the cubic and quartic together into a “higher than quadratic” if you like). Test the null hypothesis that the quadratic effect is zero. Be sure to report ap-value.

Use the data from Exercise 3.3. Compute a 99% confidence interval for Exercise 4.2 the difference in response between the average of the three treatment groups

(acid, pulp, and salt) and the control group.

Refer to the data in Problem 3.1. Workers 1 and 2 were experienced, Exercise 4.3 whereas workers 3 and 4 were novices. Find a contrast to compare the

expe-rienced and novice workers and test the null hypothesis that expeexpe-rienced and novice works produce the same average shear strength.

Consider an experiment taste-testing six types of chocolate chip cookies: Exercise 4.4 1 (brand A, chewy, expensive), 2 (brand A, crispy, expensive), 3 (brand B,

chewy, inexpensive), 4 (brand B, crispy, inexpensive), 5 (brand C, chewy, expensive), and 6 (brand D, crispy, inexpensive). We will use twenty different raters randomly assigned to each type (120 total raters).

(a) Design contrasts to compare chewy with crispy, and expensive with inex-pensive.

(b) Are your contrasts in part (a) orthogonal? Why or why not?

A consumer testing agency obtains four cars from each of six makes: Problem 4.1

A consumer testing agency obtains four cars from each of six makes: Problem 4.1