Lecture_04
Lecture_04
Testing a Mean:
Testing a Proportion
Testing a Variance
Principles of Hypothesis Testing
What is a Hypothesis?
A hypothesis is a claim
X
20 μ = 50
If it is unlikely that
If H0 is true ... then we
reject the null
we would get a
... if in fact this were hypothesis that
sample mean of
the population mean… μ = 50.
this value ...
As a result, if the sample mean is
Region of Region of
Rejection Rejection
Region of
Non-Rejection
Critical Values
Type I Error
Reject a true null hypothesis
H0: μ ≥ 3
H1: μ < 3
Left-tailed test 0
Procedure for Testing a Hypothesis
Step 3. Find
State the null Calculate a the test
hypothesis Collect data
test statistic statistic
Hypothesis
Tests for
Known Unknown
(Z test) (t test)
σKnown
Known σUnknown
Unknown
(Z test) (t test)
The test statistic is:
X μ
Z =
σ
n
X μ 2.84 3 .16
Z = = = = 2.0
σ 0.8 .08
n 100
Is the test statistic in the rejection region?
0.0228 0.0228
p-value
= 0.0228 + 0.0228 = 0.0456
-1.96 0 1.96 Z
-2.0
Conclusion: Reject the null hypothesis. 2.0
Strength of p -Values
μ X
Critical value
Right-Tailed Tests
H0: μ ≤ 3
There is only one
critical value, since H1: μ > 3
the rejection area is
in only one tail
Critical value
Example: Upper-Tail Z Test for Mean ( Known)
Testing Hypotheses
= 0.10
Xμ 53.1 52
Z = = = 0.88
σ 10
n 64
Example: Decision Making using Decision Rule
Reject H0
= 0.10
Reject H0 P( X 53.1)
= 0.10
53.1 52.0
= P Z
0 10/ 64
= P(Z 0.88) = 1 0.8106
Do not reject H0 Reject H0
1.28
Z = 0.88
= 0.1894
Exercise. In an attempt to determine why customer
service is important to managers in the UK,
researchers surveyed managing directors of
manufacturing plants in Scotland. One of the
reasons proposed was that customer service is a
means of retaining customers. On a scale from 1 to
5, with 1 being low and 5 being high, the survey
respondents rated this reason more highly than any
of the others, with a mean of 4.30.
Exercise. [cont’d] Suppose researchers believe
New Zealand manufacturers would not rate this
reason as highly. Use the following data from NZ
and conduct a hypothesis test at 5% level of
significance to prove their theory. Assume from
previous studies that the population standard
deviation is 0.574.
3 4 5 5 4 5 5 4
4 4 4 4 4 4 4 5
4 4 4 5 4 4 4 3
5 4 4 5 4 4 4 5
t-Test of Hypothesis for the Mean (σ Unknown)
Hypothesis
Tests for
σKnown
Known σUnknown
Unknown
(Z test) (t test)
The test statistic is:
X μ
t n-1 =
S
n
Example: Two-Tail Test ( Unknown)
H0: μ = 168
H1: μ 168
Example Solution: Two-Tail Test
H0: μ = 168
/2=.025 /2=.025
H1: μ 168
22.6 22.2 23.2 24.7 24.5 27.0 26.6 28.1 26.9 24.9
26.2 25.3 23.1 24.2 26.1 25.8 30.4 28.6 23.5 23.6
Do not reject H0
Reject H0 Reject H0 p-value = 0.0136:
/2 = .025 /2 = .025
P(Z 2.47) P(Z 2.47)
0.0068 0.0068
= 2(0.0068) = 0.0136
-1.96 0 1.96
Z = -2.47 Z = 2.47
𝑋ത1
𝜇1 𝑋ത2
𝜇2
Two-Sample Tests
Two-Sample Tests
Population Population
Means, Means, Population Population
Independent Related Proportions Variances
Samples Samples
Comparing Two Means
Comparing Two Means
Independent samples
Difference Between Two Means & Independent Samples
Test hypothesis or form a confidence interval for the
difference between two population means, μ1 – μ2
where the point estimate for the difference is 𝑋1 − 𝑋2
a a a/2
Hypothesis Tests for µ1 - µ2 with σ1 and σ2 known
σ1 and σ2 unknown,
not assumed equal
Hypothesis tests for µ1 - µ2 with σ1 and σ2 known
The test statistic:
ZSTAT
X X μ μ
1 2 1 2
12 22
n1 n2
X X Z
1 2 a/2
12 22
n1 n2
Hypothesis tests for µ1 - µ2 with σ1 and σ2 unknown assumed equal
σ1 and σ2 unknown,
not assumed equal
Hypothesis tests for µ1 - µ2 with σ1 and σ2 unknown and assumed equal
The pooled variance
S 2
n1 1 S1 n 2 1 S2
2 2
(n1 1) (n 2 1)
p
1 1
d.f. = (n1 + n2 – 2) S
2
p
n1 n 2
The confidence interval
Number 21 25
t STAT
X X μ
1 2 1 μ2
3.27 2.53 0 2.040
1 1 1 1
S
2
1.5021
p
n1 n 2 21 25
n
S2 1
1S1
2
n 2 1S 2
2
21 1 1.30 2
25 1 1.16 2
1.5021
(n1 1) (n 2 1) (21 - 1) (25 1)
P
Pooled-Variance t Test Example: Hypothesis Test Solution
Reject H0 Reject H0
a = 0.05
df = 21 + 25 - 2 = 44 .025 .025
3.27 2.53
t STAT 2.040
1 1
1.5021
21 25
Conclusion: Reject H0 at a = 0.05. There is evidence of a difference in means.
Pooled-Variance t Test Example: Confidence Interval for µ1 - µ2
Since we rejected H0 can we be 95% confident that
µNYSE > µNASDAQ?
X X t
1 2 a/2 p
1 1
S 0.74 2.0154 0.3628 (0.009, 1.471)
2
n1 n 2
Population means,
Assumptions
independent Samples are randomly and
samples independently drawn.
Populations are normally
σ1 and σ2 known
distributed or both sample
2
S1 2 S 2 2
X X 2 μ1 μ 2
n n
1
2
2
t STAT
2 2
tSTAT has 1
2
S S S1 2 S22
1
2
d.f. ν:
n
n
n1 n 2 1 2
n1 1 n2 1
Welch’s rule:
df = min(n1 – 1, n2 – 1)
X 1
X 2 ta
2
S12 S22
n1 n 2
Example 1. In trials of an experimental Internet-based
method of learning statistics, pre-tests and post-tests were
given to two groups: traditional instruction (22 students)
and Internet-based (17 students). Pre-test scores were not
significantly different. On the post-test, the first group
(traditional instruction) had a mean score of 8.64 with a
standard deviation of 1.88, while the second group
(experimental instruction) had a mean score of 8.82 with a
standard deviation of 1.70.
Construct a 90 percent confidence interval for the true
difference of the means assuming equal variances.
Example 2. In trials of an experimental Internet-based method
of learning statistics, pre-tests and post-tests were given to two
groups: traditional instruction (22 students) and Internet-based
(17 students). Pre-test scores were not significantly different.
On the post-test, the first group (traditional instruction) had a
mean score of 8.64 with a standard deviation of 1.88, while the
second group (experimental instruction) had a mean score of
8.82 with a standard deviation of 1.70. Construct a 90 percent
confidence interval for the true difference of the means
assuming unequal variances with either Welch’s formula for d.f.
or the quick rule for degrees of freedom.
Comparing Two Means
Paired samples
Difference Between Two Means & Paired Samples
The average score of subjects on the posttest is different
than the average of those same subjects on the pretest.
Di = X1i - X2i
Assumptions:
Both Populations Are Normally Distributed
SD i 1
paired sample n 1
D μD
The test statistic for μD where t STAT
SD
tSTAT has n - 1 d.f. n
Paired Difference Test: Possible Hypotheses & CI
Lower-tail test Upper-tail test Two-tail test
a a a/2 a/2
SD
The confidence interval for μD is D ta / 2
n
Paired Difference Test: Example
Assume you send your salespeople to a “customer
service” training workshop. Has the training made a
difference in the number of complaints? You collect
the following data:
Di
Salesperson Number of complaints Difference
Before After D = n
A 6 4 -2
B 20 6 -14 = -4.2
(D D)
C 3 2 -1 2
D 0 0 0 SD i
F 4 0 -4
n 1
-21 5.67
Has the training made a difference in the
number of complaints (at the 0.01 level)?
H0: μD = 0
H1: μD 0 Reject Reject
a/2 a/2
a = .01 D = - 4.2 - 4.604 4.604
- 1.66
t0.005 = ± 4.604
d.f. = n - 1 = 4
Conclusion: Do not reject 𝐻0 . There
is insufficient evidence there is
D μ D 4.2 0
t STAT 1.66 significant change in the number of
SD / n 5.67/ 5
complaints.
Example. At 𝛼 = 0.05, does the following sample show
that daughters are taller than their mothers? Is the
decision close? Why might daughters tend to be taller
than their mothers? Why might they not?
a a a/2 a/2
Z STAT
p1 p2 π1 π2
The test statistic
1 1
p (1 p )
n1 n2
X1 X 2 X1 X2
p , p1 , p2
n1 n2 n1 n2
Hypothesis Test Example: Two population Proportions
Is there a significant difference between the
proportion of men and the proportion of
women who will vote Yes on Proposition A?
X 1 X 2 36 35 71
p 0 .582
n1 n2 72 50 122
Reject H0
z STAT
p1 p2 π1 π2
Reject H0
1 1 .025
p ( 1 p)
n1 n2 .025
.50 .70 0 2 .20
1 1
.582 ( 1 .582 ) -1.96 1.96
72 50 -2.20
(p1 p 2 ) ( 1 2 )
Z STAT
p1 (1 p1 ) p 2 (1 p 2 )
n1 n2
p1 (1 p1 ) p 2 (1 p 2 )
p1 p 2 Za/2
n1 n2
Example. The American Bankers Association
reported that, in a sample of 120 consumer
purchases in France, 60 were made with cash,
compared with 26 in a sample of 50 consumer
purchases in the United States.
Construct a 90 percent confidence interval for
the difference in proportions.
Comparing Two Variances
Comparing Two Variances
𝜎12
whether two variances are different by considering 𝐹 =
𝜎22
𝑠12
𝐹𝑆𝑇𝐴𝑇 = with degrees of freedom for the top:𝑑𝑓1 = 𝑛1 − 1
𝑠22
Number 21 25
analyst for a brokerage
Sample mean 3.27 2.53
firm. Is there a Sample SD 1.3 1.16
difference in the
variances between the
NYSE & NASDAQ at
the a = 0.05 level?
Solution.
Form the hypothesis test:
Numerator d.f. = n1 – 1 = 21 –1 = 20
Denominator d.f. = n2 – 1 = 25 –1 = 24