You are on page 1of 34

Statistical Hypothesis

yp Testing
g

• A null hypothesis,
hypothesis denoted by H0, is an assertion about one or more population
parameters. This is the assertion we hold to be true until we have sufficient
statistical evidence to conclude otherwise.
 H0:  = 100
• The alternative
Th l i hypothesis,
h h i denoted
d d bby H1, is
i the
h assertion
i off all
ll situations
i i not
covered by the null hypothesis.
 H1:  100

• H0 and H1 are:
 Mutually exclusive
– Only one can be true.
 Exhaustive
– Together they cover all possibilities, so one or the other must be
true.
Hypothesis
yp about other Parameters

• Hypotheses about other parameters such as population proportions and and


population variances are also possible. For example

H0: p  40%
H1: p < 40%

H0:   
H1:  
The Null Hypothesis,
yp H0

• The null hypothesis:


Often represents the status quo situation or an existing belief.
Is maintained,, or held to be true,, until a test leads to its rejection
j
in favor of the alternative hypothesis.
Is rejected as false on the basis of a consideration of a test
statistics.
The Concepts
p of Hypothesis
yp Testing
g

• A test statistic is a sample statistic computed from sample


data. The value of the test statistic is used in determining
whether or not we may reject the null hypothesis.
• The decision rule of a statistical hypothesis test is a rule
that specifies the conditions under which the null hypothesis
may be rejected
rejected.

Consider H0:  = 100. We may have a decision rule that says: “Reject
H0 if the sample mean is less than 95 or more than 105.
105 ”
Decision Making
g

• There are two possible states of nature:


H0 is true
H0 is false
• There are two possible decisions:
Fail to reject H0 as true
Reject
R j t H0 as false
f l
Decision Making
g

• A decision may be correct in two ways:


Fail to reject a true H0
Reject a false H0
• A decision may be incorrect in two ways:
Type I Error: Reject a true H0
• The Probability of a Type I error is denoted
y .
by
Type II Error: Fail to reject a false H0
• The Probability of a Type II error is denoted
by .
Errors in Hypothesis
yp Testing
g

• A decision
d i i may be b incorrect
i in
i two ways:
Type I Error: Reject a true H0
The Probability of a Type I error is denoted by . 
  is called the level of significance of the test
Type II Error: Do not a false H0
The Probability of a Type II error is denoted by .
 1 -  is called the power of the test.
•  and  are conditional probabilities:

 = P(Reject H 0 H 0 is true)
  = P(Accept H H is false)
0 0
Type I and Type II Errors

A contingency table illustrates the possible outcomes


of a statistical hypothesis test.
The p-Value
p

The p-value is the probability of obtaining a value of the test statistic as


extreme as, or more extreme than, the actual value obtained, when the null
hypothesis is true.
true

The p-value is the smallest level of significance, , at which the null


hypothesis may be rejected using the obtained value of the test statistic.
statistic

RULE: When the p-value is less than  , reject H0.

NOTE: More detailed discussions about the p-value will be


given later in the chapter when examples on hypothesis
t t are presented.
tests t d
Example
A recent research claims that it takes an average of 28 minutes for
melittin (bee venom) to form a blister. Suppose that you want to
carry out a hypothesis test of this claim. n = 100; x = 31.5; s = 5

Set the null and alternative s 5


hypotheses: xz .025
 315
.  196
.
n 100
H0:  = 28
H1:   28
.  .98  3052
 315 . 
. , 3248
Construct a 95% confidence
We can be 95% sure that the
interval for the average average time for all interactions is
interaction times of all trials: between 30.52 and 32.48 minutes.

Since the asserted value, 28 mins, is not in this 95% confidence


interval, we may reasonably reject the null hypothesis.
7-3 Computing
p g the p
p-Value

Recall:
The p-value is the probability of obtaining a value of the test
statistic as extreme as, or more extreme than, the actual value
obtained, when the null hypothesis is true.

The p-value is the smallest level of significance, , at which the


null hypothesis
yp mayy be rejected
j usingg the obtained value of the
test statistic.
Example
An automatic machine fills vaccine into two mililiter ((2000 µ µl)) vials.
A public health speacialist wants to test the null hypothesis that the
average amount filled by the machine into a vial is at least 2000 µl. A
random sample of 40 vials coming out of the machine was selected
and the exact content of the selected vials are recorded. The sample
mean was 1999.6 µl. The population standard deviation is known
from past experience to be 1.30
1 30 µl.
µl Compute the p-value
p value for this test
test.
H0:   2000
H1:   2000
n = 40, 0 = 2000, x-bar = 1999.6,
 = 1.3
x  0
The test statistic is:z 

n
1-Tailed and 2-Tailed Tests

The tails
Th t il off a statistical
t ti ti l test
t t are determined
d t i d byb the
th needd for
f an action.
ti If action
ti
is to be taken if a parameter is greater than some value a, then the alternative
hypothesis is that the parameter is greater than a, and the test is a right-tailed
test
test. H0:   50
H1:   50

If action is to be taken if a parameter is less than some value a, then the


alternative hypothesis is that the parameter is less than a, and the test is a left-
tailed test. H0:   50
H1:   50

If action is to be taken if a parameter is either greater than or less than some


value a, then the alternative hypothesis is that the parameter is not equal to a,
andd th
the test
t t is
i a two-tailed
t t il d test.
t t H0:   50
H1:   50
The Hypothesis
yp Test

We will see the three different types of hypothesis tests, namely

Tests of hypotheses about population means.


Tests of hypotheses about population proportions.
Tests
es s oof hypotheses
ypo eses about
bou popu
population
o variances.
v ces.
Testing
g Population
p Means

• Cases in which the test statistic is Z

 is known and the population is normal.


 is known and the sample size is at least 30. (The population
need not be normal)

The formula for calculating Z is :


x
z
 
 
 n
Testing
g Population
p Means

• Cases in which the test statistic is t

 is unknown but the sample standard deviation is known and


the population is normal.

The formula for calculating t is :


x
t
 s 
 
 n
Rejection
j Region
g

• The rejection region of a statistical hypothesis test is


the range of numbers that will lead us to reject the null
hypothesis
yp in case the test statistic falls within this
range. The rejection region, also called the critical
region, is defined by the critical points. The rejection
region
i is i defined
d fi d so that,
h before
b f the
h sampling
li takes
k
place, our test statistic will have a probability  of
falling within the rejection region if the null hypothesis
is true.
Nonrejection
j Region
g

• The nonrejection region: the range of values that will


lead us not to reject the null hypothesis if the test
statistic should fall within this region
In a two-tailed test, the rejection region consists of
the values in both tails of the sampling
p g distribution.
Picturing the Nonrejection and
Rejection Regions
T he Hypothesized
yp Sampling
p g Distribution of the Mean
If the null hypothesis were
0.8
true, then the sampling 0.7 .95

distribution of the mean 0.6

0.5

would look something 0.4

like this: 0.3

0.2
.025 .025

01
0.1
We will find 95% of the 0.0

sampling distribution between 27.02 0=28 28.98

the critical points 27.02 and 28.98,


and 2.5% below 27.02 and 2.5% above 28.98 (a two-tailed test).
The 95% interval around the hypothesized mean defines the
nonrejection region,
region with the remaining 5% in two rejection
regions.
Example
An automatic machine fills vaccine into two mililiter ((2000 µl)
µ ) vials. A ppublic
health specialist wants to test the null hypothesis that the average amount filled
by the machine into a vial is at least 2000 µl. A random sample of 40 vials
coming g out of the machine was selected and the exact content of the selected
vials are recorded. The sample mean was 1999.6 µl. The population standard
deviation is known from past experience to be 1.30 µl.
Test
es thee null
u hypothesis
ypo es s at
a thee 5% significance
s g ca ce level.
eve .
n = 40
H0:   2000
H1:   2000 x = 1999.6
n = 40  = 1.3
For  = 0.05, the critical value
of z is -1.645 x  
z  0
x 
 0 = 1999.6
1999 6 - 2000
z 
The test statistic is:
n  1.3
Do not reject H0 if: [z -1.645]
-1 645] n 40
Reject H0 if: z ]
=  1.95  Reject H
0
Example : p-value approach
An automatic machine fills vaccine into two mililiter ((2000 µl)
µ ) vials. A
public health specialist wants to test the null hypothesis that the average
amount filled by the machine into a vial is at least 2000 µl. A random
sample
p of 40 vials coming g out of the machine was selected and the exact
content of the selected vials are recorded. The sample mean was 1999.6 µl.
The population standard deviation is known from past experience to be
1.30
.30 µl.
µ.
Test the null hypothesis at the 5% significance level.
x
H0:   2000 z 0 = 1999.6 - 2000
H1:   2000  1.3
n = 40 n 40
For  = 0.05, the critical value
of z is -1.645
x   0
=  1.95
z 

The test statistic is: p - value  P(Z  - 1.95)
n
 0.5000 - 0.4744
Do not reject H0 if: [p-value  ]
 0.0256  Reject H since 0.0256  0.05
Reject H0 if: p-value ] 0
Testing
g Population
p Proportions
p

• Cases in which the binomial distribution can be used

Thee binomial
b o a distribution
d st but o can
ca be used whenever
w e eve we are
a e able
ab e to
calculate the necessary binomial probabilities. This means that
for calculations using tables, the sample size n and the population
proportion p should have been tabulated.
tabulated

Note: For calculations using spreadsheet templates, sample


sizes up to 500 are feasible.
Testing
g Population
p Proportions
p

• Cases in which the normal approximation is to be used

If the sample size n is too large (n > 500) to calculate binomial


probabilities, then the normal approximation can be used, and the
population proportion p should have been tabulated.
Example:
p p p-value approach
pp
A coin is to tested for fairness. It is tossed 25 times and only 8
H d are observed.
Heads b d T
Test if the
h coini is f i at an  off 5%
i fair
(significance level).

Let p denote the probability of a Head


H0: p 0.5
H1: p  

Because this is a 2-tailed test, the p-value = 2*P(X  
From the binomial tables, with n = 25, p = 0.5, this value
2*0.054 = 0.108.
Since 0.108 >  = 0.05, then do not reject H0
Testing
g Population
p Variances
• For testing hypotheses about population variances, the test
statistic (chi-square) is: n  1s 2

 
2

 2

where  0 is the claimed value of the population variance in the


2

null hypothesis. The degrees of freedom for this chi-square


random variable is (n – 1).

Note: Since the chi-square table only provides the critical


values, it cannot be used to calculate exact p-values. As in
the case of the t-tables, only a range of possible values can
be inferred.
Example
A shrimp provider claims that they control the weights of the
shrimp accurately so that the variance of the weights is not more
than 1 g2. A random sample of 31 shrimps yields a sample
variance of 1.62 g2. Is that sufficient evidence to reject the claim
at an  of 5%?
Let 2 denote the population variance. Then
H0: 2  1
H1: 2 
The p-value is 0.0173; since
this value is less than the  of 5%,
5% we reject the null hypothesis.
hypothesis
Additional Examples (a)
A researcher needs to test the null hypothesis that the average weight
of fat per person is   = 12 pounds, versus the alternative hypothesis
that the average weight is not 12 pounds.
pounds The analyst wants to test
the null hypothesis at  = 0.05.
H0:  = 12
H1:   12 The Standard Normal Distribution
0.8
0.7 .95

For  = 0.05,
F 0 05 critical
i i l values
l off z are 0.6
0.5

±1.96 x 
0.4

z
0.3
0 0.2
.025 .025

The test statistic is: s 01


0.1
0.0

z
n -1.96  1.96

[-1 96  z 1.96]
Do not reject H0 if: [-1.96 1 96] Lower Rejection
Region
Nonrejection
Region
Upper Rejection
Region

Reject H0 if: [z <-1.96] or z 1.96]


Additional Examples
p ((a):
) Solution
n = 144
The Standard Normal Distribution
x = 14.6
14 6 0.8
0.7 .95
0.6
s = 7.8 0.5
0.4

x   0 14.6-12
0.3
14 6 12
z
.025 .025
0.2
=
s 7.8 0.1
0.0

n 144 -1.96  1.96 z


2.6
4
Lower Rejection Nonrejection Upper Rejection
= Region
Region Region
0.65

Since the test statistic falls in the upper rejection region, H0 is


rejected,
j t d andd we may conclude l d that
th t the
th average amountt off fat
f t is
i
more than 12 pounds.
Additional Examples
An analyst
A l ffor Genscript
G i Protein
P i CCompany wantedd to test the h
hypothesis made by British experts that 70% of all hard-to-make
pproteins used in the British market were made in America. The
analyst gathered a random sample of 210 proteins in London and
found that 130 were made by the U.S. At the  = 0.05 level of
significance is there evidence to reject the claim of the British
significance,
experts?
n = 210
H0: p = 0.70 130
 0 .619
H1: p  0.70 p =
210
n = 210
p - p 0.619 - 0.70
The test statistic is: z =
0
=
p  p0 p q (0.70)(0.30)
z 0 0
210
p0 q 0 n

n -0.081
=   2 .5614  Reject H
0.0316 0
Additional Examples
The EPA sets limits on the concentrations of ppollutants emitted byy
various industries. Suppose that the upper allowable limit on the
emission of vinyl chloride is set at an average of 55 ppm within a
range of two miles around the plant emitting this chemical.
chemical To check
compliance with this rule, the EPA collects a random sample of 100
readings at different times and dates within the two-mile range around
the plant.
plant The findings are that the sample average concentration is
60 ppm and the sample standard deviation is 20 ppm. Is there
evidence to conclude that the plant in question is violating the law?
n = 100

H0:   55 x = 60
s = 20
H1:  55
n = 100 x  0 60 - 55
x  0 z
The test statistic is: z  s
=
20
s
n n 100
5
=  2.5  Reject H
2 0
Additional Examples
The average
g lifetime of Vietnamese people
p p is said byy WHO to be
an average of 65 years. A researcher believes that the average life
of the Vietnamese is less than that claimed by WHO above and sets
out to prove that the claim is false.
false A random sample of 21
Vietnamese individuals is chosen and shows that the sample
average lifetime is 62.5 years and the sample standard deviation is
i =0.01, determine
3. Using d i whether
h h there
h isi evidence
id to conclude
l d
that the WHO’s claim is false.

H0:   65
H1:   65
n = 21
Additional Examples:
p Continued

Critical Point for a Left-Tailed Test


Since the test statistic falls in
0 .4

the rejection region, H0 is


0 .3 0.95
rejected,
j t d andd we may conclude l d
f(t)

0 .2

 that the manufacturer’s claim


0 .1
is false, that the average
0 .0
-5
-2.528
0 5
t
floodlight life is less than 65
-3.82 hours.
Rejection Nonrejection
R i
Region R i
Region
The p
p-Value: Rules of Thumb

When the p-value


p value is smaller than 0.01,
0 01 the result is considered to
be very significant.

When the p-value is between 0.01 and 0.05, the result is


considered to be significant.

When the p-value is between 0.05 and 0.10, the result is


considered by some as marginally significant (and by most as not
significant).
significant)

When the p-value is greater than 0.10, the result is considered not
significant.
The p
p-Value and Hypothesis
yp Testing
g

The further away in the tail of the distribution the test statistic falls, the smaller
is the p-value and, hence, the more convinced we are that the null hypothesis is
false and should be rejected.

In a right-tailed
i h il d test, the h p-value
l isi the
h area to the
h right
i h off the
h test statistic
i i if the
h
test statistic is positive.

In a left-tailed
left tailed test,
test the p-value
p value is the area to the left of the test statistic if the
test statistic is negative.

In a two-tailed
two tailed test,
test the pp-value
value is twice the area to the right of a positive test
statistic or to the left of a negative test statistic.

For a g
given level of significance,:
g ,
Reject the null hypothesis if and only if p-value

You might also like