Huypothesis Testing Final Notes 2020 - 2021
Huypothesis Testing Final Notes 2020 - 2021
Testing
1
What is Hypothesis Testing
2
Hypothesis Testing
• Identify a test statistic that can be used to assess the truth of the
null hypothesis.
If the mean difference is relatively small, then the test statistic will
have a low value. In this case, we conclude that the evidence from
the sample is not sufficient, and the decision is fail to reject the
null
hypothesis.
5
One sample hypothesis testing
6
Example: A random sample of n = 2 5 measurements of
chest
circumferences from a population of newborns having
= 0.7 inches provides a sample mean of x = 12.6 in. Is
it likely that the population mean has the value µ = 13.0 in.?
11
Hypothesis test for proportion
u Involves categorical variables
u Fraction or % of population in a category
u Sample proportion (p)
Solution
0.25 – 0.20
Ho : π = 0.20 0.20 (1- 0.20) = 2.50
Z
H1 : π 0.20
40
14
Two Sample Hypothesis Testing
15
Two Sample z-Test
-
A two-sample z-test can be used to test the difference between
two population means μ1 and μ2 when a large sample (at least
30) is randomly selected from each population
and the samples are independent. The test statistic is
and the standardized
test statistic is x1 - x 2
( x 1 - x2) - ( μ 1- σ 12+ σ 2
2 .
z= whe r e 1 2
μ 2) -x n n
=
2
When the samples are large, you can uses1 and s2 in place of σ 1
and σ 2 .
16
16
Example:
The PPH teacher claims that students who did mathemathics at
advanced levels in his class will score higher on the MPH 603
CA than students who did not do Mathematics in advance
levels. The mean CA score for 49 students who did A/L
Mathematics was 22.1 and the standard deviation is 4.8. The
mean CA score of 44 students who did not do A/L Mathematics
was 19.8 and the standard deviation is 5.4. At a = 0.10, can
the teacher’s claim be supported?
H0: μ1 < μ2
a = 0.10
H a: μ 1 > μ 2
(Claim)
z
-3 -2 -1 0 1
z0 = 1.28
17
H0: μ1 < μ2
Ha: μ1 > μ2 (Claim)
1.28 z0 =
-3 -2 -1 0 1 2 3
18
Testing the Difference Between
Means
(Small Independent
Samples)
19
Two Sample t-Test
20
Two Sample t-Test
If the population
σ variances are equal, then information
( 1s2
n1samples
- 1 2n -) 21
from theˆ two is combined to calculate a pooled
n +
1
-
estimate of the standard deviation
21
Two Sample t-Test
n n With ˆ= ( n1 ) + ( 2一 s)22
1
Variances equal
and d.f.= n1 + n2 – 2.
22
一x
= +
and d.f = smaller of n1 – 1
2
Variances not equal
or n2 – 1.
22
Example:
A random sample of 17 two bedroom houses in Buea has a mean
monthly rent of 35,800 FCFA and a standard deviation of 7,800 FCFA.
In Bamendaa random sample of 18 two bedroom
houses has a mean monthly rent of 35,100 FCFA and a standard
deviation of 7,375 FCFA. Test the claim at a = 0.01 that the mean
monthly rent in the two cities are not the same. Assume the population
variances are equal.
H0: μ1 = μ2 33
H a : μ1 μ2 (Claim)
d.f. = n1 + n2 – 2
= 17 + 18 – 2 =
23
1 1
a= 0
.005 2
2
-3 -2 -1
t
0 1 2
3
–t0 = –2.576
t0 = 2.576
23
H0: μ1 = μ2
Ha: μ1 子 μ2 (Claim) t
-3 -2 -1 0 1
–t0 = –2.576 t0 = 2.576
) .17 18
心 7584.0355(0.3382)
心 2564.92
24
H0: μ1 = μ2
Ha: μ1 子 μ2 (Claim) -3 -2 -1 0 1 2
t
–t0 = – t0 =
2
0.273
= 2564.92
Fail to reject H0.
25
Two Sample z-Test for Proportions
26
Example: A recent survey stated that male smoke less than female. In a survey
of 1245 males, 361 said they smoke at least one pack of cigarettes a day. In a
sur vey of 1065 females, 341 said they smoke at least one pack a day. At C =
0.01, ca n you support the claim that the proportion of male who smoke at
least one pac k of cigarettes a day is lower then the proportion of females who
smoke at least one pack a day?
H0: p 1 之 p 2
Ha: p1 < p2 (Claim)
z
-3 -2 -1 0 1 2 3
-z0 = -2.33
p 3 61 3 41 7 0 2
= = ~
12 45 +1065 2 3 1 0
0.304
q = 1 - p = 1 - 0.304 = 0.696
Because 1245(0.304), 1245(0.696), 1065(0.304), and 1065(0.696) are all at least
5, we can use a two-sample z-test. 27
H0: p1 > p2
Ha : p 1 < p 2
z
-3 -2 -1 0 1 2 3
-z0 = -2.33
ˆ
(0.29-0.2)-0
(- p2 )- (p1 - p 2 ) = ~ -1.56
z 1
= pq |( 1 +1 (0.304)(0.696)
1
+
)(n1 12 45
n2)|
28