Professional Documents
Culture Documents
Stat Slides 5
Stat Slides 5
t Test
Tests means of 2 independent populations having
equal variances
Parametric test procedure
Assumptions
Both populations are normally distributed
If not normal, can be approximated by normal distribution
(n
1
> 30 & n
2
> 30 )
Population variances are unknown but assumed equal
Two Independent Populations
Examples
An economist wishes to determine whether
there is a difference in mean family income
for households in 2 socioeconomic groups.
An admissions officer of a small liberal arts
college wants to compare the mean SAT
scores of applicants educated in rural high
schools & in urban high schools.
Pooled Variance t Test Example
Youre a financial analyst for Charles Schwab. You want
to see if there a difference in dividend yield between stocks
listed on the NYSE & NASDAQ.
NYSE NASDAQ
Number 21 25
Mean 3.27 2.53
Std Dev 1.30 1.16
Assuming equal variances, is
there a difference in average
yield (o = .05)?
1984-1994 T/Maker Co.
Pooled Variance t Test
Solution
H0:
1
-
2
= 0 (
1
=
2
)
H1:
1
-
2
= 0 (
1
=
2
)
o = .05
df = 21 + 25 - 2 = 44
Critical Value(s):
Test Statistic:
Decision:
Conclusion:
t
0 2.0154 -2.0154
.025
Reject H
0
Reject H
0
.025
t
0 2.0154 -2.0154
.025
Reject H
0
Reject H
0
.025
2.03
25
1
21
1
1.510
2.53 3.27
t + =
|
.
|
\
|
+
=
Reject at o = .05
There is evidence of a
difference in means
Test Statistic
Solution
t
X X
S
n n
S
n S n S
n n
P
P
=
+
F
H
G
I
K
J
=
+
F
H
I
K
= +
=
+
+
=
+
+
=
1 2 1 2
2
1 2
2
1 1
2
2 2
2
1 2
2 2
1 1
3 27 2 53 0
1510
1
21
1
25
2 03
1 1
1 1
21 1 130 25 1 116
21 1 25 1
1510
c h
a f
a f af
a f a f
a f a f
a f a f a f a f
a f a f
. .
.
.
. .
.
t
X X
S
n n
S
n S n S
n n
P
P
=
+
F
H
G
I
K
J
=
+
F
H
I
K
= +
=
+
+
=
+
+
=
1 2 1 2
2
1 2
2
1 1
2
2 2
2
1 2
2 2
1 1
3 27 2 53 0
1510
1
21
1
25
2 03
1 1
1 1
21 1 130 25 1 116
21 1 25 1
1510
c h
a f
a f af
a f a f
a f a f
a f a f a f a f
a f a f
. .
.
.
. .
.
Youre a research analyst for General Motors. Assuming
equal variances, is there a difference in the average miles
per gallon (mpg) of two car models (o = .05)?
You collect the following:
Sedan Van
Number 15 11
Mean 22.00 20.27
Std Dev 4.77 3.64
Pooled Variance t Test
Thinking Challenge
Alone Group Class
Test Statistic
Solution*
t
X X
S
n n
S
n S n S
n n
P
P
=
+
F
H
G
I
K
J
=
+
F
H
I
K
= +
=
+
+
=
+
+
=
1 2 1 2
2
1 2
2
1 1
2
2 2
2
1 2
2 2
1 1
22 00 20 27 0
18 793
1
15
1
11
100
1 1
1 1
15 1 4 77 11 1 3 64
15 1 11 1
18 793
c h
a f
a f af
a f a f
a f a f
a f a f a f a f
a f a f
. .
.
.
. .
.
t
X X
S
n n
S
n S n S
n n
P
P
=
+
F
H
G
I
K
J
=
+
F
H
I
K
= +
=
+
+
=
+
+
=
1 2 1 2
2
1 2
2
1 1
2
2 2
2
1 2
2 2
1 1
22 00 20 27 0
18 793
1
15
1
11
100
1 1
1 1
15 1 4 77 11 1 3 64
15 1 11 1
18 793
c h
a f
a f af
a f a f
a f a f
a f a f a f a f
a f a f
. .
.
.
. .
.
One-Way ANOVA F-Test
2 & c-Sample Tests with
Numerical Data
2 & C-Sample
Tests
#
Samples
Median Variance Mean
C C
F Test
(2 Samples)
Kruskal-
Wallis Rank
Test
Wilcoxon
Rank Sum
Test
#
Samples
Pooled
Variance
t Test
One-Way
ANOVA
2 2
2 & C-Sample
Tests
#
Samples
Median Variance Mean
C C
F Test
(2 Samples)
Kruskal-
Wallis Rank
Test
Wilcoxon
Rank Sum
Test
#
Samples
Pooled
Variance
t Test
One-Way
ANOVA
2 2
Experiment
Investigator controls one or more independent
variables
Called treatment variables or factors
Contain two or more levels (subcategories)
Observes effect on dependent variable
Response to levels of independent variable
Experimental design: Plan used to test
hypotheses
Completely Randomized Design
Experimental units (subjects) are assigned
randomly to treatments
Subjects are assumed homogeneous
One factor or independent variable
2 or more treatment levels or classifications
Analyzed by:
One-Way ANOVA
Kruskal-Wallis rank test
Factor (Training Method)
Factor levels
(Treatments)
Level 1 Level 2 Level 3
Experimental
units
Dependent
21 hrs. 17 hrs. 31 hrs.
variable
27 hrs. 25 hrs. 28 hrs.
(Response)
29 hrs. 20 hrs. 22 hrs.
Factor (Training Method)
Factor levels
(Treatments)
Level 1 Level 2 Level 3
Experimental
units
Dependent
21 hrs. 17 hrs. 31 hrs.
variable
27 hrs. 25 hrs. 28 hrs.
(Response)
29 hrs. 20 hrs. 22 hrs.
Randomized Design Example
K K K K K K K K K
One-Way ANOVA
F-Test
Tests the equality of 2 or more (c) population
means
Variables
One nominal scaled independent variable
2 or more (c) treatment levels or classifications
One interval or ratio scaled dependent variable
Used to analyze completely randomized
experimental designs
One-Way ANOVA
F-Test Assumptions
Randomness & independence of errors
Independent random samples are drawn
Normality
Populations are normally distributed
Homogeneity of variance
Populations have equal variances
One-Way ANOVA
F-Test Hypotheses
H
0
:
1
=
2
=
3
= ... =
c
All population means are
equal
No treatment effect
H
1
: Not all
j
are equal
At least 1 population mean is
different
Treatment effect
1
=
2
= ... =
c
is wrong
X
f(X)
1
=
2
=
3
X
f(X)
1
=
2
3
Compares 2 types of variation to test equality
of means
Ratio of variances is comparison basis
If treatment variation is significantly greater
than random variation then means are not
equal
Variation measures are obtained by
partitioning total variation
One-Way ANOVA
Basic Idea
ANOVA Partitions Total
Variation
Variation due to
treatment
Variation due to
random sampling
Total variation
Sum of squares within
Sum of squares error
Within groups variation
Sum of squares among
Sum of squares between
Sum of squares model
Among groups variation
Total Variation
Group 1 Group 2 Group 3
Response, X
Group 1 Group 2 Group 3
Response, X
SST X X X X X X
n c
c
= + + +
11
2
21
2 2
e j e j e j
SST X X X X X X
n c
c
= + + +
11
2
21
2 2
e j e j e j
X
Among-Groups Variation
Group 1 Group 2 Group 3
Response, X
Group 1 Group 2 Group 3
Response, X
SSA n X X n X X n X X
c c
= + + +
1 1
2
2 2
2 2
e j e j e j
SSA n X X n X X n X X
c c
= + + +
1 1
2
2 2
2 2
e j e j e j
X
X
3
X
2
X
1
Within-Groups Variation
Group 1 Group 2 Group 3
Response, X
Group 1 Group 2 Group 3
Response, X
SSW X X X X X X
n c c
c
= + + +
11 1
2
21 1
2 2
c h c h c h
SSW X X X X X X
n c c
c
= + + +
11 1
2
21 1
2 2
c h c h c h
X
2
X
1
X
3
One-Way ANOVA
Test Statistic
Test statistic
F = MSA / MSW
MSA is Mean Square Among
MSW is Mean Square Within
Degrees of freedom
df
1
= c -1
df
2
= n - c
c = # Columns (populations, groups, or levels)
n = Total sample size
One-Way ANOVA
Summary Table
Source
of
Variation
Degrees
of
Freedom
Sum of
Squares
Mean
Square
(Variance)
F
Among
(Factor)
c - 1 SSA MSA =
SSA/(c - 1)
MSA
MSW
Within
(Error)
n - c SSW MSW =
SSW/(n - c)
Total n - 1 SST =
SSA+SSW
Source
of
Variation
Degrees
of
Freedom
Sum of
Squares
Mean
Square
(Variance)
F
Among
(Factor)
c - 1 SSA MSA =
SSA/(c - 1)
MSA
MSW
Within
(Error)
n - c SSW MSW =
SSW/(n - c)
Total n - 1 SST =
SSA+SSW
One-Way ANOVA
Critical Value
0
Reject H
0
Do Not
Reject H
0
F
0
Reject H
0
Do Not
Reject H
0
F
F
U c n c ( ; , ) o 1
F
U c n c ( ; , ) o 1
o
If means are equal,
F = MSA / MSW ~ 1.
Only reject large F!
Always One-Tail!
1984-1994 T/Maker Co.
One-Way ANOVA
F-Test Example
As production manager, you
want to see if 3 filling
machines have different mean
filling times. You assign 15
similarly trained &
experienced workers,
5 per machine, to the
machines. At the .05 level, is
there a difference in mean
filling times?
Mach1Mach2Mach3
25.40 23.40 20.00
26.31 21.80 22.20
24.10 23.50 19.75
23.74 22.75 20.60
25.10 21.60 20.40
One-Way ANOVA
F-Test Solution
H0:
1
=
2
=
3
H1: Not all equal
o = .05
df1 = 2 df2 = 12
Critical Value(s):
Test Statistic:
Decision:
Conclusion:
Reject at o = .05
There is evidence pop.
means are different
F 0 3.89
F 0 3.89
o = .05
F
MSA
MSW
= = =
23 5820
9211
25 6
.
.
.
F
MSA
MSW
= = =
23 5820
9211
25 6
.
.
.
Summary Table
Solution
Source of
Variation
Degrees of
Freedom
Sum of
Squares
Mean
Square
(Variance)
F
Among
(Machines)
3 - 1 = 2 47.1640 23.5820 25.60
Within
(Error)
15 - 3 = 12 11.0532 .9211
Total 15 - 1 = 14 58.2172
Source of
Variation
Degrees of
Freedom
Sum of
Squares
Mean
Square
(Variance)
F
Among
(Machines)
3 - 1 = 2 47.1640 23.5820 25.60
Within
(Error)
15 - 3 = 12 11.0532 .9211
Total 15 - 1 = 14 58.2172
Summary Table
Excel Output
One-Way ANOVA Thinking
Challenge
Youre a trainer for Microsoft
Corp. Is there a difference
in mean learning times of
12 people using 4 different
training methods (o =.05)?
M1 M2 M3 M4
10 11 13 18
9 16 8 23
5 9 9 25
1984-1994 T/Maker Co.
Alone Group Class
One-Way ANOVA Solution*
H0:
1
=
2
=
3
=
4
H1: Not all equal
o = .05
df1 = 3 df2 = 8
Critical Value(s):
Test Statistic:
Decision:
Conclusion:
Reject at o = .05
There is evidence pop.
means are different
F 0 4.07
F 0 4.07
o = .05
F
MSA
MSW
= = =
116
10
116 .
F
MSA
MSW
= = =
116
10
116 .
Summary Table
Solution*
Source of
Variation
Degrees of
Freedom
Sum of
Squares
Mean
Square
(Variance)
F
Among
(Methods)
4 - 1 = 3 348 116 11.6
Within
(Error)
12 - 4 = 8 80 10
Total 12 - 1 = 11 428
Source of
Variation
Degrees of
Freedom
Sum of
Squares
Mean
Square
(Variance)
F
Among
(Methods)
4 - 1 = 3 348 116 11.6
Within
(Error)
12 - 4 = 8 80 10
Total 12 - 1 = 11 428