Sie sind auf Seite 1von 58

CHAPTER 8

HYPOTHESE TESTING
Statistical Hypothesis

 - a claim or assertion about the value of a single


parameter, about the value of several parameters or
about the form of an entire probability distribution.

 Example: claim that µ =0.75, where µ is the true


average inside diameter of a pipe.
Hypotheses
The null hypothesis, denoted H0, is the claim that is
initially assumed to be true.

The alternative hypothesis, denoted by Ha, is the


assertion that is contrary to H0. Possible conclusions
from hypothesis-testing analysis are reject H0 or fail
to reject H0.
Examples

 Null hypothesis: Ho:


 Alternate hypothesis: Ha:
 Example: Ho: John has siblings
Ha: John does not have
siblings
Example: Ho: µ = 6
Ha: µ < 6
A Test of Hypotheses
A test of hypotheses is a method for using
sample data to decide whether the null
hypothesis should be rejected.
Test Procedure
A test procedure is specified by
• A test statistic, a function of the sample data on
which the decision (reject null hypothesis or do
not reject) is to be based.

• A rejection region, the set of all test statistic


values for which H0 will be rejected (null
hypothesis rejected iff the test statistic value falls
in this region.)
Errors in Hypothesis Testing

A type I error consists of rejecting the null


hypothesis H0 when it was true.

A type II error involves not rejecting H0 when H0 is


false.
Errors in Hypothesis Testing

 Decision: Ho is:
 True False

 Do not reject Ho Correct Type II


Decision Error

 Reject Ho Type I Correct


Error Decision
Errors in Hypothesis Testing

Type I error: Reject the null hypothesis when the null is


TRUE.
P(Type I error) = α
Type II error: Do not reject the null hypothesis when the
null is FALSE.
P(Type II error) = β

Goal: Minimize α and β


Rejection Region:  and 

Suppose an experiment and a sample


size are fixed, and a test statistic is
chosen. The decreasing the size of the
rejection region to obtain a smaller
value of  results in a larger value of 
for any particular parameter value
consistent with Ha.
Significance Level
Specify the largest value of  that
can be tolerated and find a rejection
region having that value of  . This
makes  as small as possible subject
to the bound on  . The resulting
value of  is referred to as the
significance level.
Level  Test

A test corresponding to the significance


level is called a level  test. A test
with significance level  is one for
which the type I error probability is
controlled at the specified level.
EXAMPLE
 General Question: Does a manufacturer’s pipe
meet the building code in some city?
 Select null so that “strong” evidence necessary
to reject it from tester’s point of view
 Specific null hypothesis from city’s viewpoint:
Average pipe does not meet code (H0): µ< 2400
 Alternate hypothesis – Average pipe does meets
code (Ha): µ> 2400
 Equal (=) sign always in null hypothesis
 What sample values would suggest rejecting H0?
Conclusions and Consequences for a Test of Hypothesis

True State of the Situation

Conclusion H0 True Ha True


Pipe too weak Pipe strong enough
Accept H0 Correct decision Type II error
(Assume H0 True) Pipe too weak and (probability β)
rejected Secondary Control
Reject pipe as too weak
Pipe strong enough
but rejected

Reject H0 Type I error Correct decision


(Assume Ha True) (probability α) Pipe strong enough
Initial control and accepted
Accept pipe as strong
enough Pipe too weak but
accepted
Confidence Interval Approach with
Example
 Assume that s is a good approximation of σ
 Sample of 50 taken, x = 2460, s=200
 Confidence Interval =
 [2460 – 1.96*200/sqrt(50),

 2460 + 1.96*200/sqrt(50)]= [ 2404, 2515]

 What can be concluded? Should city reject H0?


8.2

Tests About
a
Population Mean
Case I: A Normal Population
With Known 

Null hypothesis: H 0 :   0

x  0
Test statistic value: z 
/ n
Case I: A Normal Population
With Known 
Alternative Rejection Region
Hypothesis for Level  Test
H a :   0 z  z
H a :   0 z   z
H a :   0 z  z / 2 or z   z / 2
Recommended Steps in
Hypothesis-Testing 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
1. Give the formula for the computed value
of the test statistic.
2. State the rejection region for the selected
significance level
3. 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.
Type II Probability  (  ) for a Level 
Test Type II
Alt. Hypothesis Probability  (  )
 0    
H a :   0   z  
 / n
 0    
H a :   0 1     z  
 / n

H a :   0 
  z / 2 
0     
    z / 2 
0    

 / n  / n
Hypothesis Testing for a Mean: p-value
Approach

 Z-stat is the test statistic to be used because we know its
distribution and so can calculate probabilities:
x − 2400 x − 2400
z − statvalue = = ~ N(0,1)
σx σ n
p − value = P(z ≥ z − statvalue)
 p-value is probability that a random sample results in a test
statistic value as extreme (as far away from µ) in the direction
consistent with the intent of H0 as it is
 p-value is also the probability of a Type I error: rejecting H0
when it is true
Example
 Reject when average pipe exceeds code by a
considerable amount => a rejection region
 Determined by Type I error: probability (α) of
rejecting the null hypothesis when it is true
 Set rejection region so that α=.05
 => reject falsely 1 out of 20 times

 Region is z>1.645, from


z value table
Example
 Assume that s is a good approximation of σ
 Sample of 50 taken, = 2460, s=200
 Test statistic is
x − 2400 2460 − 2400
z − statvalue = =
s n 200 50
60
= = 2.12
28.28

 Test statistic lies in rejection region, therefore we reject H0 and


accept Ha that the average pipe meets building code
 P-value = .017 => less than 2% chance of Type I error of a
false rejection => reject H0 for α = .05

Large-Sample Test of Hypothesis about a
Population Mean
 Large-Sample Test of Hypothesis about µ
 One-Tailed Test  Two-Tailed Test

H0: µ = µ0 H0: µ = µ0
H a: µ < µ0 (or Ha :µ > µ0 ) Ha µ ≠ µ0
Test Statistic: x − µ0 Test Statistic: x − µ0
z= z=
s n s n
Rejection region: z < − zα Rejection region: z > zα 2
(or z > zα when Ha: µ > µ0 )
 A certain type of automobile is known to sustain no visible
damage 25% of the time in 10-mph crash tests. A modified
bumper design has been proposed in an effort to increase this
percentage. Let p denote the proportion of all 10-mph crashes
with this new bumper that result in no visible damage. The
hypotheses to be tested are H0: p=.25 (no improvement) versus
Ha: p>0.25. The test will be based on an experiment involving
n=20 independent crashes.

 Test statistic: X=number of crashes with no visible damage.


 Rejection region: reject H0 if x ≥8, where x is the observed
value of the test statistic.
This is an upper-tailed test!
 When H0 is true, X has a binomial distribution with n=20 and
p=0.25.

 Α = P( type I error) = P (H0 is rejected when it is true) = P(X


≥8 when X ~ Bin(20,0.25)) = 1 – Bin (7,20,0.25)= 1-0.898
=0.102

 Therefore, when H0 is actually true, about 10% of all


experiments that consist of 20 crashes would result in H0
being incorrectly rejected (type I error).
 We have more β’s, one for each different p that exceeds 0.25.

 Therefore, for p=0.3 ( X ~ Bin(20,0.3)) we have a value of β


and another value of β for p=0.5. etc…

 β = P (type II error when p=0.3)


 = P( H0 is not rejected when it is false when p=0.3)
 =P(X ≤ 7 when X ~ Bin(20,0.3))
 = B(7,20,0.3)
 = 0.772

 When p =0.3 (a little further from H0), about 77% of all


experiments of this type would result in H0 being incorrectly
not rejected.
 The drying time of a certain type of paint under specified test
conditions is known to be normally distributed with mean 75
and standard deviation 9min. Chemists have proposed a new
additive designed to decrease average drying time. It is
believed that drying times with this additive will remain
normally distributed with σ =9. Because of the expense
associated with this additive, evidence should strongly suggest
an improvement in average frying time before such a
conclusion is adopted.

 The appropriate hypotheses are H0:µ=75 versus Ha: µ<75.

 Experimental data consists of drying times for n=25


specimens.
 For this sample, the sample mean is still 75 and the standard
deviation of the sample is 9/sqrt(25) = 9/5=1.8min.

 When H0 is true, a mean value less than 75 would not strongly


contradict 75.
 Let’s choose a reasonable rejection region X ≤ c with c=72
( try also with c=70.8; what are the differences?)

 α = P ( type I error) = P (H0 is rejected when it is true) =


 = P ( X¯ ≤ 72 when X¯ ~ N(75, 1.82)
 = Φ((72-75)/1.8)=Φ(-1.67) = 0.0475 ≈ 0.05

 Only 5% of all experiments carried out as described will result


in H0 being rejected when it is actually true.
 β(72) = P (H0 is rejected when µ =72)
 = P(X¯ > 72 when X¯ ~ N(72, 1.82))
 = 1- Φ((72-72)/1.8)=1- Φ(0) =0.5
 Or
 β(70) = P (H0 is rejected when µ =72)
 = P(X¯ > 70 when X¯ ~ N(72, 1.82))

= 1- Φ((72-70)/1.8)=.1335
Sample Size
The sample size n for which a level 
test also has  (  )   at the alternative
value   is
   ( z  z  )  2

  one-tailed test

  0    
n 2
   ( z / 2  z  ) 
   two-tailed test
   0    
Determine β
_
β ( µ ' ) = P( X < µ 0 + zα ∗ σ / n )
 _ 
   
 X − µ' µ0 − µ '   µ0 − µ ' 
=P < zα + = Φ zα +
σ / n σ/ n  σ / n 
   
 
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  .
Large Sample Tests (n > 40)
For large n, s is close to  .
X  0
Test Statistic: Z 
S/ n
The use of rejection regions for case I
results in a test procedure for which the
significance level is approximately  .
Case III: A Normal Population
Distribution
If X1,…,Xn is a random sample from a
normal distribution, the standardized
variable X 
T
S/ n
has a t distribution with n – 1
degrees of freedom.
The One-Sample t Test

Null hypothesis: H 0 :   0
x  0
Test statistic value: t
s/ n
The One-Sample t Test

Alternative Rejection Region


Hypothesis 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
A Typical  Curve for the t Test

 curve for n – 1 df
 when
  
0
Value of d corresponding to
specified alternative to  
8.3

Tests Concerning
a
Population Proportion
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  .
Large-Samples Concerning p

Null hypothesis: H 0 : p  p0

Test statistic value:


pˆ  p0
z
p0  1  p0  / n
Large-Samples Concerning p
Alternative Rejection Region
Hypothesis
H a : p  p0 z  z
H a : p  p0 z   z
H a : p  p0 z  z / 2 or z   z / 2
Valid provided
np0  10 and n(1  p0 )  10.
General Expressions for  ( p)
Alt. Hypothesis  ( p)

H a : p  p0  p0  p  z p0 (1  p0 ) / n 
 
 p(1  p) / n 
 

 p0  p  z p0 (1  p0 ) / n 
H a : p  p0 1   
 p(1  p) / n 
 
General Expressions for  ( p)

Alt. Hypothesis  ( p)


 p0  p  z p0 (1  p0 ) / n 
H a : p  p0  
 p(1  p) / n 
 
 p0  p  z p0 (1  p0 ) / n 
  
 p(1  p) / n 
 
Sample Size
The sample size n for which a level 
test also has  ( p)  p
  z p (1  p )  z p(1  p) 
2
one-tailed
   0 0 

  p   p0  test
 
n 2
  z / 2 p0 (1  p0 )  z  p(1  p)  two-tailed
  
  p  p0  test
Small-Sample Tests
Test procedures when the sample size
n is small are based directly on the
binomial distribution rather than the
normal approximation.

P (type I)  1  B (c  1; n, p0 )
B ( p)  B (c  1; n, p)
P - Value
The P-value is the smallest level of
significance at which H0 would be
rejected when a specified test procedure
is used on a given data set.
1. P-value  
 reject H 0 at a level of 
2. P -value  
 do not reject H 0 at a level of 
P - Value

The P-value is the probability,


calculated assuming H0 is true, of
obtaining a test statistic value at least as
contradictory to H0 as the value that
actually resulted. The smaller the P-
value, the more contradictory is the data
to H0.
P-Values for a z Test

P-value:

 1  ( z ) upper-tailed test

P ( z ) lower-tailed test
 2  1   ( z )  two-tailed test

P-Value (area)
P-value = 1 − Φ ( z )
Upper-Tailed

P -value = Φ ( z ) 0 z

Lower-Tailed

-z 0
P-value = 2[1 − Φ(| z |)] Two-Tailed

-z 0 z
P–Values for t Tests

The P-value for a t test will be a t


curve area. The number of df for the
one-sample t test is n – 1.

Das könnte Ihnen auch gefallen