1 Estimating and Testing 2 0 (n-1)s 2 / 2 has a 2 distribution with n-1 degrees of freedom Like other parameters, can create CIs and hypothesis tests since we know the distribution
Jan 30, 2016
1
Estimating and Testing 2
0
(n-1)s2/2 has a 2 distribution with n-1 degrees of freedom
Like other parameters, can create CIs and
hypothesis tests since we know the
distribution
2
Estimating and Testing 1
2 / 22
0
12/2
2 has an F distribution with n1-1 and n2-1 d.f.
Like other parameters, can create CIs and
hypothesis tests since we know the
distribution
3
One-Way ANOVA
• Example• As a training specialist, you want to determine whether three
different training methods are equally effective so you want to compare the mean time to complete a task after individuals are trained with the three different methods. (Random variable: completion time)
• One-Way ANOVA hypothesis test• H0: 1 = 2 = 3 = . . . = k • HA: The means are not all equal (at least one pair differs from
each other) • Three Requirements
• k independent random samples• Random variables are normally distributed• Equal population variances for the random variables
4
One-Way ANOVA Data Set
SampleOne
SampleTwo
. . . Samplek
Data
Values
. . .
Mean x1 x2 xk
Variance s12 s2
2 . . . sk2
Sample Size n1 n2 nk
x1,1
x1,2
x1,3
…
x2,1
x2,2
x2,3
…
xk,1
xk,2
xk,3
…
_ _ _
5
One-Way ANOVA
• One-Way ANOVA hypothesis test
• H0: 1 = 2 = 3 = . . . = k
• HA: The means are not all equal (at least one pair differs from each other)
• Test Statistic
• F = BSV / WSV with k-1, nT-k d.f.
• Decision Rule
• Reject H0 if F > F
• Intuition
• If BSV is “large” then H0 is unlikely to be true
Note: Always one-tailed and >
6
F Distribution
0?
P(F > ) = 0.05
P(F < ) = 0.95
9 and 10 d.f
7
Select F Distribution
5% Critical ValuesNumerator Degrees of Freedom
1 2 4 5 6 7 8 9 …1 161 199 225 230 234 237 239 2412 18.5 19.0 19.2 19.3 19.3 19.4 19.4 19.43 10.1 9.55 9.12 9.01 8.94 8.89 8.85 8.818 5.32 4.46 3.84 3.69 3.58 3.50 3.44 3.39
10 4.96 4.10 3.48 3.33 3.22 3.14 3.07 3.0211 4.84 3.98 3.36 3.20 3.09 3.01 2.95 2.9012 4.75 3.89 3.26 3.11 3.00 2.91 2.85 2.8018 4.41 3.55 2.93 2.77 2.66 2.58 2.51 2.46100 3.94 3.09 2.46 2.31 2.19 2.10 2.03 1.97
1000 3.85 3.00 2.38 2.22 2.11 2.02 1.95 1.89…D
enom
inat
or D
egre
es o
f F
reed
om
8
One-Way ANOVA: Example
• H0: 1 = 2 = 3
• HA: The means are not all equal
• Test Statistic• F = BSV / WSV with k-
1,nT-k d.f.
• Decision Rule
• Reject H0 if F > F
• Intuition
• If BSV is “large” then H0 is unlikely to be true
Sample One
Sample Two
Sample Three
10 16 20
10 14 20
11 16 20
10 14 20
9 20x
s2
n
_
nT = , x = =
9
One-Way ANOVA: Another Example
• H0: 1 = 2 = 3
• HA: The means are not all equal
• Test Statistic• F = BSV / WSV with k-
1,nT-k d.f.
• Decision Rule
• Reject H0 if F > F
• Intuition
• If BSV is “large” then H0 is unlikely to be true
Sample One
Sample Two
Sample Three
1 19 5
12 31 33
20 4 20
10 6 12
7 30x
s2
n
_
nT = , x = =
10
Data Analysis: ANOVA-Single
FactorGroups Count Sum Average Variance
Column 1 5 50 10 0.5
Column 2 4 60 15 1.333
Column 3 5 100 20 0
ANOVA
Source of Variation
SS df MS F P-value
F crit
Between Groups
250 2 125 229.167 0.000 3.98
Within Groups
6 11 0.545
Total 256 13
11
Two-Way ANOVA
• Example• Suppose 10 individuals are asked to judge the taste quality of
three beers: Budweiser, Bass Ale, and London Pride. Based on some complicated rating system, each individual assigns a numerical score to each beer (all 10 individuals taste each of the three beers).
• Note that we now have two factors: raters and beers• Questions
• Is the average taste rating equal for each beer?• Is the average taste rating equal for each rater?
• Can do an ANOVA hypothesis test for each question:• H0: 1 = 2 = 3 = . . . = k • HA: The means are not all equal (at least one pair differs from
each other)
12
Two-Way ANOVA: Example
• Suppose 10 individuals are asked to judge the taste quality of three beers: Budweiser, Bass Ale, and London Pride. Based on some complicated rating system, each individual assigns a numerical score to each beer (all 10 individuals taste each of the three beers). Once the data are collected, you estimate the following ANOVA table:
Source df
Sum of
Squares
Mean
Square
F
Beer 2 5.98 2.99 2.39
Rater 9 112.49 13.61 10.89
Error 18 22.50 1.25
13
Another Example
Treatments
A B C
Blocks
1 10 9 82 12 6 53 18 15 144 20 18 185 8 7 8
• These data values were obtained from a randomized block design experiment.
• First, Pretend that these data were collected using a completely randomized design. Can we conclude at the 5% significance level that there are differences in the treatment means?
• How does your answer change if you account for the randomized block design?
14
Pretend One-Way
Groups Count Sum Average Variance
Treatment A 5 68 13.60 26.80
Treatment B 5 55 11.00 27.50
Treatment C 5 53 10.60 27.80
ANOVA
Source of Variation
SS df MS F P-value
F crit
Between Groups
26.533 2 0.627 3.86
Within Groups
328.400 12
Total 354.933 14
15
But is Actually Two-Way
ANOVA: Two-Factor Without Replication
Source of Variation
SS df MS F P-value
F crit
Rows 312.267 4 78.067 38.711 0.000 3.84
Columns 26.533 2 13.267 6.579 0.020 4.46
Error 16.133 8 2.017
Total 354.933 14
16
One-Way ANOVA via Regression
Sample One
Sample Two
Sample Three
10 16 20
10 14 20
11 16 20
10 14 20
9 20
S1 S2 S3 Treatment1 0 0 101 0 0 101 0 0 111 0 0 101 0 0 90 1 0 160 1 0 140 1 0 160 1 0 140 0 1 200 0 1 20
… …
“Stack” data using dummy
variables
17
One-Way ANOVA via Regression
ANOVA (from ANOVA output)
Source of Variation
SS df MS F P-value
F crit
Between 250 2 125 229.167 0.000 3.98
Within 6 11 0.545
Total 256 13
ANOVA (from Regression output)
df SS MS F Significance
Regression 2 250 125 229.167 0.0000
Residual 11 6 0.545
Total 13 256
18
The RegressionANOVA Table
Regression Statistics
Multiple R 0.988
R Squared 0.977
Adj. R Squared 0.972
Standard Error 0.739
Obs. 14
ANOVA
df SS MS F Significance
Regression 2 250 125 229.167 0.0000
Residual 11 6 0.545
Total 13 256
Coeff. Std. Error t stat p value Lower 95% Upper 95%
Intercept 10 0.330 30.277 0.0000 9.273 10.727
S2 5 0.495 10.092 0.0000 3.910 6.090
S3 10 0.467 21.409 0.0000 8.972 11.028
F test for:Ho: 1= 2 = … = k = 0(excluding the intercept)HA: at least one i0
19
Regression and Two-Way ANOVA
Treatments
A B C1 10 9 82 12 6 53 18 15 144 20 18 185 8 7 8
Blo
cks
“Stack” data using dummy
variables
A B C B2 B3 B4 B5 Value1 0 0 0 0 0 0 101 0 0 1 0 0 0 121 0 0 0 1 0 0 181 0 0 0 0 1 0 201 0 0 0 0 0 1 80 1 0 0 0 0 0 90 1 0 1 0 0 0 60 1 0 0 1 0 0 150 1 0 0 0 1 0 180 1 1 0 0 0 1 70 0 1 0 0 0 0 8
… …
20
Regression and Two-Way ANOVA
Source | SS df MS Number of obs = 15----------+---------------------- F( 6, 8) = 28.00 Model | 338.800 6 56.467 Prob > F = 0.0001 Residual | 16.133 8 2.017 R-squared = 0.9545-------------+------------------- Adj R-squared = 0.9205 Total | 354.933 14 25.352 Root MSE = 1.4201
-------------------------------------------------------------treatment | Coef. Std. Err. t P>|t| [95% Conf. Int]----------+-------------------------------------------------- b | -2.600 .898 -2.89 0.020 -4.671 -.529 c | -3.000 .898 -3.34 0.010 -5.071 -.929 b2 | -1.333 1.160 -1.15 0.283 -4.007 1.340 b3 | 6.667 1.160 5.75 0.000 3.993 9.340 b4 | 9.667 1.160 8.34 0.000 6.993 12.340 b5 | -1.333 1.160 -1.15 0.283 -4.007 1.340 _cons | 10.867 .970 11.20 0.000 8.630 13.104-------------------------------------------------------------
Need Partial F test(later in course)