ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For...

26
ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery bags is concerned about the tensile strength of the paper. Product engineers believe that tensile strength is a function of the hardwood concentration and want to test several concentrations for the effect on tensile strength. If there are 2 different hardwood concentrations (say, 5% and 15%), then a z- test or t-test is appropriate: H 0 : μ 1 = μ 2 H 1 : μ 1 = μ 2

Transcript of ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For...

Page 1: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

1

Analysis of Variance (ANOVA)

Suppose we want to compare more than two means?For example, suppose a manufacturer of paper used for grocery bags is concerned about the tensile strength of the paper. Product engineers believe that tensile strength is a function of the hardwood concentration and want to test several concentrations for the effect on tensile strength.

If there are 2 different hardwood concentrations (say, 5% and 15%), then a z-test or t-test is appropriate:

H0: μ1 = μ2

H1: μ1 ≠ μ2

Page 2: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

2

Comparing > 2 MeansWhat if there are 3 different hardwood

concentrations (say, 5%, 10%, and 15%)? H0: μ1 = μ2 H0: μ1 = μ3 H0: μ2 = μ3

H1: μ1 ≠ μ2 H1: μ1 ≠ μ3 H1: μ2 ≠ μ3

How about 4 different concentrations (say, 5%, 10%, 15%, and 20%)?All of the above, PLUS H0: μ1 = μ4 H0: μ2 = μ4 H0: μ3 = μ4

H1: μ1 ≠ μ4 H1: μ2 ≠ μ4 H1: μ3 ≠ μ4

What about 5 concentrations? 10?

and and

and and

Page 3: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

3

Comparing > 2 Means

Also, suppose α = 0.05(1 – α) = P(accept H0 | H0 is true) = 0.95

4 concentrations: (0.95)4 = 0.814

5 concentrations: _____________

10 concentrations: _____________

Instead, use Analysis of Variance (ANOVA)treatment, factor, independent variable: that which

is varied (a levels)observation, replicates, dependent variable: the

result of concern (n per treatment)randomization: performing experimental runs in

random order so that other factors don’t influence results.

Page 4: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

4

One-Way ANOVA

1. Calculate and check residuals, eij = Oi - Ei

plot residuals vs treatments normal probability plot

2. Perform ANOVA and determine if there is a difference in the means

3. Identify which means are different using graphical methods,Tukey’s procedure, etc.:

4. Model: yij = μ + τi + εij

nMS

faqyy Eji ),(

Page 5: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

5

Our ExampleSix specimens were made at each of the 4

hardwood concentrations. The 24 specimens were tested in random order on a tensile test machine, with the following results:Hardwood Observations

Concentration (%) 1 2 3 4 5 6

Totals

Averages

5 7 8 15 11 9 10 60 10.00

10 12 17 13 18 19 15 94 15.67

15 14 18 19 17 16 18 102 17.00

20 19 25 22 23 18 20 127 21.17

  383 15.96

Page 6: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

6

To determine if there is a difference …1. Calculate sums of squares

2. Calculate degrees of freedomdftreat = a – 1 = _____

dfE = a(n – 1) = _____

dftotal = an – 1 = _____

_________________

__________________

________________

2

1

2

2

1 1

2

treattotalE

a

i

itreat

a

i

n

jijtotal

SSSSSS

N

y

n

ySS

N

yySS

Page 7: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

7

Determining the Difference

3. Mean Square, MS = SS/df

MStreat = ___________

MSE = ___________

4. Calculate F = MStreat / MSE = _____________

Page 8: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

8

Organizing the Results

5. Build the ANOVA table and determine significance

fixed α-level compare to Fα,a-1, a(n-1)

p – value find p associated with this F with degrees of freedom a-1, a(n-1)

ANOVA

Source of Variation SS df MS F P-value F crit

Treatment382.7

9 3 127.619.

63.6E-

06 3.1

Error130.1

7 206.508

3

Total512.9

6 23        

Page 9: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

9

Conclusion?

6. Draw the picture and state your conclusion …

Conclusion:

Why?E(MSE) = σ2 alwaysE(MStreat) = σ2 only if the means are equal

Page 10: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

10

In Excel,In Data Analysis, choose ANOVA: Single Factor,

then …

Page 11: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

11

Gives the result …

Page 12: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

12

In Minitab,

STAT / ANOVA / One-Way (Unstacked) … gives the following results …

Page 13: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

13

Note ..STAT / ANOVA / One-Way … gives the same

results, but the input looks like …

Page 14: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

14

Checking residuals …

Calculate residuals,

Plot against normal score to check normality assumption,

iijij yye

Nindexvsinnormzij /5.0

Page 15: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

15

In Excel,

Page 16: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

16

In Minitab,

Select Graphs… and Normal plot of residuals when you perform the ANOVA …

Residual

Perc

ent

5.02.50.0-2.5-5.0

99

95

90

80

70

605040

30

20

10

5

1

Normal Probability Plot of the Residuals(responses are 5, 10, 15, 20)

Page 17: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

17

Other plots can check for independence

Residuals vs fitted values

Residuals vs treatment meansResiduals vs timeResiduals vs …?

Fitted Value

Resi

dual

22201816141210

5

4

3

2

1

0

-1

-2

-3

-4

Residuals Versus the Fitted Values(responses are 5, 10, 15, 20)

Page 18: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

18

Which means are different?

Graphical methods

Numerical methodsTukey’s testDuncan’s Multiple Range test

Page 19: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

19

Tukey’s testCreate confidence intervals around the difference

in means using the Studentized Range Statistic, qα(a,f) where a = number of treatment levels and f = degrees of freedom for error.

In our example, qα(a,f) = _________

compare this value to the differences in the means …

nMS

faqyy Eji ),(

____________________),( n

MSfaq E

Page 20: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

20

In Minitab,Select Comparisons… and Tukey’s when you

perform the ANOVA.

Page 21: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

21

Page 22: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

22

Random effects model

The analysis we just did is an example of a fixed effects modelSet levels of a factor of interestAssumes we can identify and test at all possible levels

Alternatively, the factor may have a large number of levels (too big to test them all)want to make conclusions about the whole population

based on a random sampling of the possible levelsthis is called a random effects modelsame model, same analysis, same conclusions, but

the underlying hypotheses are different:H0: στ

2 = 0

H1: στ2 > 0

Page 23: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

23

Blocking

Creating a group of one or more people, machines, processes, etc. in such a manner that the entities within the block are more similar to each other than to entities outside the block.

Balanced design: each treatment appears in each block.

Model: yij = μ + τ i + βj + εij

Page 24: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

24

Example:Robins Air Force Base uses CO2 to strip paint from F-15’s. You have been asked to design a test to determine the optimal pressure for spraying the CO2. You realize that there are five machines that are being used in the paint stripping operation. Therefore, you have designed an experiment that uses the machines as blocking variables. You emphasized the importance of balanced design and a random order of testing. The test has been run with these results (values are minutes to strip one fighter):

Page 25: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

25

ANOVA: One-Way with BlockingConstruct the ANOVA table

Page 26: ETM 620 - 09U 1 Analysis of Variance (ANOVA) Suppose we want to compare more than two means? For example, suppose a manufacturer of paper used for grocery.

ETM 620 - 09U

26

Blocking Example

Your turn: fill in the blanks in the following ANOVA table (from Excel):

2. Make decision and draw conclusions:

ANOVA

Source of Variation SS df MS F P-value F crit

Rows 89.733 2 44.8678.49

20.010

54.45896

8

Columns 77.733 ___ _____ ____0.055

3 _______

Error 42.267 8 5.2833

Total 209.73 ___