You are on page 1of 45

Hypothesis testing

In this session
▪ What is hypothesis testing?
▪ Interpreting and selecting significance level
▪ Type I and Type II errors
▪ One tailed and two tailed tests
▪ Hypothesis tests for population mean
▪ Hypothesis tests for population proportion
What is hypothesis testing
• Hypothesis testing refers to
1. Making an assumption, called hypothesis, about a
population parameter.
2. Collecting sample data.
3. Calculating a sample statistic.
4. Using the sample statistic to evaluate the
hypothesis (how likely is it that our hypothesized
parameter is correct. To test the validity of our
assumption we determine the difference between
the hypothesized parameter value and the sample
value.)
HYPOTHESIS TESTING

Null hypothesis, H0 Alternative hypothesis,HA

▪State the hypothesized value of the All possible alternatives other than
parameter before sampling. the null hypothesis.
▪The assumption we wish to test (or E.g µ ≠ 20
the assumption we are trying to
reject) µ > 20
▪E.g population mean µ = 20 µ < 20
▪ There is no difference between There is a difference between coke
coke and diet coke and diet coke

The hypothesis testing procedure uses data from a sample


to test the two competing statements indicated by H and H
Developing Null and Alternative Hypotheses

It is not always obvious how the null and alternative


hypotheses should be formulated.
Care must be taken to structure the hypotheses
appropriately so that the test conclusion provides
the information the researcher wants.
The context of the situation is very important in
determining how the hypotheses should be stated.
In some cases it is easier to identify the alternative
hypothesis first. In other cases the null is easier.
Correct hypothesis formulation will take practice.
Developing Null and Alternative Hypotheses

• Alternative Hypothesis as a Research Hypothesis


Many applications of hypothesis testing involve
an attempt to gather evidence in support of a
research hypothesis.
In such cases, it is often best to begin with the
alternative hypothesis and make it the conclusion
that the researcher hopes to support.
The conclusion that the research hypothesis is true
is made if the sample data provide sufficient
evidence to show that the null hypothesis can be
rejected.
Null Hypothesis
• The null hypothesis H0 represents a theory that
has been put forward either because it is believed
to be true or because it is used as a basis for an
argument and has not been proven. For example,
in a clinical trial of a new drug, the null hypothesis
might be that the new drug is no better, on
average, than the current drug. We would write
• H0: there is no difference between the two
drugs on an average.
The hypothesis that are proposed with the intent of
receiving a rejection.
We hypothesize the opposite of what is desired to be
proved.
For example a) if we want to show that sales and
advertisement expenditure are related, we formulate
the null hypothesis that they are not related.
b) If we want to conclude that the new sales training
programme is effective , we formulate…
c) If we want to prove the average wages of skilled
workers in town 1 is greater than that of town 2, we
formulate….
Alternative hypothesis
– The alternative hypothesis, HA, is a statement of what a
statistical hypothesis test is set up to establish. For example, in
the clinical trial of a new drug, the alternative hypothesis might
be that the new drug has a different effect, on average,
compared to that of the current drug. We would write
– HA: the two drugs have different effects, on average.
– or
– HA: the new drug is better than the current drug, on
average.

– The result of a hypothesis test:


– ‘Reject H0 in favour of HA’ OR ‘Do not reject H0’
Summary of Forms for Null and Alternative
Hypotheses about a Population Mean
The equality part of the hypotheses always appears
in the null hypothesis.
In general, a hypothesis test about the value of a
population mean μ must take one of the following
three forms (where μ0 is the hypothesized value of
the population mean).

One-tailed One-tailed Two-tailed


(lower-tail) (upper-tail)
Example Cool drink manufacturing.
Type I Type I and Type II ErrorsErrors
1. Type I error refers to the situation when we reject the null
hypothesis when it is true (H0 is wrongly rejected).
e.g H0: there is no difference between the two drugs on average.
Type I error will occur if we conclude that the two drugs produce
different effects when actually there isn’t a difference.
Prob(Type I error) = significance level = α

2. Type II error refers to the situation when we accept the null


hypothesis when it is false.
H0: there is no difference between the two drugs on average.
Type II error will occur if we conclude that the two drugs produce
the same effect when actually there is a difference.
Prob(Type II error) = ß
Type I and Type II Errors

Population Condition

H0 True H0 False
Conclusion

Accept H0 Correct
Type II Error
Decision

Reject H0 Correct
Type I Error
Decision
Selecting and interpreting significance
level Selecting and interpreting
1. Deciding on a criterion for accepting or rejecting the null hypothesis.
significance
2. Significance level refers level
to the percentage of sample means that is outside
certain prescribed limits. E.g testing a hypothesis at 5% level of
significance means
▪ that we reject the null hypothesis if it falls in the two regions of area
0.025.
▪ Do not reject the null hypothesis if it falls within the region of area 0.95.
▪ The level of significance denotes the probability of rejecting the null
hypothesis when it is true.
▪ The value of alpha varies from problem to problem but usually it is taken
as either 5 percent or 1 percent . At 5% level means that there are 5
chances out of hundred that a null hypothesis will get rejected when it
should be accepted. The researcher is 95% confident that a right decision
has been taken.
3. The higher the level of significance, the higher is the probability of
rejecting the null hypothesis when it is true.
(acceptance region narrows)
Steps of Hypothesis Testing

Step 1. Develop the null and alternative hypotheses.


Step 2. Specify the level of significance α.
Step 3. Collect the sample data and compute the test
statistic.
Test Statistic
The test statistic could be Z, t, Chi-square or F.
For larger sample size (n>30 ) and whether the
Population Standard deviation is known or
unknown Z test s used.
For Smaller sample size(n<30) if population
standard deviation is known then Z is used or t
test is used.
Formula is
p-Value Approach
Step 4. Use the value of the test statistic to compute the
p-value.
Step 5. Reject H0 if p-value < α.
If it is a right tail(upper tail- alternative hypothesis
will be greater than symbol) test then pick up the
probability value from the z table subtract with 1
and if that is less than .05/.01 then reject the null
hypothesis.
If it is a left tail (lower tail- alternative hypothesis
will be less than symbol) test then pick up the
probability value from the z table then see that if
it is less than .05/.01 then reject the null
hypothesis.
• If it is a two tail test (alternate hypothesis is
not equal to sign) then pick up the probability
value from the Z table(if Z is +ve subtract the
probability value from 1 and multiply by two,
if Z is –ve take the probability value as it is and
multiply by two) and if it is less than .05/.01
then reject the null hypothesis.
Critical Value Approach

Step 5. Use the value of the test statistic and the rejection
rule to determine whether to reject H0.
Critical Value Approach to
One-Tailed Hypothesis Testing
■ The test statistic z has a standard normal probability
distribution.
■ We can use the standard normal probability
distribution table to find the z-value with an area
of α in the lower (or upper) tail of the distribution.
■ The value of the test statistic that established the
boundary of the rejection region is called the
critical value for the test.
● The rejection rule is:
• Lower tail: Reject H0 if z < -zα
• Upper tail: Reject H0 if z > zα
Critical Value Approach to
Two-Tailed Hypothesis Testing
■ The critical values will occur in
both the lower and
upper tails of the standard
■normal curve.
Use the standard normal probability distribution
table to find zα/2 (the z-value with an area of α/2 in
the upper tail of the distribution).
● The rejection rule is:
Reject H0 if z < -zα/2 or z > zα/2.
Two-Tailed Tests About a Population Mean:
σ Known
• Example: Glow Toothpaste
The production line for Glow toothpaste is
designed to fill tubes with a mean weight of 6 oz.
Periodically, a sample of 30 tubes will be selected in
order to check the filling process.
Quality assurance procedures call for the
continuation of the filling process if the sample
results are consistent with the assumption that the
mean filling weight for the population of toothpaste
tubes is 6 oz.; otherwise the process will be adjusted.
Two-Tailed Tests About a Population Mean:
σ Known
● Example: Glow Toothpaste
Assume that a sample of 30 toothpaste tubes
provides a sample mean of 6.1 oz. The population
standard deviation is believed to be 0.2 oz. and the
hypothesized population mean is 6 oz.

Perform a hypothesis test, at the .03 level of


significance, to help determine whether the filling
process should continue operating or be stopped and
corrected.
Two-Tailed Tests About a Population Mean:
σ Known
■ p –Value and Critical Value Approaches

1. Determine the hypotheses. H0: μ = 6


Ha :

2. Specify the level of significance. α = .03

3. Compute the value of the test statistic.


Two-Tailed Tests About a Population Mean:
σ Known
■ p –Value Approach

4. Compute the p –value.


For z = 2.74, cumulative probability = .9969
p–value = 2(1 − .9969) = .0062

5. Determine whether to reject H0.


Because p–value = .0062 < α = .03, we reject H0.
There is sufficient statistical evidence to
infer that the alternative hypothesis is true
(i.e. the mean filling weight is not 6 ounces).
Two-Tailed Tests About a Population Mean:
σ Known
■ Critical Value Approach

4. Determine the critical value and rejection rule.

For α/2 = .03/2 = .015, z.015 = 2.17


Reject H0 if z < -2.17 or z > 2.17

5. Determine whether to reject H0.


Because 2.74 > 2.17, we reject H0.
There is sufficient statistical evidence to
infer that the alternative hypothesis is true
(i.e. the mean filling weight is not 6 ounces).
2. On a typing test, a random sample of 36 graduates of a
secretarial school averaged 73.6 words with a
standard deviation of 8.10 words per minute. Test an
employers claim that the school’s graduates average
less than 75.0 words per minute using the 5 percent
level of significance.

3. It is known from the past studies that the monthly


average household expenditure on the food item in a
locality is Rs.2700 with a standard deviation of Rs.160.
An economist took a random sample of 25 households
from the locality and found their monthly household
expenditure on food items to be Rs.2790. At .01 level
of significance, can we conclude that the average
household expenditure on the food items greater
than Rs.2700.
3.The company XYZ manufacturing bulbs
hypothesizes that the life of its bulbs is 145
hours with a known standard deviation of 210
hours. A random sample of 25 bulbs gave a
mean life of 130 hours. Using a 0.05 level of
significance, can the company conclude that
the mean life of bulbs is less than the 145
hours?
Examples
4. A weight reducing program that includes a strict
diet and exercise claims on its online
advertisement that it can help an average
overweight person lose 10 pounds in three
months. Following the program’s method a group
of twelve overweight persons have lost 8.1 5.7
11.6 12.9 3.8 5.9 7.8 9.1 7.0 8.2 9.3 and
8.0 pounds in three months. Test at 5% level of
significance whether the program’s advertisement
is overstating the reality.
Tests About a Population Mean:
σ Unknown
• Test Statistic

This test statistic has a t distribution


with n - 1 degrees of freedom.
Tests About a Population Mean:
σ Unknown

● Rejection Rule: Critical Value Approach


H0: μ > μ0 Reject H0 if t < -tα

H0: μ < μ0 Reject H0 if t > tα

H0: μ = μ0 Reject H0 if t < - tα/2 or t > tα/2


Example: Highway Patrol
• One-Tailed Test About a Population Mean: σ Unknown
A State Highway Patrol periodically samples
vehicle speeds at various locations on a particular
roadway. The sample of vehicle speeds is used to
test the hypothesis H0: μ < 65.
The locations where H0 is rejected are deemed the
best locations for radar traps. At Location F, a
sample of 64 vehicles shows a mean speed of 66.2
mph with a standard deviation of 4.2 mph. Use α
= .05 to test the hypothesis.
One-Tailed Test About a Population Mean:
σ Unknown
■ Critical Value Approaches

1. Determine the hypotheses. H0: μ < 65


Ha: μ > 65

2. Specify the level of significance. α = .05

3. Compute the value of the test statistic.


One-Tailed Test About a Population Mean:
σ Unknown
■ Critical Value Approach

4. Determine the critical value and rejection rule.

For α = .05 and d.f. = 64 – 1 = 63, t.05 = 1.669


Reject H0 if t > 1.669

5. Determine whether to reject H0.


Because 2.286 > 1.669, we reject H0.
We are at least 95% confident that the mean speed of
vehicles at Location F is greater than 65 mph. Location
F is a good candidate for a radar trap.
Hypothesis testing

Population Proportion
A Summary of Forms for Null and Alternative
Hypotheses About a Population Proportion
● The equality part of the hypotheses always appears
in the null hypothesis.
■ In general, a hypothesis test about the value of a
population proportion p must take one of the
following three forms (where p0 is the hypothesized
value of the population proportion).

H0 : p > p 0 H0 : p < p 0 H0 : p = p 0
Ha: p < p0 Ha: p > p0 Ha: p ≠ p0

One-tailed One-tailed Two-tailed


(lower tail) (upper tail)
Tests About a Population Proportion

● Test Statistic

where:

assuming np > 5 and n(1 – p) > 5


Tests About a Population Proportion

● Rejection Rule: p –Value Approach


Reject H0 if p –value < α
● Rejection Rule: Critical Value Approach
H0: p < p0 Reject H0 if z > zα

H0: p > p0 Reject H0 if z < -zα

H0: p = p0 Reject H0 if z < -zα/2 or z > zα/2


Two-Tailed Test About a
Population Proportion
● Example: National Safety Council (NSC)
For a Christmas and New Year’s week, the
National Safety Council estimated that 500 people
would be killed and 25,000 injured on the nation’s
roads. The NSC claimed that 50% of the accidents
would be caused by drunk driving.
A sample of 120 accidents showed that 67 were
caused by drunk driving. Use these data to test the
NSC’s claim with α = .05.
Two-Tailed Test About a
Population Proportion
■ p –Value and Critical Value Approaches

1. Determine the hypotheses.

2. Specify the level of significance. α = .05

3. Compute the value of the test statistic.

a common
error is using
in this formula
Two-Tailed Test About a
Population Proportion
■ p−Value Approach

4. Compute the p -value.


For z = 1.28, cumulative probability = .8997
p–value = 2(1 − .8997) = .2006

5. Determine whether to reject H0.


Because p–value = .2006 > α = .05, we cannot reject H0.
Two-Tailed Test About a
Population Proportion
■ Critical Value Approach

4. Determine the criticals value and rejection rule.

For α/2 = .05/2 = .025, z.025 = 1.96


Reject H0 if z < -1.96 or z > 1.96

5. Determine whether to reject H0.

Because 1.278 > -1.96 and < 1.96, we cannot reject H0.

You might also like