You are on page 1of 39

CHAPTER III

HYPOTHESIS TESTING
• A hypothesis is a statement or assertion
about the state of nature (about the true
value of an unknown population parameter):
The accused is innocent
  = 100
• Every hypothesis implies its contradiction
or alternative:
The accused is guilty
 100
• A hypothesis is either true or false, and
you may fail to reject it or you may reject
it on the basis of sample data
Types of Hypothesis Testing
The null hypothesis, H0
 Often represents the status quo situation or an
existing belief.
 Is maintained, or held to be true, until a test
leads to its rejection in favor of the alternative
hypothesis.
 We hold to be true until we have sufficient
statistical evidence to conclude otherwise.
 Mathematically stated by equality signs
(Greater or equal, less or equal and equality)
 Is accepted as true or rejected as false on the
basis of a consideration of a test statistic.
Alternative hypothesis, H1 or Ha

• Is the assertion of all situations 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.
Example: A soft drink bottling company’s
advertisement states that a bottle of its product
contains 330 milliliters (ml). But customers are
complaining that the company is under filling its
products. To check whether the complaint is true or
not, an inspector may test the following hypothesis:

HO: The average content of a bottle of this product


equals or exceeds 330 ml
H1: The average content of a bottle of this product
is less than 330 ml.
• 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.
Errors in Hypothesis Testing
• A decision may be incorrect in 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: Accept a false H0
• The Probability of a Type II error is denoted
by .
• 1 -  is called the power of the test.
Type I and Type II Errors
 A decision fail to reject (accept) or reject a
hypothesis may be:
 Correct
A true hypothesis may not be rejected
An innocent defendant may be acquitted
A false hypothesis may be rejected
A guilty defendant may be convicted
Incorrect
A true hypothesis may be rejected
An innocent defendant may be convicted
A false hypothesis may not be rejected
A guilty defendant may be acquitted
ACCEPTANCE AND REJECTION (CRITICAL) REGIONS
• The value that is a borderline between
acceptance and rejection is called the critical
value.
• The critical value is obtained from appropriate
statistical table such as standard normal
distribution table, the student t distribution
table
• Regions of non-rejection and Rejection for a
Two-Tailed Test, Z-statistics, 0.05 level of
significance.
Types of Tests
• Based on the form of the null and alternative
hypothesis, there are two types of tests: a one-sided
test and a two-sided test.
• A one-sided test: a test is said to be one sided (one
tailed) when the alternative hypothesis, H1, states a
direction
There are two kinds of one-sided test
• A left-tailed test: The less than sign is involved in the
alternative hypothesis.
 It has one rejection region at the left tail of the appropriate
distribution.
• A right-tailed test: The greater than sign is involved
in the alternative hypothesis.
 It has one rejection region at the right tail of the
appropriate distribution.
ACCEPTANCE AND REJECTION (CRITICAL) REGIONS
• Sampling Distribution for statistic Z for a one-Tailed
Test [right], 0.05 level of significance.
A one-sided test

A right-tailed test A left-tailed test


• Regions of non-rejection and Rejection for a Two-Tailed
Test, Z-statistics, 0.05 level of significance.

A two-tailed test
Steps in Hypothesis Testing
1. State the null and alternative hypothesis
2. Set decision rule:
 Based on level of significance and degrees of
freedom
3. Compute the test statistic and compare with values
obtained in step 2
 A test statistics z, or t depending the sample size
and standard deviation
4. Arrive at decision:
• Do not reject or reject HO
The p-Value approach
• 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 may be rejected using the
obtained value of the test statistic.

Rule: When the p-value is less than a , reject H0


Example: A company that delivers packages within a large
metropolitan area claims that it takes an average of 28 minutes
for a package to be deliverer to a certain destination with a
standard deviation of 5 minutes. In a 100 randomly selected
deliveries the mean delivery time is found to be 31.5 minutes.
Carry out a hypothesis test of the claim.

s 5
H0:  = 28 x  z  315
.  1.96
n 100
. 025

H1:   28
.  .98  30.52, 32.48
 315
Collect sample data: We can be 95% sure that the average time
n = 100 for all packages is between 30.52 and 32.48
minutes.
= 31.5
Since the asserted value, 28 minutes, is
s=5 not in this 95% confidence interval, we
Construct a 95% confidence interval may reasonably reject the null
for the average delivery times of all hypothesis.
packages:
Example: An automatic bottling machine fills cola into two liter
(2000 ml) bottles. A consumer advocate wants to test if the the
average amount filled by the machine into a bottle is less than 2000
ml. A random sample of 40 bottles coming out of the machine was
selected and the exact content of the selected bottles are recorded.
The sample mean was 1999.6 ml. The population standard
deviation is known from past experience to be 1.30 ml. Compute
the p-value for this test.

H0:   2000
H1:   2000
n = 40,  = 2000,
= 1999.6,
𝑥
¯ − 𝜇0
 = 1.3 𝑧=
𝜎
√𝑛
The test statistic is:
Testing Population Means
CASE I:

 s is known and the


 Population is normal.
 The sample size is at least 30.
 The test statistic to be used is Z
Example: Selam Hotel has been having average sales
of 500 teacups per day. Because of the development
of bus stand nearby, She expects to increase its
sales. For the first 50 days after the start of the
bus stand, She recorded an average daily sale of 550
teacups per day. From the past records, it is known
that the sales standard deviation is 50.
Solution:
Reject HO

We can conclude that the sample data indicate that


Selam’s Hotel sales have shown a considerable
increase.
Example: A workers’ union is on strike for
higher wages. The union claims that the mean
salary for workers is at most Birr 8,400 per
month.The legislator does not want to reject
the union’s claim, however, unless the
evidence is very strong against it. Assume
that salaries follow a normal distribution and
the population standard deviation is known to
be Birr 3000. A random sample of 64 workers
is obtained, and the sample mean is Br, 9,400.
Test if the state legislator accepts the
unions’ claim or not at 1% significance level.
Testing Population Means
CASE II:

 s is unknown but the sample standard deviation known


 The population is normal.
 The sample size is at least 30. (The population need not be
normal)
 The test statistic to be used is Z

𝑇𝑒𝑓h 𝑜𝑟𝑚𝑢𝑙𝑎 𝑓𝑜𝑟𝑐𝑎𝑙𝑐𝑢𝑙𝑎𝑡𝑖𝑛𝑔𝑍𝑖𝑠:


Example: As part of a survey to determine the extent of required in-cabin
storage capacity, a researcher needs to test the null hypothesis that the average
weight of carry-on baggage per person is  = 12 kg, versus the alternative
hypothesis that the average weight is not 12 kg. In a randomly selected 144
persons reveals that an average weight of 14.6 kg with a sample standard
deviation of 7.8 kgs. The analyst wants to test the null hypothesis at  = 0.05.

The Standard Normal Distribution


H0:  = 12
0.8
H1:   12 0.7 .95
0.6
0.5

For  = 0.05, critical values of z are ±1.96 0.4

x  0
0.3
.025 .025
z 0.2

The test statistic is: s 0.1


0.0

n -1.96  1.96 z

Do not reject H0 if: [-1.96  z 1.96]


Lower Rejection Nonrejection Upper Rejection
Region Region Region
Reject H0 if: [z <-1.96] or z 1.96]
Solution

n = 144 The Standard Normal Distribution


0.8

x = 14.6 0.7 .95


0.6
0.5
s = 7.8 0.4
0.3
.025 .025
x  0 14.6-12
0.2

z = 0.1

s 7.8 0.0

-1.96 1.96 z
n 144


Lower Rejection Non-rejection Upper Rejection
2.6 Region
Region Region
= 4
0.65

Since the test statistic falls in the upper rejection region, H0 is rejected, and
we may conclude that the average amount of carry-on baggage is more than
12 kgs.
Example: The average time it takes a computer to perform a
certain task is believed to be 3.24 seconds. It was decided to test
the statistical hypothesis that the average performance time of
the task using the new algorithm is the same, against the
alternative that the average performance time is no longer the
same, at the 0.05 level of significance. In a random sample of
200 tasks, the average time found to be 3.48 seconds with a
standard deviation of 2.8 seconds.

H0:  = 3.24
H1:   3.24

For  = 0.05, critical values


x of
 0z are ±1.96
z
s
The test statistic is: n

Do not reject H0 if: [-1.96  z 1.96]

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


The Standard Normal Distribution

0.8

0.7 .95
0.6

0.5

0.4

0.3
.025 .025
0.2

0.1

0.0

-1.96 1.96 z



Lower Rejection Non-rejection Upper Rejection


Region Region Region

Since the test statistic falls in the non-rejection region, H0 is


not rejected, and we may conclude that the average
performance time has not changed from 3.24 seconds.
Testing Population Means
CASE III :

 s is unknown but the sample standard deviation is known and


 The population is not normal.
 The sample size is less than 30. (The population need not be
normal)
 The test statistic is t distribution

𝑇h𝑒𝑓𝑜𝑟𝑚𝑢𝑙𝑎 𝑓𝑜𝑟𝑐𝑎𝑙𝑐𝑢𝑙𝑎𝑡𝑖𝑛𝑔𝑡𝑖𝑠:
Example: According to the Japanese National Land Agency,
average land prices in central Tokyo soared 49% in the first six
months of 1995. An international real estate investment company
wants to test this claim against the alternative that the average price
did not rise by 49%, at a 0.01 level of significance.

H0:  = 49
H1:   49
n = 18
For  = 0.01 and (18-1) = 17 df ,
critical values of t are ±2.898
x  0
t
s
The test statistic is:
n

Do not reject H0 if: [-2.898  t  2.898]

Reject H0 if: [t < -2.898] or t  2.898]


The t Distribution

0 .8

0 .7 .99
0 .6

0 .5

0 .4

0 .3
.005 .005
0 .2

0 . 1

0 .0

-2.898 2.898 t



Lower Rejection Non-rejection Upper Rejection


Region Region Region

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


rejected, and we may conclude that the average price has not
risen by 49%. Since the test statistic is in the lower rejection
region, we may conclude that the average price has risen by
less than 49%.
Example: Canon, Inc,. has introduced a copying machine that
features two-color copying capability in a compact system copier.
The average speed of the standard compact system copier is 27
copies per minute. Suppose the company wants to test whether the
new copier has the same average speed as its standard compact
copier. Conduct a test at an  = 0.05 level of significance.
n = 24
:  = 27
x = 24.6
:   27
s = 7.4
n = 24
For  = 0.05 and (24-1) = 23 df , x  0 24.6 - 27
critical values of t are ± 2.069 t  =
s 7.4
The test statistic is: n 24
x  0
t
s -2.4
=  1.59  Do not reject H
Do not reject if: [-2.069  tn 2.069] 1.51 0
Reject if: [t < -2.069] or t  2.069]
The t Distribution
0 .8
0 .7 .95
0 .6

0 .5
0 .4

0 .3
.025 .025
0 .2
0.1
0 .0

-2.069  2.069 t


Lower Rejection Non-rejection Upper Rejection
Region Region Region

Since the test statistic falls in the non rejection region, is not rejected,
and we may not conclude that the average speed is different from 27
copies per minute.
Hypothesis Tests for Population Proportions

• The steps followed for Mean hypothesis testing is the same


when dealing with population Proportions. the only difference
is the method for calculating the standard deviation
Standard error
– The standard deviation of a distribution of sample proportions is:

– The z-score is then found by comparing the sample statistic ( )


to the null hypothesis (p) and dividing by the standard deviation:
Hypothesis Tests for Population Proportions
• Example : Suppose the national unemployment rate is
3.5%. In a survey of n = 450 people in Addis, 22 people
are found to be unemployed. Officials claim that the local
unemployment rate is higher than the national average.
Test this claim at 0.05 significance level.

Step 1: Write the null and alternative hypotheses

Step 2: Decision Rule: Select the level of Significance and the critical
values or determine the P-value
• The critical value for a right-tailed test at 0.05 level is 1.65
Step 3: compute the test statistics

1.60
 A z-score of 1.6 corresponds to a probability of 0.4452, the
unemployment rate (0.0489) is higher than 0.0548 (0.5 -
0.4452)
 1.60, this is higher than 0.05, which means that it’s not
significant at 0.05 level of significance.
 You could have also compared the z-score of 1.6 to determine
if it’s significant at the 0.05 level
 Since 1.6 is not greater than 1.65, this tells you that it is not
significant at the 0.05 level
 You could have also compared the z-score of 1.6
to determine if it’s significant at the 0.05 level
 Since 1.6 is not greater than 1.65, this tells you
that it is not significant at the 0.05 level
Step 4: Decision: reject or Do not reject
 Since an unemployment rate of 0.0489 is not
significant at the 0.05 level, this tells us that we
should NOT reject the null hypothesis
 In other words, there is not enough evidence to
support the claim that this particular county has
an unemployment rate higher than the national
average
Hypothesis Tests for Population Proportions
Example : A random sample of n = 750 people is selected, of
whom 92 are left-handed. Use these sample data to test the
claim that 10% of the population is left handed. Use a P-value
approach.
Step 1: Write the null and alternative hypotheses
H 0 : p  .10 H a : p  .10
Step 2: Draw a sample and come up with a sample statistic
and the standard deviation of that sample
 n = 750
 The sample proportion is:
 The standard deviation is:
92
pˆ   0.12267
750

p (1  p) .10(1  .10)  .01095


n 
750
Step 3: Determine the P-value (or compare to critical values) and
determine the level of significance
pˆ  p .12267  .10
z  z  z  2.07
p (1  p ) / n .01095

 The probability that corresponds with 2.07 is .4808, so the probability


is .0192 (0.5 - .4808), but since this is a two-tailed test, the P-value is
0.0384 (0.0192 * 2)
 This is less than .05, which means that it is significant at
the .05 level
 You could have also just compared the z-score of 2.07 to the critical
values of a two-tailed test at the .05 level (1.96)
 Since 2.07 is greater than 1.96, this is significant at the .05
level
Step 4: Determine whether to reject or not reject the null
hypothesis
 we can reject the null hypothesis and support the claim that
the proportion of the population that is left-handed is not 10%
p-Value: Two-Tailed Tests
p-value=double the area to
left of the test statistic
=2(0.3446)=0.6892
0 .4

0 .3
f(z)

0 .2

0.1

0 .0
-5 0 5
-0.4 0.4
z

In a two-tailed test, we find the p-value by doubling the area in


the tail of the distribution beyond the value of the test statistic.

You might also like