Document

Hypothesis Testing: OneSample Inference
Fangrong Yan
Outline






Introduction
One-sample test for the mean of a Normal
Distribution
The Power of a Test
The relationship between hypothesis testing
One-sample test for the variance
One-sample inference for the Binomial distribution
Introduction Hypothesis Tests
A hypothesis test is a process that uses sample statistics to
test a claim about the value of a population parameter.
If a manufacturer of rechargeable batteries claims that the batteries
they produce are good for an average of at least 1,000 charges, a
sample would be taken to test this claim.
A verbal statement, or claim, about a population parameter
is called a statistical hypothesis.
To test the average of 1000 hours, a pair of hypotheses are stated – one
that represents the claim and the other, its complement. When one of
these hypotheses is false, the other must be true.
Stating a Hypothesis
“H subzero” or “H naught”
A null hypothesis H0 is a statistical hypothesis that
contains a statement of equality such as , =, or .
“H sub-a”
A alternative hypothesis Ha is the complement of the null
hypothesis. It is a statement that must be true if H0 is false
and contains a statement of inequality such as >, , or <.
To write the null and alternative hypotheses, translate the
claim made about the population parameter from a verbal
statement to a mathematical statement.
Stating a Hypothesis
Example:
Write the claim as a mathematical sentence. State the null
and alternative hypotheses and identify which represents
the claim.
A manufacturer claims that its rechargeable batteries
have an average life of at least 1,000 charges.
  1000
H0:   1000 (Claim)
Ha:  < 1000
Complement of the
null hypothesis
Condition of
equality
Stating a Hypothesis
Example:
Write the claim as a mathematical sentence. State the null
and alternative hypotheses and identify which represents
the claim.
Statesville college claims that 94% of their graduates
find employment within six months of graduation.
p = 0.94
H0: p = 0.94 (Claim)
Ha: p  0.94
Complement of the
null hypothesis
Condition of
equality
Types of Errors
No matter which hypothesis represents the claim, always
begin the hypothesis test assuming that the null
hypothesis is true.
At the end of the test, one of two decisions will be made:
1. reject the null hypothesis, or
2. fail to reject the null hypothesis.
A type I error occurs if the null hypothesis is rejected
when it is true.
A type II error occurs if the null hypothesis is not rejected
when it is false.
Types of Errors
Actual Truth of H0
Decision
H0 is true
H0 is false
Do not reject H0 Correct Decision
Type II Error
Reject H0
Correct Decision
Type I Error
Types of Errors
Example:
Statesville college claims that 94% of their graduates find
employment within six months of graduation. What will a
type I or type II error be?
H0: p = 0.94 (Claim)
Ha: p  0.94
A type I error is rejecting the null when it is true.
The population proportion is actually 0.94, but is rejected.
(We believe it is not 0.94.)
A type II error is failing to reject the null when it is false.
The population proportion is not 0.94, but is not rejected. (We
believe it is 0.94.)
Level of Significance
In a hypothesis test, the level of significance is your
maximum allowable probability of making a type I error.
It is denoted by , the lowercase Greek letter alpha.
Hypothesis tests
are based on .
The probability of making a type II error is denoted by ,
the lowercase Greek letter beta.
By setting the level of significance at a small value,
you are saying that you want the probability of
rejecting a true null hypothesis to be small.
Commonly used levels of significance:
 = 0.10
 = 0.05
 = 0.01
The Power of a Test Procedure



Power = The probability it will correctly reject a false
hypothesis.
A type II error occurs when you fail to reject a false
hypothesis.

β = probability of a type II error. (Standard notation in statistics – yes,
it does conflict with the standard notation for regression coefficients.)

Power = 1 – β=Pr(rejecting H0|H1 true)
Power depends on what the true value is (remember, the
null is false, so something else is true).
A Normal Population With Known
Null hypothesis:
Test statistic value:
H 0 :   0
z
x  0
/ n
Compare to Critical Z Value(s)
If Z test Statistic falls in Critical Region, Reject H0; Otherwise Do
Not Reject H0

A Normal Population With Known 
Alternative
Hypothesis
H a :   0
H a :   0
H a :   0
Rejection Region
for Level  Test
z  z
z   z
z  z / 2 or z   z / 2
One-Tail Z Test for Mean (
Known)

Assumptions
 Population Is Normally Distributed
 If Not Normal, use large samples
 Null Hypothesis Has =, , or Sign Only

Z Test Statistic:
z
x  x
x

x 

n
Rejection Region
H0: 
H1:  < 0
H0: 0
H1:  > 0
Reject H0
Reject H 0


0
Must Be Significantly
Below = 0
Z
0
Z
Small values don’t contradict H0
Don’t Reject H0!
p Value Test

Probability of Obtaining a Test Statistic More Extreme  or
) than Actual Sample Value Given H0 Is True

Called Observed Level of Significance
 Smallest Value of a H0 Can Be Rejected

Used to Make Rejection Decision
 If p value  Do Not Reject H0
 If p value < , Reject H0
Recommended Steps in HypothesisTesting Analysis
1. Identify the parameter of interest and describe it in the
context of the problem situation.
2. Determine the null value and state the null hypothesis.
3. State the alternative hypothesis.
Hypothesis-Testing Analysis
4. Give the formula for the computed value of the test
statistic.
5. State the rejection region for the selected significance
level
6. Compute any necessary sample quantities, substitute
into the formula for the test statistic value, and compute
that value.
Hypothesis-Testing Analysis
7. Decide whether H0 should be rejected and state this
conclusion in the problem context.
The formulation of hypotheses (steps 2 and 3) should be
done before examining the data.
Example Solution: One Tail
H0: 368
H1:  > 368



Test Statistic:
= 0.025
n = 25
Critical Value: 1.645
Reject
.05
0 1.645 Z
Z 
X 

 1.50
n
Decision:
Do Not Reject Ho at  = .05
Conclusion:
No Evidence True Mean
Is More than 368
p Value Solution
p Value is P(Z 1.50) = 0.0668
Use the
alternative
hypothesis
to find the
direction of
the test.
p Value
.0668
1.0000
- .9332
.0668
.9332
0 1.50
From Z Table:
Lookup 1.50
Z
Z Value of Sample
Statistic
p Value Solution
(p Value = 0.0668)  ( = 0.05).
Do Not Reject.
p Value = 0.0668
Reject
= 0.05
0
1.50
Z
Test Statistic Is In the Do Not Reject Region
Example Solution: Two Tail
H0: 386
H1:  386



Test Statistic:
X   372.5  368
Z

 1.50

15
n
25
= 0.05
n = 25
Critical Value:
±1.96
Reject
.025
.025
-1.96
0 1.96
Z
Decision:
Do Not Reject Ho at  = .05
Conclusion:
No Evidence that True
Mean Is Not 368
Two tail hypotheses tests = Confidence
Intervals
_
For X = 372.5oz,  = 15 and n = 25,
The 95% Confidence Interval is:
372.5 - (1.96) 15/ 25 to 372.5 + (1.96) 15/ 25
or
366.62    378.38
If this interval contains the Hypothesized mean (368), we
do not reject the null hypothesis. It does. Do not reject Ho.
t-Test: Unknown

Assumptions
Population is normally distributed
 If not normal, only slightly skewed & a large
sample taken


Parametric test procedure

t test statistic
X 
t
S
n
The One-Sample t Test
Alternative
Hypothesis
Rejection Region
for Level  Test
H a :   0
t  t ,n 1
H a :   0
t  t ,n 1
H a :   0
t  t / 2, n 1 or t  t / 2,n 1
Example Solution: One Tail
H0: 368
H1:  368



Test Statistic:
= 0.01
n = 36, df = 35
Critical Value:
2.4377
Reject
.01
0 2.4377 Z
t 
X  
372 . 5  368

 1 . 80
S
15
n
36
Decision:
Do Not Reject Ho at  = .01
Conclusion:
No Evidence that True
Mean Is More than 368
The Chi-Square Test
The χ2-test for a variance or standard deviation is a
statistical test for a population variance or standard
deviation. The χ2-test can be used when the population is
normal.
The test statistic is s2 and the standardized test statistic
2
χ 
(n  1)s 2
σ2
follows a chi-square distribution with degrees of freedom
d.f. = n – 1.
The Chi-Square Test
Using the χ2-Test for a Variance or Standard Deviation
In Words
In Symbols
1. State the claim mathematically
and verbally. Identify the null
and alternative hypotheses.
State H0 and Ha.
2. Specify the level of significance.
Identify .
3. Determine the degrees of freedom
and sketch the sampling
distribution.
d.f. = n – 1
4. Determine any critical values.
Use Table 6 in
Appendix B.
Continued.
The Chi-Square Test
Using the χ2-Test for a Variance or Standard Deviation
In Words
In Symbols
5. Determine any rejection regions.
6. Find the standardized test
statistic.
7. Make a decision to reject or fail to
reject the null hypothesis.
8. Interpret the decision in the
context of the original claim.
2
χ 
(n  1)s 2
σ2
If χ2 is in the
rejection region,
reject H0. Otherwise,
fail to reject H0.
Critical Values for the χ2-Test
Finding Critical Values for the χ2-Distribution
1. Specify the level of significance .
2. Determine the degrees of freedom d.f. = n – 1.
3. The critical values for the χ2-distribution are found in Table 6 of
Appendix B. To find the critical value(s) for a
a. right-tailed test, use the value that corresponds to d.f. and .
b. left-tailed test, use the value that corresponds to d.f. and 1 – .
c.
two-tailed test, use the values that corresponds to d.f. and 
1
1 1 – .
and d.f. and
2
2
Finding Critical Values for the χ2
Example:
Find the critical value for a left-tailed test when n = 19
and  = 0.05.
There are 18 d.f. The area to the right of the critical
value is 1 –  = 1 – 0.05 = 0.95.
From Table 6, the critical value is χ20 = 9.390.
Example:
Find the critical value for a two-tailed test when n = 26
and  = 0.01.
There are 25 d.f. The areas to the right of the critical
1
1
values are 2  = 0.005 and 1 – 2  = 0.995.
From Table 6, the critical values are χ2L = 10.520 and
χ2R = 46.928.
Hypothesis Test for Standard Deviation
Example:
A college professor claims that the standard deviation
for students taking a statistics test is less than 30. 10
tests are randomly selected and the standard deviation
is found to be 28.8. Test this professor’s claim at the
 = 0.01 level.
H0:   30
Ha:  < 30
(Claim)
This is a left-tailed test with d.f.= 9 and  = 0.01.
  0.01
X2
Continued.
Hypothesis Test for Standard Deviation
Example continued:
A college professor claims that the standard deviation
for students taking a statistics test is less than 30. 10
tests are randomly selected and the standard deviation
is found to be 28.8. Test this professor’s claim at the
 = 0.01 level.
Ha:  < 30 (Claim)
H0:   30
χ2
0
= 2.088
2
  0.01
X20
= 2.088
χ 
X2
(n  1)s 2
σ2
(10  1)(28.8)2

302
 8.29
Fail to reject H0.
At the 1% level of significance, there is not enough evidence
to support the professor’s claim.
Hypothesis Test for Variance
Example:
A local balloon company claims that the variance for the
time its helium balloons will stay afloat is 5 hours. A
disgruntled customer wants to test this claim. She
randomly selects 23 customers and finds that the variance
of the sample is 4.5 seconds. At  = 0.05, does she have
enough evidence to reject the company’s claim?
H0: 2 = 5 (Claim)
H a:  2  5
This is a two-tailed test with d.f.= 22 and  = 0.05.
1
  0.025
2
1
  0.025
2
X2L
X2R
X2
Continued.
Hypothesis Test for Variance
Example continued:
A local balloon company claims that the variance for the
time its helium balloons will stay afloat is 5 hours. A
disgruntled customer wants to test this claim. She
randomly selects 23 customers and finds that the variance
of the sample is 4.5 seconds. At  = 0.05, does she have
enough evidence to reject the company’s claim?
Ha: 2  5
H0: 2 = 5 (Claim)
The critical values are χ2L = 10.982 and χ2R = 36.781.
1
  0.025
2
1
  0.025
2
10.982
36.781
X2
Continued.
Hypothesis Test for Variance
Example continued:
A local balloon company claims that the variance for the
time one of its helium balloons will stay afloat is 5 hours. A
disgruntled customer wants to test this claim. She
randomly selects 23 customers and finds that the variance
of the sample is 4.5 seconds. At  = 0.05, does she have
enough evidence to reject the company’s claim?
Ha: 2  5
H0: 2 = 5 (Claim)
2
χ 
(n  1)s 2
σ2

(23  1)(4.5)
 19.8 Fail to reject H0.
5
19.8
10.982
36.781
X2
At  = 0.05, there is not enough
evidence to reject the claim that the
variance of the float time is 5 hours.
One-Sample Inference for
the Binomial Distribution
Let p denote the proportion of
individuals or objects in a
population who possess a specified
property.
Large-Sample Tests
Large-sample tests concerning p
are a special case of the more
general large-sample procedures
for a parameter  .
Large-Samples Concerning p
Null hypothesis:
H 0 : p  p0
Test statistic value:
z
pˆ  p0
p0 1  p0  / n
Large-Samples Concerning p
Alternative
Hypothesis
Rejection Region
H a : p  p0
z  z
H a : p  p0
z   z
H a : p  p0
Valid provided
z  z / 2 or z   z / 2
np0  10 and n(1  p0 )  10.
Hypothesis Test for Proportions
Example continued:
Statesville college claims that more than 94% of their
graduates find employment within six months of
graduation. In a sample of 500 randomly selected
graduates, 475 of them were employed. Is there enough
evidence to support the college’s claim at a 1% level of
significance?
H0: p  0.94
Ha: p > 0.94 (Claim)
Because the test is a right-tailed test and  = 0.01, the
critical value is 2.33.
0.95  0.94
z  p̂  p 
pq n
(0.94)(0.06) 500
0
2.33
z
 0.94
Test statistic
Continued.
Hypothesis Test for Proportions
Example continued:
Statesville college claims that more than 94% of their
graduates find employment within six months of
graduation. In a sample of 500 randomly selected
graduates, 475 of them were employed. Is there enough
evidence to support the college’s claim at a 1% level of
significance?
H0: p  0.94
Ha: p > 0.94 (Claim)
z  0.94
0
2.33
z
The test statistic falls in
the nonrejection region,
so H0 is not rejected.
At the 1% level of significance, there is not enough evidence to
support the college’s claim.
Hypothesis Test for Proportions
Example:
A cigarette manufacturer claims that one-eighth of the
US adult population smokes cigarettes. In a random
sample of 100 adults, 5 are cigarette smokers. Test the
manufacturer's claim at  = 0.05.
Verify that the products np and nq are at least 5.
np = (100)(0.125) = 12.5 and nq = (100)(0.875) = 87.5
H0: p = 0.125 (Claim)
Ha: p  0.125
Because the test is a two-tailed test and  = 0.05, the
critical values are ± 1.96.
Continued.
Hypothesis Test for Proportions
Example continued:
A cigarette manufacturer claims that one-eighth of the
US adult population smokes cigarettes. In a random
sample of 100 adults, 5 are cigarettes smokers. Test the
manufacturer's claim at  = 0.05.
Ha: p  0.125
H0: p = 0.125 (Claim)
2.27
z0 = 1.96
0
z0 = 1.96
z
The test statistic is
0.05  0.125
z  p̂  p 
pq n
(0.125)(0.875) 100
 2.27
Reject H0.
At the 5% level of significance, there is enough evidence to
reject the claim that one-eighth of the population smokes.
Homework 7.7; 7.13; 7.23-7.25;