1
Lecture 20: Single Sample Hypothesis
Tests:Population Mean and
ProportionDevore, Ch. 8.2 - 8.3
Topics
• Tests of Single Population MeanI. Normal Population w/ known II. Large Sample Tests
III. Normal Population w/ unknown
• Tests of Single Population Proportion– Large Sample Test– Small Sample Test
Recommended Steps in Hypothesis Testing
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 Steps, con’d
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 Steps-end
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.
Single Population Mean Tests
• Identifying appropriate test statistic
Case USETest
StatisticFormula
Iknown , and normal
populationzo
IIlarge sample, unknown knowing if normal not req'd
(CLT)zo
IIIunknown , but normal population required
to
Tests of Single Population Mean
nX o
/
nSX o
/
nSX o
/
Case I: Mean - Normal, known
• Null Hypothesis:
• Test Statistic:
Alt Hypothesis Reject Region
2/2/or :
:
:
zzzzHa
zzHa
zzHa
ooo
oo
oo
Ho:
n
X o
/
zo =
Case II: Large-Sample Tests
When the sample size is large, the z tests for case I are modified to yield valid test procedures without requiring either a normal population distribution or a known .
Case II: Mean - Large Sample
• Large Sample - rule of thumb n > 40 -- for large samples, S will usually be close to .
• Null Hypothesis:
• Test Statistic:
Alt Hypothesis Reject Region
2/2/ oo
o
o
or :
:
:
zzzzHa
zzHa
zzHa
o
o
o
Ho:
nSX
z oo /
Case III: Normal Population
If X1,…,Xn is a random sample from a normal distribution, the standardized variable
has a t distribution with n – 1 degrees of freedom.
/
XT
S n
Case III: Mean - Normal, unknown
• Null Hypothesis:
• Test Statistic:
Alt Hypothesis Reject Region
1,
1,
2/1,2/or :
1, :
:
noo
oo
noo
ttttHa
nttHa
ttHa
n
Ho:
nS
Xt oo
/
Examples: Piston Rings
• A manufacturer of piston rings must produce rings with a target = 80.995 mm. (Assume Normality)
– Suppose you take a sample of 15 rings and obtain a mean = 80.996 and sample standard deviation of 0.0019.
• Should you adjust your process to shift the mean closer to the target value? Assume = 0.05. (test if there is evidence to claim that the mean of the process is different than the target value)
• Should you adjust your process to shift the mean closer to the target value based on a historical (population) std dev of 0.0019? Assume = 0.05.
and sample size
• Hand calculations for Case I (normal, known )
• For other cases, use Software (e.g., power and sample size feature in Minitab.)
• We will now examine some possible cases for Type II errors
Type II errors for Case I Mean Test
• Type II error (conclude no difference, when a difference exists). Again, type II errors exist for any value in the alt hypothesis region
• P(Fail to Reject Ho when =’)
There has been a mean shift () so that ’ = +
’
)/
'(
)' given /(
nZ
nzXP
o
o
For Ha: > o
Example: Piston Rings
• What is the probability that you will fail to detect a shift in the mean from 80.995 to 80.997 given a shift has occurred?– assume = 0.05, n = 15, (known) = 0.0019
– Assume Ha: Reject if > o
– Calculate and power by hand and using Minitab
Note: See Book for other tests of other alternative hypothesis
Sample Size Calculation
• May want to know the sample size needed to detect a shift ’ for a level test
• One-tail test
• Two-tail test
• For prior problem, what n is needed for = 0.05, = 0.1, diff = +0.002 (80.995-80.887), = 0.0019?– Assume 1-side test
22/
2
]'
)([
]'
)([
o
o
zzn
zzn
A Population Proportion
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 .
Single Proportion Tests
• Typically, we only conduct proportion hypothesis test for large samples.
• For small samples, we may compute probabilities of Type I and Type II errors and compare with criteria (e.g., =0.05)
Case USE Test Statistic Formula
ILarge sample,
normal approximation
zo
IISmall sample, use
binomial distribution
Solve for p-value - compare to
Tests of Single Population Proportion
npppp
oo
o/)1(
ˆ
Single Proportion - Large Sample
• Require np0 >= 10 and nqo >= 10 (Normal approximation)
• Null Hypothesis: p = po
• Test Statistic:
• p-hat :
• Alt Hypothesis Reject Region
2/2/0
0
0
or :
:
:
zzzzppHa
zzppHa
zzppHa
oo
o
o
p̂-1q̂ ˆ nx
p
npppp
zoo
oo /)1(
ˆ
Example: Proportion Test
• Suppose you produce injection molding parts. – You claim that your process produces 99.9%
defect free parts, or the proportion of defective parts is 0.001
– During part buyoff, you produce 500 parts of which 1 is defective.
• Note: p-hat = 1 / 500 = 0.002
• Compute Zo – Z--> (Zo > Z0.01 = 2.33)
• Use a statistical test to demonstrate that your machine is not producing more defects than your advertised rates (assume = 0.01).
Sample Size Determination
• Given a hypothesized defect rate of 0.001, how many samples would you need to detect that the defect rate increases to 0.002?– Assume 1-side test with = 0.01 and = 0.01
• Solve using Minitab.
Small-Sample Tests
Test procedures when the sample size n is small are based directly on the binomial distribution rather than the normal approximation.
0(type I) 1 ( 1; , )P B c n p
( ) ( 1; , )B p B c n p
Small Sample Tests
• Examples:– Issues: need to define a rejection region in
terms of number of successes, c. then, • Type I: P(X >= c when X~Bin(n,po) )• P(type I) = 1 - B(c-1; n, po)
• Type II: P(X < c when X ~ Bin(n,p’) )• P(type II when p = p’) = B(c-1; n, p’ )