Note set #3 Stat402B (Spring 2016) Last update: January 20, 2016 Stat 402B (Spring 2016): Note set 3 Comparing Several Treatments Example • Data. Let yij represent the j-thP observation taken under treatment i for a i=1,...,a and j=1,...,ni. Let N= i=1 ni Treatment 1 Treatment 2 . . . y11 y21 ... y12 y22 ... .. .. y1n1 y2n2 ... Sample Means: ȳ1. ȳ2. ... where ȳi. = yij j=1 ni , Pni Treatment a ya1 ya2 .. yana ȳa. i = 1, . . . , a. 1 Stat 402B (Spring 2016): Note set 3 Assume y11, . . . , y1n1 y21, . . . , y2n2 .. iid ∼ N (µ1, σ 2) iid N (µ2, σ 2) ∼ iid ya1, . . . , yana ∼ N (µa, σ 2) This assumption can be represented by the model (the means model): iid yij = µi + eij , where eij ∼ N (0, σ 2) or equivalently, by the effects model: yij = µ + τi + eij where τi are treatment effects expressed as deviations from a fixed value µ. The null hypothesis of interest is H0 : µ1 = · · · = µa vs Ha : at least one inequality or, equivalently H0 : τ1 = · · · = τa vs Ha : at least one inequality 2 Stat 402B (Spring 2016): Note set 3 • Variation within treatments Pn1 − ȳ1.)2 , estimates σ 2 = n1 − 1 Pn2 2 (y − ȳ ) 2i 2. s22 = i=1 , estimates σ 2 n2 − 1 .. Pna 2 (y − ȳ ) ai a. , estimates σ 2 s2a = i=1 na − 1 Pool them to obtain one estimator of σ 2: s21 s2E i=1 (y1i = (n1 −1)s21 +(n2 −1)s22 +···+(na −1)s2a (n1 −1)+(n2 −1)+···+(na −1) Pa = i=1 Pni j=1 (yij −ȳi. ) 2 N −a 3 Stat 402B (Spring 2016): Note set 3 Pa Pni j=1 (yij − ȳi. ) 2 is called the within treatment sum of squares with (N-a) d.f. and is denoted by SSE . s2E is called the within treatment mean square. i=1 • Variation Between Treatments σ2 From the above, we know that ȳi. ∼ N (µi, ni ), i = 1, 2, . . . , a and they are independent. Pa 2 2 i=1 ni (ȳi. − ȳ.. ) sT rt = a−1 Pa Pni Pa Pni i=1 j=1 yij 2 . The denominator n (ȳ − ȳ ) where ȳ.. = i i. .. i=1 j=1 N is between treatment sum of squares with (a-1) d.f. and is denoted by SST rt. s2T rt is the between treatment mean squares. Pa Pni 2 (y − ȳ ) ij .. i=1 j=1 s2T ot = N −1 4 Stat 402B (Spring 2016): Note set 3 Pa Pni − ȳ..) is called the total corrected sum of squares with (N-1) degrees of freedom and is denoted by SST ot. We have the partitioning i=1 j=1 (yij SST ot = SST rt + SSE that gives the anova table Source of Variation d.f. SS MS F Bet. Trt a − 1 SST rt M ST rt M ST rt/M SE Within Trt N − a SSE M SE Total N − 1 SST rt We reject H0 at α level of significance if F > Fα,a−1,N −a Example 3.1: Plasma Etching Experiment • An engineer is interested in investigating the relationship between the RF power setting and the etch rate for a wafer plasma-etching tool. She 5 Stat 402B (Spring 2016): Note set 3 is interested in a particular gas (hexafluroethane) and gap (.8 cm) and wants to test four levels of RF power:160, 180, 200, and 220 W. She decided to test five wafers at each level of RF power. This is an example of a single-factor experiments with a = 4 levels and n = 5 replicates. For this to be a completely randomized design, the 20 tests needs to be run in a random order i.e., the order in which the testing is done has to be determined randomly. • ANOVA Table (Table 3.4 Source of Variation d.f. SS MS F p − value RF Power 3 66, 870.55 22, 290.18 66.8 < .0001 Error 16 5339.20 333.70 Total 19 72, 209.75 6 Stat 402B (Spring 2016): Note set 3 • Estimation and Prediction yij = µi + eij or yij = µ + τi + eij where eij ∼ N (0, σ 2). • Best estimates of µ1, . . . , µa are ȳ1., . . . , ȳ2., . . . , ȳa respectively. i.e. µ̂i = ȳi, i=1,...,a. • Estimate of the difference µp − µq for any p 6= q is ȳp. − ȳq. • We cannot estimate τi’s uniquely, but can estimate the difference in a pair of τi’s. Estimate of τp − τq is ȳp. − ȳq. • σ̂ 2 = s2E = M SE • Values predicted by the model for yij are: yij = µ̂i = ȳi for each observation. 7 Stat 402B (Spring 2016): Note set 3 • Residuals rij = yij − ȳi. • SSE is also called the residuals sum of squares • Residuals are entirely model independent. If the model is adequate, the residuals should contain no obvious patterns. • Data yij Power(W) yi. ni ȳi 160 575 542 530 539 570 2756 5 551.2 Etch Rate 180 200 565 600 593 651 590 610 579 637 610 629 2937 3127 5 5 587.4 625.4 220 725 700 715 685 710 3535 5 707.0 8 Stat 402B (Spring 2016): Note set 3 Power(W) prediced values ŷij Power(W) Residuals yij − ŷij 160 551.20 551.20 551.20 551.20 551.20 160 23.8 −9.2 −21.2 −12.2 18.8 Predicted Values 180 200 587.40 625.40 587.40 625.40 587.40 625.40 587.40 625.40 587.40 625.40 220 707.00 707.00 707.00 707.00 707.00 Residuals 180 200 −22.4 −25.4 5.6 25.6 2.6 −15.4 −8.4 11.6 22.6 3.6 220 18.0 −7.0 8.0 −22.0 3.0 9 Stat 402B (Spring 2016): Note set 3 Pairwise Comparison of Means (or Effects) Pairwise t-tests H0 : µp = µq vs Ha : µp 6= µq Reject H0 if kt0k > tα/2,N −a µp and µq different at α level P, ai.e., declare of significance. Where N = i=1 ni, s2E = M SE and tα,N −a is the upper 100( α2 )% point of the t-distribution with (N-a) d.f. Confidence Intervals (CIs) for Differences A 100(1 − α)% CI for µp − µq is given by s (ȳp. − ȳq.) ± tα/2,N −a · sE 1 1 + np nq 10 Stat 402B (Spring 2016): Note set 3 If this interval does not include zero, we say µp and µq are different at α level of significance. Least Significance Difference(LSD) Declare µp, µq significantly different at α level if s |ȳp. − ȳq.| > tα/2,N −a · sE 1 1 + np nq The quantity on the right side hand is called the least significance difference or the LSD. For the balanced case, i.e., n1 = · · · = na = n r 2 LSDα = tα/2,N −a · sE n LSD Procedure (can be used this way only when sample sizes are equal). 11 Stat 402B (Spring 2016): Note set 3 Example 3.8: As an illustration of this procedure, compute LSD at α = .05 for the Plasma Etching example r r r 2 2sE 2 2(333.7) = t.025,16 = 2.12 = 24.49 LSD.05 = t.025,16 · sE n n 5 This implies that any pair of means will be found to be significantly different if the difference in sample means of the pair exceeds 24.49. We may use the underscoring procedure make comparing every pair simpler. In this case, this method is unnnecessary as all pairs of means are found to be significantly different. (See the analysis of Exercise 3.10 below for an illustration of the underscoring procedure.) Important Notes: • The type I error rate α holds only for testing only a single hypotheis, not testing all possible differences among the means. 12 Stat 402B (Spring 2016): Note set 3 • When we do all pairwise tests at α level, the actual type I error rate turns out to be much greater than α. • One way to alleviate this problem is to use the Bonferroni adjustment: Replace α with α/k where k is the number of comparisons being made. In the case when a means are being compared, k = (a)(a − 1)/2. So for computing the LSD, one would use a t-value=tα/2k . • The problem with this method is it turns-out to be too conservative i.e.: one may fail to find a few pairs of means that are actually different to be significant. • In any case, make sure that the ANOVA F-statistic is significant at α level before we use the LSD procedure to ensure that the type I error rate is somewhat controlled, when making all pairwise comparisons. • LSD procedures often leads to conflicting results. 13 Stat 402B (Spring 2016): Note set 3 Tukey’s Method When comparing a means, suppose we wish to state a confidence interval for µp − µq taking into account the fact that all possible pairwise differences may be examined. A confidence interval that gives a confidence of 100(1 − α)% or more when making all pairwise comparisons is given by Tukey’s Studentized range statistic. A 100(1 − α)% CI for µp − µq is given by √ (ȳp. − ȳq.) ∓ (qα,a,f / 2) · sE s 1 1 + np nq where qα,a,f is the upper significant level of the studentized range (see Table VII). a is the number of means compared and f is the degrees of 14 Stat 402B (Spring 2016): Note set 3 freedom associated with s2E = M SE . Calculate sE Tukeyα = qα,a,f · √ n and use this value the same way as the LSD i.e., declare a difference of means, ȳp. − ȳq. significant if |ȳp. − ȳq.| > Tukeyα If this procedure is used when making all possible pairwise tests of differences, the total type I error rate is controlled at α. Example 3.7: As an illustration of this procedure, compute LSD at .05 α for the Plasma Etching exampleFor the Etch-rate example, r sE 333.7 . Tukey.05 = q.05,4,16 · √ = 4.05 = 33.09 5 5 Using this value we still find differences of all pairs of means significantly different. 15 Stat 402B (Spring 2016): Note set 3 Exercise 3.10 A product developer is investigating the tensile strength of a new synthetic fiber that will be used to make cloth for mens shirts. Strength is usually affected by the percentage of cotton used in the blend of materials for the fiber. The engineer conducts a completely randomized experiment with five levels of cotton content and replicated the experiment five times. The data are: yi. ni ȳi 15 7 7 15 11 9 49 5 9.8 % of Cotton 20 25 30 12 14 19 17 19 25 12 19 22 18 18 19 18 18 23 77 88 108 5 5 5 15.4 17.6 21.6 35 7 10 11 15 11 54 5 10.8 16 Stat 402B (Spring 2016): Note set 3 ANOVA Table Source of Variation d.f. SS MS F p − value Percentage 4 475.76 118.94 14.76 < .0001 Error 20 161.20 8.06 Total 24 636.96 Since the F-value is 14.76 with a corresponding p-value of < 0.0001, reject the hypothesis that the tensile strength means are all equal. The percentage of cotton in the fiber appears to have an effect on the tensile strength. Compute LSD at α = .05: r LSD.05 = t.025,20 sE 2 = t.025 n r 2s2E n r = 2.086 2(8.06) = 3.75 5 17 Stat 402B (Spring 2016): Note set 3 Arrange the sample means in increasing order of magnitude: ȳ1. ȳ5. ȳ2. ȳ3. ȳ4. The underscoring procedure gives: Cotton 15% 35% 20% 25% Means 9.8 10.8 15.4 17.6 ————– ————– 30% 21.6 The following conclusions may be made: • Mean strength of 30% cotton fiber is significantly different from all other fiber means and is the strongest. • Mean strength of 20% and 25% cotton fiber are not different from each other but significantly less stronger that the 30% cotton fiber. • Mean strength of 15% and 35% cotton fiber are not different from each other but significantly less stronger that the 20%, 25%, and 30% cotton fiber. 18