Map of the Website http://www.econ.uiuc.edu/ECON173

Download Report

Transcript Map of the Website http://www.econ.uiuc.edu/ECON173

HYPOTHESIS TESTING:
ABOUT TWO INDEPENDENT
POPULATIONS
1
In this lecture, we are going to study the
procedures for making inferences about two
populations.
When comparing two populations we need two
samples. Two basic kinds of samples can be used:
independent and dependent. The dependence or
independence of a sample is determined by the
sources used for the data .
If the same set of sources is used to obtain the data
representing different situations, we have
dependent sampling. If two unrelated sets of
sources are used, one set from each population, we
have independent sampling.
2
Two Independent Populations
The Significance Test for The Difference Between
Two Population Means
Mann Whitney U Test
The Significance Test for The Difference Between
Two Population Proportions
2*2 Chi Square Tests
3
The Significance Test for
The Difference Between Two Population Means
Hypothesis testing involving the difference between
two population means is most frequently employed
to determine whether or not it is reasonable to
conclude that the two are unequal. In such cases,
one or the other of the following hypothesis may be
formulated:
(1) H0: 1=  2
Ha: 1  2
(2) H0: 1=  2
Ha: 1>  2
(3) H0: 1=  2
Ha: 1 < 2
4
The difference between two population means will
be discussed in three different contexts:
1. When sampling is from normally distributed
populations with known population variances
2. When sampling is from normally distributed
populations with unknown population variances
3. When sampling is from populations that not
normally distributed
5
Sampling from Normally Distributed Populations:
Population Variances Known
When each of two independent simple random
samples has been drawn from a normally
distributed population with a known variance, the
test statistic for testing the null hypothesis of equal
population means is
z
( x1  x 2 )  (1   2 )



n1 n2
2
1
2
2
6
Example
Researchers wish to know if the data they have
collected provide sufficient evidence to indicate a
difference in mean serum uric acid levels between
normal individuals and individuals with mongolism.
The data consist of serum uric acid readings on 12
mongoloid individuals and 15 normal individuals. The
means are 4.5 mg/100 ml and 3.4 mg/100 ml. The
data constitute two independent simple random
samples each drawn from a normally distributed
population with a variance equal to 1.
H0: 1=  2
Ha: 1  2
7
z
z
( x1  x 2 )  (1   2 )



n1 n2
2
1
(4.5  3.4)  0
1 1

12 15
2
2
1.1

 2.82
0.39
z  / 2  z 0.025  1.96
<
z  2.82
 Reject H 0
The two population means are not equal.
8
Sampling from Normally Distributed Populations:
Population Variances Unknown
When the population variances are unknown, two
possibilities exist. The two population variances
may be equal or unequal. When comparing two
populations, it is quite natural that we compare
their variances or standard deviations.
9
Testing the equality of two population variances:
S2
max
F 
S2
min
F  F(n1 -1),(n 2 -1),α Variances are not equal
F  F(n1 -1),(n 2 -1),α
Variances are equal
F Table( =0.05)
Denominator
Numerator Degrees of Freedom
Degrees of
Freedom
1
2
3
4
5
1
2
3
...
120
...
161.4
199.5
215.7
224.6
230.2
18.5
19.0
19.16
19.25
19.30
10.13
9.55
9.28
9.12
9.01
...
...
...
...
...
3.92
3.07
2.68
2.45
2.29
...
...
...
...
...

3.84
3.00
2.60
2.37
2.21
... 120 ...
... 253.3 ...
... 19.49 ...
... 8.55 ...
... ... ...
... 1.35 ...
... ... ...
... 1.22 ...

254.3
19.50
8.53
...
1.25
...
10
1.00
Population Variances Equal: When the population
variances are unknown,
(n1  1) s  (n2  1) s
s 
n1  n2  2
2
1
2
p
t
2
2
( x1  x 2 )  (1   2 )
s
2
p
n1

s
2
p
n2
11
Example A research team collected serum amylase
data from a sample of healthy subjects and from a
sample of hospitalized subjects. The data consist of
serum amylase determination on 22 hospitalized
subjects and 15 healthy subjects with mean 120 and
96 units/ml and standard deviation 40 and 35
units/ml, respectively. The data constitute two
independent random samples, each drawn from a
normally distributed population. The population
variances are unknown. They wish to know if they
would be justified in concluding that the population
means are different.
S 2max
1600
F 2

 1.31 F(14,21,0.05)  2.20
1225
S min
Variances are equal
12
H0: 1-  2 =0
Ha: 1-  2 0
x1  120 units/ml s1  40 units/m
x2  96 units/ml s 2  35 units/m
(n1  1) s  (n2  1) s
s 
n1  n2  2
2
1
2
p

t
2
2
(22  1)40 2  (15  1)35 2
15  22  2
( x1  x 2 )  (1   2 )
s
2
p
n1

s
2
p
n2

 1450
(120  96)  0
1450 1450

15
22
 1.88
13
tcalculated=1.88
t ( n1  n2 2, /2)  t (35, 0.025)  2.0301
Since ttable>tcalculated, accept H0.
The mean of serum amylase level of hospitalized
subjects are not different from the mean of serum
amylase levels of healthy subjects
14
Population Variances Unequal: When two
independent simple random samples have been
drawn from normally distributed populations with
unknown and unequal variances the test statistic for
testing H0: 1=  2 is
t
( x1  x 2 )  (1   2 )
2
1
2
2
s
s

n1 n2
The critical value of t for  level of significance and
a two-sided test is approximately
t / 2
w1t1  w2 t 2

where w 1  s12 /n 1 , w 2  s 22 /n 2
w1  w2
, t 1  t (n1 -1,/2) , t 2  t (n 2 -1,15/2)
Researchers wish to know if two populations differ with
respect to the mean value of total complement activity
(CH50). The data consist of total serum complement
activity determinations of 20 apparently normal
subjects and 10 subjects with disease. The sample
means and standard deviations are 62.6 and 33.8 for
normal subjects and 47.2 and 10.1 for subjects with
disease.
16
H0: 1-  2 =0
Ha: 1-  2 0
x1  62.6 s1  33.8
x2  47.2 s 2  10.1
w1=33.82/10=114.244 and w2=(10.1)2/10=114.244
t1=2.2622 and t2=2.0930
t / 2
t
114.244(2.2622)  5.1005(2.0930)

 2.255
114.244  5.1005
(62.6  47.2)  0
33.8
10
2
2

10.1
20
 1.41
-2.255<1.41<2.255
Accept H0.
17
MANN-WHITNEY U TEST
The sign test discussed in the preceding lecture does not
make full use of all the information present in the two
samples when the variable of interest is measured on at
least an ordinal scale. By reducing an observation’s
information content to merely that of whether or not it fails
above or below the common median is waste of information.
If, for testing the desired hypothesis, there is available a
procedure that makes use of more of the information
inherent in the data, that procedure should be used if
possible.
18
Such a nonparametric procedure that can be used instead of
the sign test is Mann Whitney U Test. Mann Whitney U Test
is a nonparametric alternative for the significance test for
difference between two independent population means.
Since the test is based on the ranks of the observations it
utilizes more information than does the sign test.
19
The assumptions underlying the Mann-Whitney U Test are
as follows:
1. The two samples, of size n and m, respectively, available
for analysis have been independently and randomly
drawn from their respective populations.
2. The measurement scale is at least ordinal.
3. If the populations differ at all, they differ only with respect
to their medians.
20
If the sample size is smaller than 20
The calculation of the test statistic U is a two-step
procedure. We first determine the sum of the ranks for
the first sample. Then using this sum of ranks, we
calculate a U score for each sample. The larger U score
is the test statistic. The critical U value gets from the U
table.
n1 (n1  1)
U1  n1n2 
 R1
2
U 2  n1n2  U1
21
If the sample sizes are greater than 20, we can
use the standard normal, z approximation. This is possible
since the distribution of U is approximately normal with a
mean
n1n2/2
and a standard deviation
n1n2 (n1  n2  1)
12
z
n1n2
U
2
n1n2 (n1  n2  1)
12
22
Example A researcher designed an experiment to
assess the effects of prolonged inhalation of cadmium
oxide. Fifteen laboratory animals served as
experimental subjects, while 10 similar animals served
as controls. The variable of interest was hemoglobin
level following the experiment. The results are shown in
the table. We wish to know if we can conclude that
prolonged inhalation if cadmium oxide reduces
hemoglobin level.
23
Exposed
animals
Rank Unexposed Rank
animals
H0 : M x  M y
14,4
7
17,4
24
14,2
6
16,2
17
13,8
2
17,1
23
16,5
19
17,5
25
Since n1 and n2 <20
14,1
4,5
15,0
8,5
16,6
16
16,0
15
15,9
14
16,9
22
15,6
12
15,0
8,5
14,1
4,5
16,3
18
15,3
10,5
16,8
21
15(15  1)
U 1  15  10 
 145
2
 125
U 2  n1 n2  U 1  150  125
15,7
13
16,7
20
13,7
1
15,3
10,5
14,0
3
Ha : M x  M y
 25
From the table, critical value is 45
125 >45 Reject H0
24
The Difference Between Two Population
Proportions
The most frequent test employed relative to the difference
between two population proportions is that their difference
is zero. It is possible, however, to test that the difference
is equal to some other value.
(p1  p 2 )  (P1  P2 )
z
σ p1 p2
σ p1 p2
p(1  p) p(1  p)


n1
n2
n 1 p1  n 2 p 2
p
n1  n 2
25
In a study designed to compare a new treatment for
migraine headache with the standard treatment, 78 of
100 subjects who received the standard treatment
responded favorably. Of the 100 subjects who received
the new treatment 90 responded favorably. Do these
data provide sufficient evidence to indicate that the new
treatment is more effective than the standard?
78  90
p
 0.84
100  100
H a : P2  P1  0 p 2  90 / 100  0.90
(0.90 - 0.78)  0
z
 2.32 > Z(0.05)=1.645
(0.84)(0.16) (0.84)(0.16)

100
100
H 0 : P2  P1  0
p1  78 / 100  0.78
The new treatment is more effective than the standard.
26
2x2 Chi Square Test
We can use the chi-square test to compare
frequencies or proportions in two or more groups. The
classification according to two criteria, of a set of
entities, can be shown by a table in which the r rows
represents the various levels of of one criterion of
classification and c columns represent the various
levels of the second criterion. Such a table is
generally called a contingency table.
We will be interested in testing the null hypothesis that
in the population the two criteria of classification are
independent or associated.
27
Second
Criteria
1
+
O11
2
Total
2
2
χ  
2
First criteria
i 1 j1
O12
O1.
O21
O22
O2.
O.1
O.2
N
(O ij  E ij ) 2
E ij
-
Total
E ij 
O i.O .j
N
Eij should be greater than or equal to 5.
df = (r-1)(c-1)=1
28
Family
History
Squint
Total
+
+
20
-
15
14.58
20.42
Total
35
30
35.42
55
49.58
85
50
70
120
Is squint more common among children with a positive family history?
Is there an association between squint and family history of squint?
χ
2
 4.869
2(1,0.025)=5.024 > 4.869. Accept H0.
There is no relation between squint and family history
29
If any expected frequencies are less than 5, then
alternative procedure to called Fisher’s Exact Test
should be performed.
Second
Criteria
1
2
Total
First criteria
+
O11
O12
Total
O1.
O21
O22
O2.
O.1
O.2
N
Let O21=a, P(O21<a) should be calculated.
If P(f21<a) <  ,then H1 is accepted.
30
Family
History
Squint
+
Total
-
Family
History
Squint
+
-
Total
+
5
6
11
+
6
5
11
-
1
10
11
-
0
11
11
Total
6
16
22
Total
6
16
22
P1 
6! 16! 11! 11!
 0.068
5! 6! 1! 10! 22!
P1 
6! 16! 11! 11!
 0.006
5! 6! 0! 11! 22!
P(O211)=0.068+0.006=0.074
31