Session 8: One-Sample Hypothesis
Tests
Statistics for Business
Dr. Le Anh Tuan
1
Contents
►Hypothesis and Hypothesis Testing
►Testing hypothesis for the population mean !
►Known population variance
►Unknown population variance
►Testing hypothesis for the population proportion
2
What is a Hypothesis?
► A hypothesis is a statement (claim, assumption) about a
population parameter.
H0 : μ = 3 H0 : X = 3
► Population mean
► The yearly mean of sales growth is μ = 5%.
► The average weight of students is μ = 60 kg.
► Population proportion
► The proportion of female students at UEH university is p =
.68
► The proportion of foreign firms is p = 25%.
3
Steps in Hypothesis testing
► Step 1: State the hypothesis to be tested.
► Step 2: Specify what level of consistency with the data will
lead to rejection of the hypothesis. This is called the
decision rule.
► Step 3: Collect data and calculate necessary statistics to
test the hypothesis.
► Step 4: Make a decision. Should the hypothesis be
rejected or not?
► Step 5: Take action based on the decision.
4
Hypothesis
► Hypotheses are a pair of mutually exclusive, collectively
exhaustive statements about some fact about a population.
► One statement or the other must be true, but they cannot
both be true.
► H0: Null Hypothesis
► It is the hypothesis to be tested.
► Always contains “=” , “≤” or “³” sign
► H1: Alternative Hypothesis
► It is a statement of what we believe is true if our
sample data cause us to reject the null hypothesis.
► Never contains the “=” , “≤” or “³” sign
► These two statements are hypotheses because the truth is
unknown.
► We cannot accept a null hypothesis, we can only fail to reject
it.
5
Define Type I error, Type II error, and power.
►Types of Error:
►Type I error: Rejecting the null hypothesis when it is
true. This occurs with probability α (level of
significance).
►Considered a serious type of error
►The significance level, α, is a probability of
rejecting the true null hypothesis.
►Typical values are .01, .05, or .10
►If we choose α = .05, we expect to commit a
Type I error about five times in 100.
►Type II error: Failure to reject the null hypothesis
when it is false. This occurs with probability β.
6
Define Type I error, Type II error, and power.
7
Define Type I error, Type II error, and power.
►If H0 is rejected, we conclude that H1 is true. If H0 is not
rejected, we conclude that H0 may be true.
8
Define Type I error, Type II error, and power.
9
Type I & II Error Relationship
►Type I and Type II errors can not happen at the same time
►Type I error can only occur if H0 is true
►Type II error can only occur if H0 is false
►β cannot be chosen in advance because it depends on α
and the sample size.
►If Type I error probability increases, then Type II error
probability decreases.
►Both small α and β is desirable, other things being equal.
►Both α and β can be reduced simultaneously only by
increasing the sample size.
10
Power of the Test
► The power of a test is the probability that a false hypothesis will
be rejected.
► Power equals 1 − β and is the complement of Type II error.
► Reducing β would correspondingly increase power
(usually accomplished by increasing the sample size).
► Larger samples lead to increased power.
11
Testing hypothesis for the population mean !
Two-tailed test: we want to test that the
population mean is different from 3
One-tailed (right) test: we want to test
that the population mean is greater
than 3
One-tailed (left) test: we want to test
that the population mean is less than 3
12
Decision Rule
►A test statistic shows how far the sample estimate is
from its expected value, in terms of its own standard
error.
►The decision rule uses the known sampling
distribution of the test statistic to establish the critical
value that divides the sampling distribution into two
regions.
►Reject H0 if the test statistic lies in the rejection
region.
13
Testing
Testing hypothesis for
hypothesis forthethe
mean μ:
population mean !
When the value of samplesize (n):
Sample size
population is normal or not normal population is normal
( n ≥ 30 ) (n< 30)
σ isknown σ is not known σ isknown σ isnot known
X -µ0 X - µ0 X -µ0 $X 0−- µ'0
Z = Z = S
Z =
s T =%
s n "= S
n n )/ + n
test statistic
14
Testing hypothesis for the population mean !
RIGHT-TAILED TEST
15
Decision Rule for Right-Tailed Test (! "#$%#)
►Consider the hypothesis:
'0: * ≤ *0 We assume that * ≤ *0 unless the
sample mean is much higher than *0
'1: * > *0
►The decision rule is:
a
Do not reject H0 Reject H0
Z 0 zα
x μ0 μ0 + z α
σ
n
Critical value x c
When the difference between the data and the hypothesis is
small relative to the standard error, we obtain a z statistic near
zero, and our decision is “fail to reject H0”.
16
Example
► A phone industry manager thinks that customer
monthly cell phone bill have increased, and average
over $52 per month.
►He collect a random sample with n = 64, "̅ = 53.1 The
company wishes to test this claim. Assume the
standard deviation of population is 10.
Solutions
Step 1:
17
Example
►Step 2: we choose significance level, ! = 5%, critical
value is %&.&( = ). *+(
Reject H0
a = .05
Do not reject H0 Reject H0
0 1.645
►Step 3: calculate the test statistic. Because
, is known. We use z-score:
x - μ0 53.1 - 52
z= = = 0.88
σ 10
n 64
18
Example
Step 4: Make a decision. Because ! < !#.#% , we do not
reject H0
' = ). ** is not greater than 1.645, do not reject H0
Reject H0
a = .05
Do not reject H0 Reject H0
0 1.645
52
Hence, there is not sufficient evidence that the mean
bill is over $52
19
P-Value Method
20
P-value
►p-value: Probability of obtaining a test statistic more
extreme ( ≤ or ≥ ) than the observed sample value
given H0 is true
►Also called observed level of significance
►Smallest value of # for which H0 can be rejected
►For an upper tail test:
21
P-value
►Decision rule: compare the p-value to significance level
!
►If p-value < !, reject the null hypothesis.
►If p-value ≥ !, do not reject the null hypothesis.
►A large p-value (near 1.00) tends to support H0, while
a small p-value (near 0.00) tends to contradict H0.
22
Example
►Cell phone bill example:
►Hypothesis H1, ! > 52
►n = 64, &̅ = 53.1
►' = 10
►The p-value represents the probability of obtaining a
sample mean of 53.1 or greater if the true population
mean is 52.
01.2304
►+ &̅ > 53.1 = + ./̅ > 56 = + ./̅ > 0.88 =
78
1 − 0.8106 = 0.1894
23
Example
P-value= .1894
Reject H0
a = .05
Do not reject H0 Reject H0
0 1.645
P-value > ! = #. #% => '( )(* +,-,.* /#
24
Testing hypothesis for the population mean !
LEFT-TAILED TEST
25
Decision Rule for Left-Tailed Test (! "#$%#)
►Consider the hypothesis:
'0: * ≥ *0 We assume that * ≥ *0 unless the
sample mean is much lower than *0
'1: * < *0
►The decision rule is:
a
Reject H0 if
z < -./ Reject H0
-za
Do not reject H0
Z
0
μ x
Critical value x c
26
Testing hypothesis for the population mean !
TWO-TAILED TEST
27
TWO-TAILED HYPOTHESIS TEST
►Consider the hypothesis:
!0: $ = $0
!1: $ ≠ $0
►Reject H0 if |(| > |(+/- |
a/2 a/2
3 x
Reject H0 Do not reject H0 Reject H0
-za/2 0 +za/2 z
Lower Upper
critical value critical value
28
Example
►Test the claim that the true mean # of computer in
classroom is equal to 3.
►Suppose a random sample of 100 classrooms has mean
value of 2.84. Population SD is 0.8.
Solutions
►Step 1: Hypothesis
H0: μ = 3 , H1: μ ≠ 3 (This is a two tailed test)
►Step 2: choose significance level
!=5% => critical value |z0.025|=1.96
► Step 3: calculate the test statistic. Because " is
known. We use z-score:
29
Example
►Step 4: Make a decision
Because |z|>|z0.025|➔ reject the H0. There is sufficient
evidence that the mean number of TVs in US homes is
not equal to 3.
a = .05/2 a = .05/2
Reject H0 Do not reject H0 Reject H0
-z = -1.96 0 +z = +1.96
Here, z = -2.0 < -1.96, so the
test statistic is in the rejection
region
30
Using p-value
►p-value = .0456
►Significance level != .05
►Since .0456 < .05, we reject the null hypothesis
31
t Test of Hypothesis for the Mean (σ Unknown)
32
t Test of Hypothesis for the Mean
(σ Unknown)
►If the population variance σ2 must be estimated from
the sample, the hypothesis testing procedure is
modified. However, the basic hypothesis testing steps
are the same.
►When the population standard deviation σ is
unknown and the population may be assumed
normal, the test statistic follows the Student’s t
distribution with n – 1 degrees of freedom.
33
t Test of Hypothesis for the Mean
(σ Unknown) - One-sided test
n Convert sample result ( x ) to a t test statistic
Hypothesis
Tests for µ
σ Known σ Unknown
Consider the test
The decision rule is:
HH00:: μ!=≤
μ0!#
x - μ0
HH11::μ!>>
μ0 !# Reject H0 if t = > t n-1, α
s
(Assume the population is normal) n
H0: ! ≥ !# )*+,
Reject H0 if ' = > −'/*1,3
H1: ! < !# -/ /
34
Example 1
►An Insurance Company reports the mean cost to
process a claim is $60. An industry comparison showed
this amount to be larger than most other insurance
companies, so the company instituted cost-cutting
measures. To evaluate the effect of the cost-cutting
measures, the Supervisor of the Claims Department
selected a random sample of 26 claims processed last
month. The sample information is n = 26 , " ! = 56.42 , S
= 10.04. At the 1% significance level is it reasonable a
claim is now less than $60?
35
Example 1
►Step 1: Hypothesis
H0: μ ≥ 60 , H1: μ < 60
►Step 2: choose significance level
%=1% => critical value t25,0.01=2.485
► Step 3: calculate the test statistic. Because & is not
known. We use t-statistics:
*̅ − ,- 56.42 − 60
'= = = −1.82
./ 0 10.04/ 26
►Step 4: Make a decision
Because t > t25,0.01➔ fail to reject the H0. Hence, We have
no sufficient evidence that the cost-cutting measures
reduced the mean cost per claim to less than $60.
36
Example 1
t-statistics=-1.82 is greater than -2.485, so fail to reject H0
a=0.01
Reject H0 Do not reject H0
-t25,0.01 0
=-2.485
μ
Critical value
37
Example 2
►An Insurance Company reports the mean cost to
process a claim is $60. An industry comparison showed
this amount to be larger than most other insurance
companies, so the company instituted cost-cutting
measures. To evaluate the effect of the cost-cutting
measures, the Supervisor of the Claims Department
selected a random sample of 26 claims processed last
month. The sample information is n = 26 , " ! = 56.42 , S
= 10.04. At the 1% significance level is it reasonable a
claim is now less than $60?
38
t Test of Hypothesis for the Mean
(σ Unknown) (two-sided test)
Or Reject H0 if |t|> tn-1,α/2
39
Example
►The average cost of a hotel room in Chicago is said to
be $168 per night. A random sample of 25 hotels
resulted in x = $172.50 and s = $15.40. Test the
hypothesis at the 5% significance level. Assume the
population distribution is normal)
Solutions
►Step 1: Hypothesis
H0: μ = 168 , H1: μ ≠ 168
►Step 2: choose significance level
!=5% => critical value t24,0.025=2.064
► Step 3: calculate the test statistic. Because " is not
known. We use t-statistic:
&̅ − () 172.50 − 168
#= = = 1.46
40
*/ , 15.4/ 25
Example
►Step 4: Make a decision
Because |t| < t24,0.025➔ fail to reject the H0. Hence, we
have not sufficient evidence that true mean cost is
different than $168
a/2=.025 a/2=.025
Reject H0 Do not reject H0 Reject H0
-t n-1,α/2 t n-1,α/2
0
-2.0639
-2.064
2.0639
2.064
1.46
41
Example
42
Example
43
Confidence Intervals versus Hypothesis Test
►A two-tailed hypothesis test at the 5% level of
significance (α = .05) is equivalent to a two-sided 95%
confidence interval for the mean.
►If the confidence interval does not include the
hypothesized mean, then we reject the null
hypothesis.
►The 95% confidence interval for the mean is given
next.
(
"̅ ± $%/2 ) or 172.50 ± 2.064* 15.4/ 25
=(166.14,178.85)
►Since μ = 168 lies within the 95 percent confidence
interval (166.14,178.85), we cannot reject the
hypothesis H0: μ = 168 at α = .05 in a two-tailed test
44
Tests of the Population Proportion
45
Tests of the Population Proportion
►Use to test a hypothesis about population proportion.
►Proportion data follow the binomial distribution, which
can be approximated by the normal distribution if:
!" ≥ 10 &!' ! 1 − " ≥ 10
Where p is the probability of a success in the
population
n=sample size.
►Sample proportion in the success category is denoted
by "̂
►The mean and standard deviation of "̂ is
"(1 − ")
*+̂ = ", .+̂ =
!
46
Tests of the Population Proportion
►The z-test statistic for a hypothesis test for the
proportion:
$̂ − $0
!=
$0(1 − $0)
*
►$̂ = the sample proportion
►$0 = the population proportion, which is assumed to
be true in the null hypothesis.
►n = sample size
47
Example
► A male student claims that he receives 8% responses
from his online survey. To test this claim, a random
sample of 500 were surveyed with 25 responses. Test
at the 5% significance level.
Solutions:
►Check: Our approximation for "̂ is = 25/500 = .05
►#" = 500 ∗ 0.08 = 40 > 10
►# 1 − " = 500 .92 = 460 > 10
►We can test hypothesis for population proportion by
the normal distribution.
48
Example
H0: p0 = .08 Test Statistic:
H1: p0 ¹ .08 pˆ - P0 .05 - .08
z= = = -2.47
P0 (1- P0 ) .08(1 - .08)
a = .05
n 500
n = 500, p̂ = .05
Critical Values: ± 1.96 Decision:
Reject Reject Reject H0 at a = .05
Conclusion:
.025 .025
There is sufficient
-1.96 0 1.96 z evidence to reject the
-2.47 company’s claim of 8%
response rate.
49
P-value
Calculate the p-value and compare to a
(For a two sided test the p-value is always two sided)
Do not reject H0
Reject H0 Reject H0 p-value = .0136:
a/2 = .025 a/2 = .025
P(Z £ -2.47) + P(Z ³ 2.47)
.0068 .0068
= 2(.0068) = 0.0136
-1.96 0 1.96
Z = -2.47 Z = 2.47
Reject H0 since p-value = .0136 < a = .05
50
Exercise
► Review Session 8, Online Quiz.
► Exercise
► Reading Chapters 12, 13. Simple and Multiple Regression
Model
51