Hypothesis Testing

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 77

MEDITERRANEAN SCHOOL OF BUSINESS

C O U R S E : B U S I N E S S S TAT I S T I C S ( Q M M 5 0 1 )

PROFESSOR: Dr. Dorra Louati and Dr. Houda Boubaker

Fall 2021

01/09/2023 SOUTH MEDITERRANEAN UNIVERSITY 1


Chapter 6
Hypothesis Testing
Chapter Outline
1. Introduction to hypothesis testing
2. Hypothesis test about a population mean (σ known)
3. Hypothesis test about a population mean (σ unknown)
4. Hypothesis test about a population proportion
5. Hypothesis test about a population variance

3
Introduction to Hypothesis Testing
Statistical Inference
Hypothesis testing is the second form of statistical inference.

Recall that statistical inference is the process by which we acquire information


and draw conclusions about populations from samples.
Introduction to Hypothesis Testing
What is a Hypothesis?
A hypothesis is a claim
(assumption) about a
population parameter:

◦ population mean
Example: The mean monthly cell phone bill
of this city is µ = $42

◦ population proportion
Example: The proportion of adults in this
city with cell phones is P = .68
Introduction to Hypothesis Testing
The Null Hypothesis, H0
The null hypothesis, H0, refers to the status quo (the current
state of things)
Example: The average number of TV sets in U.S. Homes is 3 or more
( ) H0 : μ  3
Is always about a population parameter, not about a
sample statistic

H0 : μ  3 H0 : x  3
Introduction to Hypothesis Testing
The Null Hypothesis, H0

Begin with the assumption that the null hypothesis is true


◦ Similar to the notion of innocent until proven guilty
Refers to the status quo (the current state of things)
Always contains “=” , “≤” or “” sign
Introduction to Hypothesis Testing
The Alternative Hypothesis, H1
The alternative hypothesis, H1, is the opposite of the null hypothesis
◦ e.g.: The average number of TV sets in U.S. homes is less than 3 ( H 1: µ < 3 )

Challenges the status quo

Always contains the “≠” , “<” or “>” sign


Is generally the hypothesis that needs to be supported) by the researcher – a research
hypothesis.
◦ Needs evidence from the sample to support his belief
Introduction to Hypothesis Testing
Formulating Hypotheses
Example 1: Ford motor company has worked to reduce
road noise inside the cab of the redesigned F150 pickup
truck. It would like to report in its advertising that the
truck is quieter. The average of the prior design was at
least 68 decibels (noise level).

What is the appropriate hypothesis test?


Introduction to Hypothesis Testing
Formulating Hypotheses

The appropriate test is

H0: µ ≥ 68 (the truck is not quieter) current situation


H1: µ < 68 (the truck is quieter) wants to support

If the null hypothesis is rejected, Ford has sufficient evidence


to support that the truck is now quieter.
Introduction to Hypothesis Testing
Formulating Hypotheses
Example 2: The average annual income of
buyers of Ford F150 pickup trucks is claimed to
be $65,000 per year. An industry analyst would
like to challenge this claim.

What is the appropriate hypothesis test?


Formulating Hypotheses

The appropriate test is

H0: µ = 65,000 (income is as claimed) status quo

HA: µ ≠ 65,000 (income is different than claimed)

The analyst will believe the claim unless sufficient evidence is found to
discredit it.
Introduction to Hypothesis Testing
Hypothesis Testing Process
Claim: the population mean age is 50.
Null Hypothesis: H0: µ = 50
Population
Now select a random sample:

Sample
Suppose the sample Is x = 20 If not likely,
mean age is 20: likely if REJECT
x = 20 µ = 50? Null Hypothesis
Introduction to Hypothesis Testing
Reason for Rejecting H0
Sampling Distribution of x

x
20 μ = 50
If H0 is true
If it is unlikely that ... then we
we would get a reject the null
sample mean of ... if in fact this were hypothesis that
this value ... the population mean… μ = 50.
Introduction to Hypothesis Testing
Rejection and Non-Rejection Regions
If the sample mean is close to the stated population mean, the null
hypothesis is not rejected.
If the sample mean is far from the stated population mean, the null
hypothesis is rejected.
How far is “far enough” to reject H0?
The critical value of a test statistic creates a “line in the sand” for
decision making -- it answers the question of how far is far enough.

BUSINESS STATISTICS II (WINTER SESSION 2015-16) 15


Introduction to Hypothesis Testing
Rejection and Non-Rejection Regions
Sampling distribution
of the test statistic

Region of Region of
rejection rejection
Region of
non-rejection
Critical
values
“Too far away” from
mean of sampling
distribution

BUSINESS STATISTICS II (WINTER SESSION 2015-16) 16


Introduction to Hypothesis Testing
Rejection and Non-Rejection Regions
Conceptually and graphically, statistical outcomes that result in the rejection of the null
hypothesis lie in what is termed the rejection region
Statistical outcomes that fail to result in the rejection of the null hypothesis lie in what is
termed the non-rejection region

BUSINESS STATISTICS II (WINTER SESSION 2015-16) 17


Introduction to Hypothesis Testing
Outcomes and Probabilities
Possible Hypothesis Test Outcomes

State of Nature
Decision H0 True H0 False
Do Not
No error Type II Error
Reject
(1 - a ) (β)
H0
Reject Type I Error No Error
H0 (a) (1-β)
Introduction to Hypothesis Testing
Errors in Making Decision
The confidence coefficient (1-α) is the probability of not rejecting H0 when it is true.

The confidence level of a hypothesis test is (1-α)*100%.

The power of a statistical test (1-β) is the probability of rejecting H0 when it is false.

19
BUSINESS STATISTICS II (WINTER SESSION 2015-16)
Introduction to Hypothesis Testing
Errors in Making Decision
Type I Error
◦ Reject a true null hypothesis
◦ Considered a serious type of error
The probability of Type I Error is 

Type II Error
◦ Fail to reject a false null hypothesis
The probability of Type II Error is β
Introduction to Hypothesis Testing Type
I & II Error Relationship
 Type I and Type II errors cannot happen at
the same time
 Type I error can only occur if H0 is true
 Type II error can only occur if H0 is false

If Type I error probability (  ) , then


Type II error probability ( β )
Level of Significance, 
The level of significance, a, defines unlikely values of sample statistic if null
hypothesis is true
◦ Defines the rejection region of the sampling distribution
◦ Typical values are .01, .05, or .10
Is selected by the researcher at the beginning

Provides the critical value(s) of the test


Process of Hypothesis Testing:
The Rejection Region approach
1. Specify population parameter of interest
2. Formulate the null and alternative hypotheses
3. Specify the desired significance level,
4. Find the rejection region
5. Take a random sample and determine whether or not the sample
result (Test Statistic computed from the sample) is in the rejection
region
6. Reach a decision and draw a conclusion
Hypothesis Testing Example
A study states that the true mean # of TV sets in US
homes is 3 or more. You believe that the number of TV’s
is less than that. Test whether your belief is correct.
Assume σ = 0.8

 1. Specify the population value of interest


 The mean number of TVs in US homes

 2. Formulate the appropriate null and alternative


hypotheses
 H : μ  3 HA: μ < 3
0
 3. Specify the desired level of significance
 Suppose that  = .05 is chosen for this test
Hypothesis testing
To test our hypotheses, we can use two different approaches:

The rejection region approach (typically used when computing statistics


manually), and

The p-value approach (which is generally used with a computer and statistical
software).

We will explore both in turn…


Hypothesis Testing Example
4. Determine the rejection region

 = .05

Reject H0 Do not reject H0

-zα= -1.645 0

This is a one-tailed test with  = .05.


Since σ is known, the cutoff value is a z value:
Reject H0 if z <- z = -1.645 ; otherwise do not reject H0
Hypothesis Testing Example
5. Obtain sample evidence and compute the test statistic
Suppose a sample is taken with the following results: n = 100, = 2.84
( = 0.8 is assumed known)
◦ Then the test statistic is:

xμ 2.84  3  .16


z      2.0
σ 0.8 .08
n 100
Hypothesis Testing Example
6. Reach a decision and interpret the result

 = .05

z
Reject H0 Do not reject H0

-1.645 0
-2.0

Since z = -2.0 < -1.645, we reject the null


hypothesis that the mean number of TVs in US
homes is at least 3. There is sufficient evidence
that the mean is less than 3.
Hypothesis Testing Example (continued)

An alternate way of constructing rejection region:

Now
expressed
 = .05 in x, not z
units
x
Reject H0 Do not reject H0

2.8684 3
2.84 σ 0.8
x α  μ  zα  3  1.645  2.8684
n 100

Since x = 2.84 < 2.8684, we reject the null hypothesis


Critical Value for Lower Tail Test
H0: μ ≥ 3
 The cutoff value, -zα or xα ,
is called a critical value HA: μ < 3
a

Reject H0 Do not reject H0


-zα 0
xα µ=3
σ
x   μ  z
n
Critical Value for Upper Tail Test

 The cutoff value, zα or xα , H0: μ ≤ 3

is called a critical value HA: μ > 3

Do not reject H0 Reject H0


0 zα
µ=3 xα

σ
x   μ  z
n
Critical Values for
Two Tailed Tests

 There are two cutoff H0: μ = 3


values (critical values): HA: μ ¹
± zα/2 3

or /2 /2
xα/2
Lower
Reject H0 Do not reject H0 Reject H0
xα/2 -zα/2 0 zα/2
Upper
xα/2 µ=3 xα/2
Lower Upper

σ
x /2  μ  z /2
n
The Rejection Region
Level of Significance a
Lower tail test Upper tail test Two tailed test
Example: Example: Example:
H 0: μ ≥ 3 H 0: μ ≤ 3 H 0: μ = 3
HA: μ < 3 HA: μ > 3 HA: μ ≠ 3

a a a /2 a/2

-zα 0 0 zα -zα/2 0 zα/2


xα xα x α/2(L) x α/2(U)
Do not Do not Do not
Reject H0 Reject H0 Reject H0 Reject H0
reject H0 reject H0 reject H0

Reject H0 if z < -zα Reject H0 if z > zα Reject H0 if z < -zα/2 or z > zα/2
i.e., if x < xα i.e., if x > xα i.e., if x < xα/2(L) or x > xα/2(U)
p-Value Approach to Testing
p-value: probability of obtaining a test statistic more extreme
( ≤ or  ) than the observed sample value given H0 is true
◦ Also called observed level of significance
◦ Smallest value of  for which H0 can be rejected
Compare the p-value with 
◦ If p-value <  , reject H0
◦ If p-value   , do not reject H0
p-value example
Example: How likely is it to see a sample mean of 2.84 (or something further below the mean) if
the true mean is  = 3.0?

 = .05
P( x  2.84 | μ  3.0)
p-value =.0228
 
 2.84  3.0 
 P z  
 0.8 
 100  3
2.8684 x
 P(z  2.0)  .0228 2.84
-1.645 0 z
-2.0
p-value example (continued)

Compare the p-value with 


◦ If p-value <  , reject H 0

◦ If p-value   , do not reject H 0

 = .05
Here: p-value = .0228
 = .05 p-value =.0228
Since .0228 < .05, we reject
the null hypothesis
3
2.84
Example: Upper Tail z Test
for Mean ( Known)
A phone industry manager thinks that customer monthly
cell phone bill have increased, and now average over $52
per month. The company wishes to test this claim.
Assume  = 10 is known.

Form hypothesis test:


H0: μ ≤ 52 the average is not over $52 per month
HA: μ > 52 the average is greater than $52 per month
(i.e., is there sufficient evidence to support the
manager’s claim)
Example: Find Rejection Region
(continued)

Suppose that  = .10 is chosen for this test

Find the rejection region: Reject H0

 = .10

Do not reject H0 Reject H0


0 zα=1.28

Reject H0 if z > 1.28


Example: Test Statistic (continued)

Obtain sample evidence and compute the test statistic


Suppose a sample is taken with the following results: n = 64, x = 53.1 (=10
was assumed known)

◦ Then the test statistic is:

xμ 53.1  52
z    0.88
σ 10
n 64
Example: Decision
Reach a decision and interpret the result:
(continued)

Reject H0

 = .10

Do not reject H0 Reject H0


0
1.28
z = .88

Do not reject H0 since z = 0.88 ≤ 1.28


i.e.: there is not sufficient evidence that the
mean bill is over $52
p -Value Solution (continued)

Calculate the p-value and compare to 

p-value = .1894
P(x  53.1|μ  52.0)
Reject H0
 = .10  
 53.1  52.0 
P z
 10 
 
0  64 
Do not reject H0 Reject H0
1.28  P(z  0.88)  1  .8106
z = .88
 .1894

Do not reject H0 since p-value = .1894 >  = .10


p-value of a two-Tail Test
The p-value in a two-tail test is determined by
p-value = P(Z < – |z|)+P(Z > |z|) =2 P(Z > |z|) =2 P(Z < – |z|)

where z is the actual value of the test statistic and |z| is its absolute value.
Hypothesis Tests about a Population
Mean: Known
Lower tail test Upper tail test Two-tailed test
Hypotheses

Test Statistic

P-Value

Rejection Rule: P-value Reject H0 if Reject H0 if Reject H0 if


Approach
p-value≤α p-value≤α p-value≤α
Rejection Rule: Critical
Value Approach

43
Hypothesis tests for the mean µ (σ is
known): Assumptions
The z formula can be used to test hypothesis about
a single population mean if
 the sample size n is > 30 for any population, and
 X is normally distributed if n < 30

44
Hypothesis tests for the mean

Hypothesis
Tests for 

 Known  Unknown
(z-test) (t-test)

45
Inference about μ (σ Unknown)
Assumptions
◦ Population standard deviation is unknown
◦ Population is normally distributed
◦ If population is not normal, use large sample
(n large)

» Use Student t Distribution for inferences about population mean m.

12.46
Inference about μ (σ Unknown)
When s is unknown, we use its point estimator s

and the z-statistic is replaced by the t-statistic.


The t value depends on the degrees of freedom (df or n)

n=n-1 where n is the sample size

12.47
Example 2

In recent years a number of companies have gone into the business of collecting used
newspapers from households and recycling them.

The firm would make a profit if the mean weekly newspaper collection from each
household exceeded 2.0 pounds.

A random sample of 148 households was drawn from a large community, and the
weekly weight of newspapers discarded for recycling for each household was
recorded with the following results: .
x  2.18 and s  0.981
Do these data provide sufficient evidence to conclude that a recycling plant would be
profitable?

12.48
Example 2 IDENTIFY

The parameter to be tested is the population mean µ, the average amount of newspapers
discarded per household.

The cost of a Type I error is quite high; so let =0.01.

We want to know if there is enough evidence to conclude that the mean is greater than 2.
Thus,
H1: µ > 2

Therefore, the null hypothesis is:


H0: µ ≤ 2

12.49
Example 2 IDENTIFY

Since s is unknown, the test statistic is:


x 
t , with ν = n −1
s/ n

Because the alternative hypothesis is:


H1: µ > 2

the rejection region becomes:


t  t ,  t.01,147  t.01,150  2.351
12.50
Example 2 COMPUTE

x  2.18
s  0.981
x   2.18  2.0
t   2.23
s 0.981
n 148
Since 2.23 < 2.351, we do not have enough evidence to reject the null hypothesis.

The p-value computed by the computer is 0.0134.

12.51
Example 2 INTERPRET

The value of the test statistic is t = 2.23 and its p-value is .0134.

There is not enough evidence at the 1% significance level to infer that


the mean weight of discarded newspapers is greater than 2.0.

Note that there is some evidence; the p-value is .0134. However,


because we wanted the Type I error to be small we insisted on a 1%
significance level.

Thus, we cannot conclude that the recycling plant would be profitable.

12.52
Hypothesis Testing for m with s
unknown
Write the rejection region for a left-tail test

Write the rejection region for a two-tail test

12.53
Example 3
The U.S. Farmers’ Production Company builds large harvesters. For a harvester to be properly
balanced when operating, a 25-pound plate is installed on its side. The machine that produces
these plates is set to yield plates that average 25 pounds. The distribution of plates produced from
the machine is normal. However, the shop supervisor is worried that the machine is out of
adjustment and is producing plates that do not average 25 pounds

54
Example 3
To test this concern, he randomly selects 20 of the plates produced the day before and weighs
them.
The sample mean and sample standard deviation are equal to 25.51 and 2.1933

55
Example 3
H0: μ = 25
a/2 = 0.025 a/2 = 0.025
H1: μ ¹ 25

0
• a = 0.05 Reject H0 Do not reject H0 Reject H0
t 24,0.025
-t 24,0.025
• n = 20, df = 20-1=19 -2.093 1.04 2.093
•  is unknown, so t STAT 
X μ

25.51  25
 1.04
S 2.1933
use a t statistic n 20
• Critical Value:
Do not reject H0: insufficient evidence that true
±t19,0.025 = ± 2.093 mean weight is different from 25 pounds

56
Example 3
Connection of two-tail tests to confidence intervals
For X-bar = 25.51, s = 2.193 and n = 20, the 95% confidence interval
for µ is 24.484 ≤ μ ≤ 26.536
Since this interval contains the hypothesized mean (25), we do not reject
the null hypothesis at  = 0.05

57
Example 4
The U.S. Department of Agriculture show that the average size of farms has
increased since 1940. In 1940, the mean size of a farm was 174 acres; by 1997,
the average size was 471 acres. Between those years, the number of farms
decreased but the amount of tillable land remained relatively constant, so now
farms are bigger. This trend might be explained, in part, by the inability of small
farms to compete with the prices and costs of large-scale operations and to
produce a level of income necessary to support the farmers’ desired standard of
living.

58
Example 4
Suppose an agribusiness researcher believes the average size of farms
has now increased from the 1997 mean figure of 471 acres. To test
this notion, she randomly sampled 23 farms across the United States
and ascertained the size of each farm from county records. The data
she gathered follow. Use a 5% level of significance to test her
hypothesis. Assume that number of acres per farm is normally
distributed in the population.
445 489 474 505 553 477 454 463 466 557 502 449 438 500 466 477
557 433 545 511 590 561 560

59
Example 4
H0: μ ≤ 471; H1: μ > 471
Suppose that  = 0.05 is chosen for this test
and n = 23. Find the rejection region.
Reject H0

 =0.05

0
Do not reject H0 Reject H0

T0.05,22 = 1.717

Reject H0 if t > 1.717


60
Example 4
X-bar = 498.78, and s = 46.94
The test statistic is equal to

Xμ 498.78  471


t    2.84
S 46.94
n 23

61
Example 4
Reject H0

 = 0.05

0
Do not reject H0 Reject H0
1.717
t = 2.84

Reject H0 since t = 2.84 > 1.717. There is sufficient


evidence that the mean is over 471 acres.

62
Example: Utilizing The p-value for The
Test
Calculate the p-value and compare to
 (the p-value below is calculated
using a software)
Reject H0 since p-value = .0048 < 
= .05

63
SPSS demonstration
Select Analyze / Compare Means / One-Sample T Test…

64
SPSS demonstration
Choose the test value
Click on Options and choose the sigificance level

65
SPSS demonstration
SPSS conducts the two-tailed test.
To get the p-value of the one-tailed test, you should divide the printed p-value by 2

66
Hypothesis tests about a population
Mean ( unkown)
Lower tail test Upper tail test Two-tailed test
Hypotheses

Test Statistic

P-Value

Rejection Rule: P-value Reject H0 if Reject H0 if Reject H0 if


Approach p-value≤α p-value≤α p-value≤α
Rejection Rule: Critical
Value Approach

67
Inference about Population Proportion
When data are nominal, we count the number of occurrences of each value and
calculate proportions.
Thus, the parameter of interest in describing a population of nominal data is the
population proportion p.

Recall that the sample proportion is given by the statistic:

where p-hat () is the sample proportion and x the number of successes in a sample
size of n items.

12.68
Inference: Population Proportion…
 

12.69
Example: Z Test for Proportion
A marketing company claims
that it receives 8% responses
from its mailing. You believe
that the response rate is
different. A random sample of
500 mails were surveyed. 25
received responses. Check:
Test at the  = .05 n p = (500)(.08) = 40 
significance level whether the n(1- p) = (500)(.92) = 460
claim is wrong.

12.70
Z Test for Proportion: Solution

Test Statistic:
H0: p = .08
p̂  p .05  .08
HA: p ¹ .08 z   2.47
p(1  p) .08(1  .08)
a = .05
n = 500, p̂= .05 n 500

Critical Values: ± 1.96 Decision:


Reject Reject Reject H0 at  = .05
Conclusion:
.025 .025
There is sufficient
-1.96 0 1.96 z evidence to reject the
-2.47 company’s claim of 8%
response rate. 12.71
Hypothesis test about a population
proportion
Lower tail test Upper tail test Two-tailed test

Hypotheses
pˆ  p 0 pˆ  p 0 pˆ  p 0
Test Statistic z  z  z 
p 0 (1  p 0 ) p 0 (1  p 0 ) p 0 (1  p 0 )
n n n
P-Value
Rejection Rule: P- Reject H0 if Reject H0 if Reject H0 if
value Approach p-value≤α p-value≤α p-value≤α
Rejection Rule:
Critical Value
Approach

72
Tests of the Variance of a Normal
Distribution
 Goal: Test hypotheses about the population
variance, σ2 (e.g., H0: σ2 = σ02)

 If the population is normally distributed,


2
2 (n  1)s
 n 1 
σ2
has a chi-square distribution with (n – 1) degrees of freedom

COPYRIGHT © 2013 PEARSON EDUCATION, INC. PUBLISHING AS PRENTICE HALL


Tests of the Variance of a Normal
Distribution
(continued)

The test statistic for hypothesis tests about


one population variance is

(n  1)s2
χn21  2
σ0

COPYRIGHT © 2013 PEARSON EDUCATION, INC. PUBLISHING AS PRENTICE HALL


Decision Rules: Variance
Population variance

Lower-tail test: Upper-tail test: Two-tail test:


H0: σ2  σ02 H0: σ2 ≤ σ02 H0: σ2 = σ02
H1: σ2 < σ02 H1: σ2 > σ02 H1: σ2 ≠ σ02

a a a/2 a/2

χn21,1 χ n21, χn21,1 / 2 χ n21, / 2

Reject H0 if Reject H0 if Reject H0 if


χ 2
χ 2 χ n21  χ n21, χ n21  χ n21, / 2
n 1 n 1,1 or
χ n21  χ n21,1 / 2
COPYRIGHT © 2013 PEARSON EDUCATION, INC. PUBLISHING AS PRENTICE HALL CHAP 11-75
Example
The quality control manager of Stonehead Chemicals has asked you to determine if the variance
of impurities in its shipments of fertilizer exceeds the established standard. This standard states
that for 100-pound bags of fertilizer, the variance in the pounds of impurities does not exceed 4.
A random sample of 20 bags is obtained, and the pounds of impurities are measured for each bag.
The sample variance is computed to be 6,62. Based on the assumption that the population has a
normal distribution, what is your conclusion?

76
77

You might also like