You are on page 1of 9

Statistical Hypothesis Testing Hypothesis about other Parameters

• A null 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 • Hypotheses about other parameters such as population proportions and and
statistical evidence to conclude otherwise. population variances are also possible. For example
 H0:  = 100
• The alternative hypothesis, denoted by H1, is the assertion of all situations not H0: p  40%
covered by the null hypothesis. H1: p < 40%
 H1:  100
H0:   
H1:  
• 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.

The Null Hypothesis, H0 The Concepts of Hypothesis Testing

• The null hypothesis: • A test statistic is a sample statistic computed from sample
Often represents the status quo situation or an existing belief. data. The value of the test statistic is used in determining
Is maintained, or held to be true, until a test leads to its rejection whether or not we may reject the null hypothesis.
in favor of the alternative hypothesis. • The decision rule of a statistical hypothesis test is a rule
Is
I rejected
j t d as false
f l on the
th basis
b i off a consideration
id ti off a test
t t that
h specifies
ifi the
h conditions
di i under
d whichhi h the
h null
ll hypothesis
h h i
statistics.
may be 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.”

1
Decision Making Decision Making

• A decision may be correct in two ways:


• There are two possible states of nature: Fail to reject a true H0
H0 is true Reject a false H0
H0 is false • A decision may be incorrect in two ways:
• There are two possible decisions: Type I Error: Reject a true H0
Fail to reject H0 as true • The Probability of a Type I error is denoted
by .
Reject H0 as false
Type II Error: Fail to reject a false H0
• The Probability of a Type II error is denoted
by .

Errors in Hypothesis Testing Type I and Type II Errors

• A decision may be incorrect in two ways:


Type I Error: Reject a true H0 A contingency table illustrates the possible outcomes
The Probability of a Type I error is denoted by . of a statistical hypothesis test.
  is called the level of significance
g 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

2
Example
The p-Value
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
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. Set the null and alternative s 5
hypotheses: xz .025
 315
.  196
.
n 100
The p-value is the smallest level of significance, , at which the null H0:  = 28
hypothesis may be rejected using the obtained value of the test statistic. H1:   28
.  .98  3052
 315 . 
. , 3248
RULE: When the p-value is less than  , reject H0.
Construct a 95% confidence
We can be 95% sure that the
interval for the average average time for all interactions is
NOTE: More detailed discussions about the p-value will be
interaction times of all trials: between 30.52 and 32.48 minutes.
given later in the chapter when examples on hypothesis
tests are presented. Since the asserted value, 28 mins, is not in this 95% confidence
interval, we may reasonably reject the null hypothesis.

Example
7-3 Computing the p-Value 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
Recall: and the exact content of the selected vials are recorded. The sample
mean was 1999.6 µl. The population standard deviation is known
The p-value is the probability of obtaining a value of the test from past experience to be 1.30 µl. Compute the p-value for this test.
statistic as extreme as, or more extreme than, the actual value
obtained, when the null hypothesis is true. H0:   2000
H1:   2000
n = 40, 0 = 2000, x-bar = 1999.6,
The p-value is the smallest level of significance, , at which the
 = 1.3
null hypothesis may be rejected using the obtained value of the
test statistic. x  0
The test statistic is:z 

n

3
1-Tailed and 2-Tailed Tests The Hypothesis Test

The tails of a statistical test are determined by the need for an action. If action
is to be taken if a parameter is greater than some value a, then the alternative We will see the three different types of hypothesis tests, namely
hypothesis is that the parameter is greater than a, and the test is a right-tailed
test. H0:   50
H1:   50 Tests of hypotheses about population means.
Tests of hypotheses about population proportions.
proportions
If action is to be taken if a parameter is less than some value a, then the Tests of hypotheses about population variances.
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,
and the test is a two-tailed test. H0:   50
H1:   50

Testing Population Means Testing Population Means

• Cases in which the test statistic is Z • Cases in which the test statistic is t

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

The formula for calculating Z is : The formula for calculating t is :


x x
z t
   s 
   
 n  n

4
Rejection Region Nonrejection Region

• The rejection region of a statistical hypothesis test is • The nonrejection region: the range of values that will
the range of numbers that will lead us to reject the null lead us not to reject the null hypothesis if the test
hypothesis in case the test statistic falls within this statistic should fall within this region
range. The rejection region, also called the critical In a two
two-tailed
tailed test,
test the rejection region consists of
region, is defined by the critical points. The rejection the values in both tails of the sampling distribution.
region is defined so that, before the sampling takes
place, our test statistic will have a probability  of
falling within the rejection region if the null hypothesis
is true.

Picturing the Nonrejection and Example


An automatic machine fills vaccine into two mililiter (2000 µl) vials. A public
Rejection Regions 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
T he Hypothesized Sampling Distribution of the Mean coming out of the machine was selected and the exact content of the selected
If the null hypothesis were vials are recorded. The sample mean was 1999.6 µl. The population standard
0.8
true, then the sampling 0.7 .95 deviation is known from past experience to be 1.30 µl.
distribution of the mean 0.6

0.5
Test the null hypothesis at the 5% significance level.
would look something 0.4 n = 40
H0:   2000
like this: 0.3

0.2
.025 .025
H1:   2000 x = 1999.6
0.1
We will find 95% of the 0.0
n = 40  = 1.3
sampling distribution between For  = 0.05, the critical value
27.02 0=28 28.98
of z is -1.645 x  
the critical points 27.02 and 28.98, z  0
x 
 0 = 1999.6 - 2000
and 2.5% below 27.02 and 2.5% above 28.98 (a two-tailed test). z 
The test statistic is:
n  1.3
The 95% interval around the hypothesized mean defines the
Do not reject H0 if: [z -1.645] n 40
nonrejection region, with the remaining 5% in two rejection
regions. Reject H0 if: z ]
=  1.95  Reject H
0

5
Example : p-value approach
An automatic machine fills vaccine into two mililiter (2000 µl) vials. A Testing Population Proportions
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 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. • Cases in which the binomial distribution can be used
The population standard deviation is known from past experience to be
1.30 µl. The binomial distribution can be used whenever we are able to
Test the null hypothesis at the 5% significance level. calculate the necessary binomial probabilities. This means that
x for calculations using tables, the sample size n and the population
H0:   2000 z 0 = 1999.6 - 2000
 1.3
proportion p should have been tabulated.
H1:   2000
n = 40 n 40
For  = 0.05, the critical value
Note: For calculations using spreadsheet templates, sample
of z is -1.645 sizes up to 500 are feasible.
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 Population Proportions Example: p-value approach


A coin is to tested for fairness. It is tossed 25 times and only 8
• Cases in which the normal approximation is to be used Heads are observed. Test if the coin is fair at an  of 5%
(significance level).
If the sample size n is too large (n > 500) to calculate binomial
probabilities,, then the normal approximation
p pp can be used,, and the Let p denote the probability of a Head
population proportion p should have been tabulated. 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

6
Example
Testing Population Variances
A shrimp provider claims that they control the weights of the
• For testing hypotheses about population variances, the test shrimp accurately so that the variance of the weights is not more
statistic (chi-square) is: n  1s 2 than 1 g2. A random sample of 31 shrimps yields a sample
  2
variance of 1.62 g2. Is that sufficient evidence to reject the claim
 2

0 at an  of 5%?
where  0 is the claimed value of the ppopulation
2
p variance in the Let 2 denote the population variance
variance. Then
null hypothesis. The degrees of freedom for this chi-square H 0 : 2  1
random variable is (n – 1). H1: 2 
The p-value is 0.0173; since
Note: Since the chi-square table only provides the critical this value is less than the  of 5%, we reject the null hypothesis.
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.

Additional Examples (a)


Additional Examples (a): Solution
A researcher needs to test the null hypothesis that the average weight n = 144
of fat per person is   = 12 pounds, versus the alternative hypothesis The Standard Normal Distribution

that the average weight is not 12 pounds. The analyst wants to test x = 14.6 0.8
0.7 .95

the null hypothesis at  = 0.05. s = 7.8


0.6
0.5
0.4

H0:  = 12 x  0 14.6-12
0.3

z
.025 .025
0.2
=
H1:   12 The Standard Normal Distribution s 7.8 0.1
00
0.0
0.8
0.7 .95
n 144 -1.96  1.96 z

For  = 0.05, critical values of z are 0.6


2.6

4
0.5 Lower Rejection Nonrejection Upper Rejection
=
x 
Region
±1.96 0.4
0.65 Region Region

z
0.3
0 0.2
.025 .025

The test statistic is: s 0.1


0.0

z
n -1.96  1.96

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


Do not reject H0 if: [-1.96  z 1.96] Lower Rejection
Region
Nonrejection
Region
Upper Rejection
Region rejected, and we may conclude that the average amount of fat is
more than 12 pounds.
Reject H0 if: [z <-1.96] or z 1.96]

7
Additional Examples Additional Examples
The EPA sets limits on the concentrations of pollutants emitted by
An analyst for Genscript Protein Company wanted to test the various industries. Suppose that the upper allowable limit on the
hypothesis made by British experts that 70% of all hard-to-make emission of vinyl chloride is set at an average of 55 ppm within a
proteins used in the British market were made in America. The range of two miles around the plant emitting this chemical. To check
analyst gathered a random sample of 210 proteins in London and compliance with this rule, the EPA collects a random sample of 100
found that 130 were made by the U.S. At the  = 0.05 level of readings at different times and dates within the two-mile range around
significance, is there evidence to reject the claim of the British the plant. The findings are that the sample average concentration is
p
experts? 60 pp
ppm and the samplep standard deviation is 20 ppppm. Is there
n = 210
H0: p = 0.70 130
evidence to conclude that the plant in question is violating the law?
 0 .619
H1: p  0.70 p =
210
n = 100

n = 210 H0:   55 x = 60
s = 20
The test statistic is:
p - p
0 0.619 - 0.70 H1:  55
z = =
p  p0 (0.70)(0.30) n = 100 x  0
p q x  0 60 - 55
z 0 0
210 The test statistic is: z  z
s
=
20
p0 q 0 n s
n n 100
n -0.081
=   2 .5614  Reject H 5
0.0316 0 =  2.5  Reject H
2 0

Additional Examples
The average lifetime of Vietnamese people is said by WHO to be Additional Examples: Continued
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. A random sample of 21
Critical Point for a Left-Tailed Test
Vietnamese individuals is chosen and shows that the sample Since the test statistic falls in
0 .4

average lifetime is 62.5 years and the sample standard deviation is the rejection region, H0 is
0 .3 0.95
3. Using =0.01, determine whether there is evidence to conclude rejected, and we may conclude
f(t)

0 .2

that the WHO


WHO’ss claim is false.
false  
 that the manufacturer
manufacturer’ss claim
0 .1

is false, that the average


H0:   65
0 .0
-5 0 5 floodlight life is less than 65
H1:   65
-2.528 t
-3.82 hours.
n = 21 Rejection Nonrejection
Region Region

8
The p-Value: Rules of Thumb The p-Value and Hypothesis Testing

The further away in the tail of the distribution the test statistic falls, the smaller
When the p-value is smaller than 0.01, the result is considered to is the p-value and, hence, the more convinced we are that the null hypothesis is
be very significant. false and should be rejected.

When the p-value is between 0.01 and 0.05, the result is In a right-tailed test, the p-value is the area to the right of the test statistic if the
test statistic is ppositive.
considered to be significant.
significant
In a left-tailed test, the p-value is the area to the left of the test statistic if the
When the p-value is between 0.05 and 0.10, the result is test statistic is negative.
considered by some as marginally significant (and by most as not
significant). In a two-tailed test, the p-value is twice the area to the right of a positive test
statistic or to the left of a negative test statistic.

When the p-value is greater than 0.10, the result is considered not For a given level of significance,:
significant. Reject the null hypothesis if and only if p-value

You might also like