-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
1/27
Hypothesis Testing and
Comparison of Two Populations
Dr. Burton
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
2/27
If the heights of male teenagers are normally distributed with a mean of 60
inches and standard deviation of 10, And the sample size was 25, what
percentage of boys heights in inches would be:
Between 57 and 63
Lass than 58
61 or larger
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
3/27
7.2a
60
0
Height
Z57 63
%
Z=x -s / n
57 - 60
10 / 25
63 - 60
10 / 25
Z= -1.5 = .4332
Z= 1.5 = .4332
.8664 = 86.8%
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
4/27
7.2b
60
0Height
Z
58
-1.0
%
Z= x -s / n
58 - 6010 / 25
Z = -1.0 = .5000 - .3413
.1587 = 16%
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
5/27
7.2c
60
0 0.5Height
Z
61
%
Z= x -s / n
61 - 6010 / 25
Z = 0.50
- .1915 = .3085 = 30.9%= 0.50
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
6/27
Hypothesis Testing
Hypothesis: A statement of belief
Null Hypothesis, H0: there is no differencebetween the population mean and the
hypothesized value 0.Alternative Hypothesis, H
a: reject the null
hypothesis and accept that there is a
difference between the population mean and the hypothesized value 0.
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
7/27
Probabilities of Type I and Type II
errorsH0 True H0 False
Accept H0
Reject H0Type IError
Type II
ErrorCorrect
results
Correct
results
Truth
Test
result
1 -
1 -
H0 True = statistically insignificant
H0 False = statistically significant
Accept H0 = statistically insignificant
Reject H0 = statistically significant
Differences
a b
c d
http://en.wikipedia.org/wiki/False_positive
http://en.wikipedia.org/wiki/False_positivehttp://en.wikipedia.org/wiki/False_positive -
7/30/2019 Hypothesis Testing and Comparison of Two Populations
8/27
-3 -2 -1 0 1 2 3
SE
Probability Distribution
for a two-tailed test
SE
Magnitude of (XE XC)
1.96 SE
XE < XC XE > XC
= 0.05
0.0250.025
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
9/27
-3 -2 -1 0 1 2 3
SE
Probability Distribution
for a one-tailed test
SE
Magnitude of (XE XC)
1.645 SE
XE < XC XE > XC
= 0.05
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
10/27
Box 10 - 5
t =
A
Distance between the means
Variation around the means
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
11/27
Box 10 - 5
t =
A
B
Distance between the means
Variation around the means
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
12/27
Box 10 - 5
t =
A
B
C
Distance between the means
Variation around the means
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
13/27
t-Tests
Students t -test is used if:
two samples come from two different
groups.
e.g. A group of students and a group of
professors
Paired t -test is used if:
two samples from the sample group.
e.g. a pre and post test on the same
group of subjects.
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
14/27
One-Tailed vs. Two Tailed
Tests The Key Question: Am I interested in the
deviation from the mean of the sample from the
mean of the population in one or both
directions. If you want to determine whether one mean is
significantly from the other, perform a two-tailed
test.
If you want to determine whether one mean is
significantly larger, or significantly smaller,
perform a one-tailed test.
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
15/27
t-Test(Two Tailed)
Independent Sample means
xA - xB - 0
t =
Sp [ ( 1/NA ) + ( 1/NB) ]
d f = NA + NB - 2
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
16/27
Independent Sample Means
Sample A (A Mean)2
26 34.3424 14.90
18 4.58
17 9.86
18 4.58
20 .02
18 4.58Mean = 20.14
A2 = 2913
N = 7
(A Mean)2 = 72.86
Var = 12.14
s = 3.48
Sample B (B Mean)2
38 113.8526 1.77
24 11.09
24 11.09
30 7.13
22 28.41
Mean = 27.33
B2 = 4656
N = 6
(B Mean)2 = 173.34
Var = 34.67
s = 5.89
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
17/27
Standard error of the difference
between the means (SED)
SED ofE - C =
s A2Estimate of the s B
2
NA NB+
SED ofxE - xC =
A 2 B 2NA NB
+ Population
Sample
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
18/27
Pooled estimate of the SED
(SEDp)
1Estimate of the 1
NA NB+SEDp ofxA - xB = Sp
s2(nA-1) + s2 (nB1)Sp =
nA + n B - 2
12.14 (6) + 34.67(5)Sp =
7 + 6 - 2
= 22.38 = 4.73
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
19/27
t-Test
(Two Tailed)
d f = NE
+ NC
- 2 = 11
xA - xB - 0
t =
Sp [ ( 1/NA ) + ( 1/NB) ]
20.14- 27.33 - 0=
4.73 ( 1/7 ) + ( 1/6)
= -2.73
Critical Value95%
= 2.201
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
20/27
One-tailed and two-tailed t-tests
A two-tailed test is generally
recommended because differences in
either direction need to be known.
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
21/27
Pairedt-test
t paired = t p =d - 0
Standard error of d
= -------------d - 0
S d2
N
df= N - 1
d = D/N
d2 = D2( D)2/ N
S d2
= d2
/ N - 1
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
22/27
Pre/post attitude assessment
Student Before After Difference D squared
1 25 28 3 9
2 23 19 -4 16
3 30 34 4 16
4 7 10 3 95 3 6 3 9
6 22 26 4 16
7 12 13 1 1
8 30 47 17 289
9 5 16 11 121
10 14 9 -5 25
Total 171 208 D = 37 D2 = 511
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
23/27
Pre/post attitude
assessmentStudent Before After Difference D squared
Total 171 208 37 511
t paired = t p =d - 0
Standard error of d
= -------------d - 0
S d2
N
d = D/N
N = 10
d2= D2( D)2/ N
S d2 = d2/ N - 1
= 37/10 = 3.7
= 511 - 1369/10 = 374.1
= 374.1 / 101 = 41.5667
= 3.7 / 2.0387
= 1.815
= 3.7 / 41.5667 / 10
= 3.7 / 4. 15667
df= N1 = 9
0.05 > 1.833
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
24/27
Probabilities of Type I and Type II errors
H0 True H0 False
Accept H0
Reject H0Type IError
Type II
ErrorCorrect
results
Correctresults
Truth
Test
result
1 -
1 -
H0 True = statistically insignificant
H0 False = statistically significant
Accept H0 = statistically insignificant
Reject H0 = statistically significant
Differences
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
25/27
Standard 2 X 2 table
a = subjects with both the risk factor and the disease
b = subjects with the risk factor but not the disease
c = subjects with the disease but not the risk factor
d = subjects with neither the risk factor nor the diseasea + b = all subjects with the risk factor
c + d = all subjects without the risk factor
a + c = all subjects with the disease
b + d = all subjects without the disease
a + b + c + d = all study subjects
Present Absent
Present
Absent
Disease status
Risk
Factor
Status
a b
c d
a + b
c + d
a + c b + d a+b+c+dTotal
Total
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
26/27
Standard 2 X 2 table
Sensitivity = a/a+c
Specificity = d/b+d
Present Absent
Present
Absent
Disease status
Risk
Factor
Status
a b
c d
a + b
c + d
a + c b + d a+b+c+dTotal
Total
-
7/30/2019 Hypothesis Testing and Comparison of Two Populations
27/27
Diabetic Screening Program
Sensitivity = a/a+c = 100 X 5/6 = 83.3% (16.7% false neg.)
Specificity = d/b+d = 100 X 81/94 = 86.2%(13.8% false pos.)
Diabetic Nondiabetic
>125mg/100ml