22
Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

  • View
    219

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

Stat 470-3

• Today: Will consider the one-way ANOVA model for comparing means of several treatments

Page 2: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

Example

• Issue – shelf-life of pre-packaged meat• Objective – Compare four different packaging methods. Are there

differences? Which packaging is best? :1. T1. commercial plastic wrap2. T2. vacuum package

3. T3. 1%CO, 40%O2, 59%N

4. T4. 100% CO2

– Factor: Packaging– Experimental units: 12 steaks– Experimental Design: randomly assign 3 steaks to each packaging condition

balanced completely randomized design with a = 4, n = 3– Response: count of bacteria after 9 days at 4oC (39oF);

y = log(bacteria count/cm2)

Page 3: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

DataAnalysis 1: Plot the Data

T1

T2

T3

T4

3

4

5

6

7

8

Treatment

y

Dotplots of y by Treatmen(group means are indicated by lines)

Notation:

k = 4 Treatments

ni = 3 reps per Treatment

N = 12 total observations

Eyeball Analysis: Does it look like all of these data could come from the same distribution? Or from four different distributions?

Package Rep. 1 Rep. 2 Rep 3. T1 7.66 6.98 7.80 T2 5.26 5.44 5.80 T3 7.41 7.33 7.04 T4 3.51 2.91 3.66

Page 4: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

Experiments with a Single Factor: Completely Random Design

• Objective: – Determine if the mean response of a factor is the same at all levels

– If there is a difference, which levels differ?

• Method:– Have a single factors with k levels

– N experimental units available for the experiment

– N = n1 + n2+…+nk

– Randomly assign treatments to different experimental units

– Conduct experiment

– Results: yij, i=1,…,k; j=1,…,ni

Page 5: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

Experiments with a Single Factor: Completely Random Design

• Model:

Page 6: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

Sums of Squares

Page 7: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

Test Statistic

Page 8: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

ANOVA Table

Source Degrees of Freedom

Sum of Squares Mean Squares

F-Statistic P-Value

Treatments k-1

k

iii yyn

1

2... )(

Residual N-k

k

i

n

jiij

i

yy1 1

2.)(

Total N-1

k

i

n

jij

i

yy1 1

2..)(

Page 9: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

Summary

• We have found a statistic (F) which:– compares the variance among treatment means to the variance within

treatments

– has a known distribution when all the treatment means are equal

• By comparing this F statistic to the F(k-1, N-k) distribution, we evaluate the strength of the evidence against the assumption of equal underlying treatment means

Page 10: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

Back to the Example

Descriptive Statistics

Dependent Variable: RESPONSE

7.4800 .43863 3

5.5000 .27495 3

7.2600 .19468 3

3.3600 .39686 3

5.9000 1.75291 12

PACKAGET1

T2

T3

T4

Total

Mean Std. Deviation N

Tests of Between-Subjects Effects

Dependent Variable: RESPONSE

a

32.873 3 10.958 94.584 .000

.927 8 .116

33.800 11

Source

PACKAGE

Error

Corrected Total

Type III Sumof Squares df Mean Square F Sig.

R Squared = .973 (Adjusted R Squared = .962)a.

Page 11: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

Back to the Example

• Interpretation:

Page 12: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

Comment

• When a = 2 (two treatments), F for testing for no difference among treatments is equal to t2 in the two-sample (unpaired) t-test

– Out-of-Class Exercise. • Demonstrate this equality by doing an ANOVA on the data in tomato

plant problem.

• Compare percentiles in F and t tables…what do you observe?

– For the mathematically inclined, demonstrate this equality algebraically

Page 13: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

NOTE: It All Adds Up!

• It can be shown algebraically thatTotal SS = Treatment SS + Error SS

• Also, the degrees of freedom add up:N-1 = (k-1) + (N-k)

Page 14: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

Exercise: Out-of-Class

• By using the formulas in the ANOVA table, verify the above ANOVA table for the meat packaging data

Page 15: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

Estimation of Model Parameters: Constraints

• The model is over-parameterized

• Have k types of observation

• Have (k+1) parameters in the model– k for the treatment effects

– 1 for the grand mean

• Need to impose constraints to get solution

Page 16: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

Constraints

• Sum to Zero Constraint:

• Interpretation:

Page 17: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

Constraints

• Baseline Constraint:

• Interpretation:

Page 18: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

Multiple Comparisons

• In previous example, we saw that there was a significant treatment effect…so what?

• If an ANOVA is conducted and the analysis suggests that there is a significant treatment effect, then a reasonable question to ask is

Page 19: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

Multiple Comparisons

• Would like to see if there is a difference between treatments i and j

• Can use two-sample t-test statistic to do this

• For testing reject if

• Perform many of these tests

jiAji HH : versus:0

Page 20: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

Multiple Comparisons

• Perform many of these tests

• Error rate must be controlled

Page 21: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

Tukey Method

• Tests:

• Confidence Interval:

Page 22: Stat 470-3 Today: Will consider the one-way ANOVA model for comparing means of several treatments

Back to Example