0% found this document useful (0 votes)
54 views68 pages

Hypothesis Testing

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views68 pages

Hypothesis Testing

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 68

WHAT IS A HYPOTHESIS?

A hypothesis is a claim or a statement


regarding a population parameter which
may or may not be true , but need to be
verified by a random sample.
 Example 1:
Suppose a prospective business person wants to open a new
business and the local chamber of commerce office cites the
decade old data to claim that the mean household income in the
business district is Rs.80,000. Should the business person accept
this claim?

 Example 2:
It is known that approximately 15% of the students on a college
are regular smokers. An anti-smokers campaign is launched
island-wide to make students aware of the negative effects of
smoking on health. A month after the campaign, a survey of 72
students showed that 15 smoked regularly. Does it indicate that
the campaign was successful in reducing the percentage of
smokers?
WHAT IS HYPOTHESIS TESTING?
 Hypothesistesting is a procedure whereby we decide,
on the basis of information taken from a sample,
whether to accept or reject a hypothesis.

 This testing procedure has two hypothesis called,

- NULL HYPOTHESIS : 𝑯𝟎
-ALTERNATIVE HYPOTHESIS : 𝑯𝟏
THE NULL HYPOTHESIS & ALTERNATIVE HYPOTHESIS
 Null Hypothesis
Hypothesis to be test.
In general, the complement of the conclusion that
the researcher is seeking to reach becomes the
statement of null hypothesis.
Notation : H0

 Alternative Hypothesis
What we suppose or what will happen if null
hypothesis is not correct
Notation : H1
RULES FOR STATING STATISTICAL HYPOTHESES

I. What you hope or expect to be able to conclude as a


result of the test usually should be placed in the
alternative hypothesis.
II. The null hypothesis is the hypothesis to be tested
III. The null hypothesis should contain a statement of
equality, either =, ≤ or ≥.

Ex
H0 :  = 1000 vs. H1 :  ≠ 1000
H0 :  ≥ 1000 vs. H1 :  < 1000
H0 :  ≤ 1000 vs. H1 :  > 1000
IDENTIFICATION OF THE TEST STATISTICS
 The test statistic may assume many possible values which
depends on the particular sample drawn.
 The test statistic acts as a decision-maker.
 For example, When we want to test about population mean
when population variance is known,

H0 :  = 0 vs H 1 :  ≠ 0

The possible test statistic;

where 0 is a hypothesized value


DISTRIBUTION OF TEST STATISTIC
 Itis necessary to specify the probability distribution of the
test statistic.

For example, the distribution of the test statistic

Follows the standard normal distribution if the null


hypothesis is true.
TYPES OF ERRORS
 Type I Error – Reject H0 when H0 is true.
 = P(Reject H0 \ H0is true)
Type II Error – Don’t reject H0 when H0 is false.
 = P(Does not reject H0 \ is H0 false)
We couldn’t control both  and .

Occurrence of type I and type II errors


Decision from H0 is true H0 is false
sample
Reject H0 Wrong Correct
Type I error () (1-)
Don’t Reject H0 Correct Wrong
(1-) Type II error ()

The probability of type I error () is called the level of the test or
significance level.
SIGNIFICANCE LEVEL
 Significance level
The maximum probability of committing type I error,
which we specified in a test. (denoted by )
It specifies the area under the curve of the distribution.
If  =0.05
There is 95% confidence in accepting a hypothesis or
it could be wrong 5%.

/2
/2
(Significance
level)
ONE TAILED
 Weperform one tailed test, when the alternative
hypothesis is of the form “greater than ” or “Less than”.

When hypothesis is:


H0 :  ≥ 0 Vs H1 :  < 0 Rejection
Region

(Left tailed test)

Non-rejection Region
1- 
When hypothesis is
H0 :  ≤ 0 Vs H1 :  > 0
Non-rejection Region Rejection
(Right tailed test) 1-  Region

TWO TAILED TEST
When the alternative hypothesis is of the form “not equal
to”, we perform two tailed test,

When hypothesis is H0 :  = 0 Vs H1 :  ≠ 0

Rejection Region Rejection Region


/2 Non-Rejection /2
Region
1-
MAKING STATISTICAL DECISION
 Comparing Test Statistic and Critical Value
If the test statistic value falls in Rejection region
- Reject H0

 Comparing P-value and Significance level


P-value is the chance of getting the actual value for test
statistic when null hypothesis is true.

If the P-value is less than significance level


- Reject H0
POWER OF A SIGNIFICANT TEST
 The power of a significant test
It is the probability of rejecting a false null hypothesis.
In symbolic notation
Power = 1-  = Pr (Reject H0 | H0 is false)

Significance level
Significance

level 

-3 -2 -1 0 1
1 22 3
3
z

Power of the test


  1-

-3 -2 -1 0 1 z 2 3
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN

 Let X1, . . . , Xn be a sample from a population with mean


μ and standard deviation σ.
 let  0 be a known constant. Consider the following
hypothesis:
i. H0 :  ≤  0 vs H1 :  > 0

ii. H0 :  ≥ 0 vs H1 :  < 0

iii. H0 :  = 0 vs H1 :  ≠ 0
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN
 Case I : Data from normal population with known
variance
Corresponding estimator for population mean  is,
sample mean .
Test statistic :
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN
 Case II : Data from normal population with unknown
variance and Sample size is large
Corresponding estimator for population mean  is,
sample mean .
Test statistic :

ഥ − 𝝁𝟎
𝒙
~𝑵(𝟎, 𝟏)
𝑺ൗ
𝒏
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN
 Case III : Data from normal population with unknown
variance and sample size is small
When σ is Unknown, 𝜎ො = 𝑆. Corresponding estimator
for population mean  is, sample mean .
Test statistic :

ഥ − 𝝁𝟎
𝒙
~𝒕(𝒏−𝟏)
𝑺ൗ
𝒏
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN
Example:
1. A study was done on voltage measurements for a sample of
66 industrial networks in Canada. The sample mean voltage
was 231.7V and voltage has population standard deviation of
2.19V. Assume that the rated voltage for these networks is at
most 232V. Perform the hypothesis testing at 5% significance
level (𝛼 = 0.05) .

2. Lasers can provide highly accurate measurements of small


movements. To determine the accuracy of such a laser, it was
used to take 100 measurements of a known quantity. The
sample mean error was 25μm with a standard deviation of
60μm. The laser is properly calibrated if the mean error is 0.
Do you believe it is plausible that the laser is properly
calibrated at 5% significance level?
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN
Answer:
1. Sample of 66 industrial networks in Canada; 𝑛 = 66
The sample mean voltage was 231.7V; 𝑥ҧ = 231.7𝑉
Population standard deviation is 2.19V; 𝜎 = 2.19V.

Step 1: State the hypothesis


Assume that the rated voltage for these networks is at
most 232V.
𝐻0 : 𝜇 ≤ 232 𝑉𝑠 𝐻1 : 𝜇 > 232

𝜇0 = 232
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN
Answer:
Step 2: Calculate the test statistics
Since n is large and 𝜎 is known
ഥ−𝝁𝟎
𝒙 𝟐𝟑𝟏.𝟕−𝟐𝟑𝟐
Test Statistic = 𝝈 = 𝟐.𝟏𝟗
ൗ 𝒏 ൗ 𝟔𝟔

−𝟎.𝟑
= = −1.1132
𝟎.𝟐𝟔𝟗𝟓
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN
Answer:
Step 3: Find the critical value (here use standard normal
table)
𝐻1 : 𝜇 > 232 𝛼 =0.05

Critical value =𝒛𝜶 = 1.645


0 𝑧𝛼

Step 4: Compare the test statistic with the critical value


Rejection
Non-Rejection Region
Region

-1.1132 1.645
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN
Answer:
Test statistic is not in the rejection region. It is less than
the critical value.
Therefore 𝑯𝟎 cannot be rejected at 5% significance
level. There is no enough evidence to conclude that the
mean voltage for these networks is greater than 232V.
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN
Answer:
2. 100 measurements of a known quantity ; 𝑛 = 100
The sample mean error was 25μm; 𝑥ҧ = 25μm
Sample standard deviation of 60μm; s =60μm.

The laser is properly calibrated if the mean error is 0.


𝐻0 : 𝜇 = 0 𝑉𝑠 𝐻1 : 𝜇 ≠ 0

𝜇0 = 0
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN
Answer:
Since n is large and 𝜎 is unknown.
ഥ−𝝁𝟎
𝒙 𝟐𝟓−𝟎
Test Statistic = 𝒔 = 𝟔𝟎
ൗ 𝒏 ൗ 𝟏𝟎𝟎

𝟐𝟓
= = 4.1667
𝟔

𝛼/2 =0.025 𝛼/2 =0.025

−𝑧𝛼/2 0 𝑧𝛼/2
𝒛𝜶/𝟐 = 1.96 and −𝒛𝜶/𝟐 = −𝟏. 𝟗𝟔 (Using standard normal
table)
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN
Answer:
Non-Rejection
Region

Rejection Rejection
Region Region

−1.96 0 1.96

4.1667

Test statistic is in the rejection region. It is greater than 1.96.


Therefore 𝑯𝟎 can be rejected at 5% significance level.
There is no enough evidence to conclude that the
laser is properly calibrated.
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN
Example:
3. Recently many companies have been experimenting with
telecommuting, allowing employees to work at home on their
computers. Among other things, telecommuting is supposed to
reduce the number of sick days taken. Suppose that at one
firm, it is known that over the past few years employees have
taken a mean of 5.4 sick days. This year, the firm introduces
telecommuting. Management chooses a simple random
sample of 25 employees to follow in detail, and, at the end of
the year, these employees average 4.5 sick days with a
standard deviation of 2.7 days. Test whether the mean of sick
days are below 5.4 days at 1% significance level.
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN
Answer:
3. 𝑛 = 25
𝑥ҧ = 4.5𝑑𝑎𝑦𝑠
𝑠 = 2.7𝑑𝑎𝑦𝑠

test whether the mean of sick days are below 5.4 days.
𝐻0 : 𝜇 ≥ 5.4 𝑉𝑠 𝐻1 : 𝜇 < 5.4

𝜇0 = 5.4
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN
Answer:
Since n is small and 𝜎 is unknown,
ഥ−𝝁𝟎
𝒙 𝟒.𝟓−𝟓.𝟒
Test Statistic = 𝒔 = 𝟐.𝟕
ൗ 𝒏 ൗ 𝟐𝟓

−𝟎.𝟗
= = −1.667
𝟎.𝟓𝟒

𝐻1 : 𝜇 < 5.4
n-1 = 24 and 𝛼 =0.01
𝛼 =0.01 using t-table,
Critical value = −𝒕𝟐𝟒,𝟎.𝟎𝟏 = −𝟐. 𝟒𝟗𝟐
−𝑡𝛼 0
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN
Answer:
Non-Rejection
Rejection Region
Region

-2.492 0

-1.667

Test statistic is not in the rejection region. It is greater than the


critical value.
Therefore 𝑯𝟎 cannot be rejected at 1% significance
level. There is no enough evidence to conclude that the
mean of sick days are below 5.4 days.
TESTING HYPOTHESIS CONCERNING POPULATION
PROPORTION
 Let X be the number of successes in n independent
Bernoulli trials, each with success probability p.

 let p0 be a known constant. Consider the following


hypothesis:
i. H0 : p ≤ p0 vs H1 : p > p0

ii. H0 : p ≥ p0 vs H1 : p < p0
iii. H0 : p = p0 vs H1 : p ≠ p0
TESTING HYPOTHESIS CONCERNING POPULATION
PROPORTION
 Case IV :
Corresponding estimator for population proportion p is,
sample proportion 𝑝ෝ .
Test statistic :

𝒑ෝ − 𝒑𝟎
~𝑵(𝟎, 𝟏)
𝒑𝟎 (𝟏 − 𝒑𝟎 )
𝒏
TESTING HYPOTHESIS CONCERNING POPULATION
PROPORTION
Example:
1. In a survey of 500 residents in a certain town, 274 said they
were opposed to constructing a new shopping mall. Can you
conclude that more than half of the residents in this town are
opposed to constructing a new shopping mall at 2.5%
significance level?
TESTING HYPOTHESIS CONCERNING POPULATION
PROPORTION
Answer:
3. 𝑛 = 500
Number of residents who were opposed to the
decision = 274; 𝑥 = 274
𝑥 274
𝑝Ƹ = = = 0.548
𝑛 500

Test whether that more than half of the residents in this


town are opposed to constructing a new shopping mall
𝐻0 : 𝑝 ≤ 0.5 𝑉𝑠 𝐻1 : 𝑝 > 0.5

𝑝0 = 0.5
TESTING HYPOTHESIS CONCERNING POPULATION
PROPORTION
Answer:
𝒑ෝ −𝒑𝟎 𝟎.𝟓𝟒𝟖−𝟎.𝟓𝟎𝟎
Test Statistic = = 𝟎.𝟓 (𝟏−𝟎.𝟓)
𝒑𝟎 (𝟏−𝒑𝟎 )
𝒏 𝟓𝟎𝟎
𝟎.𝟎𝟒𝟖
= = 2.1429
𝟎.𝟎𝟐𝟐𝟒

𝐻1 : 𝑝 > 0.5

0.025 𝛼 =0.025
using standardized normal table,
Critical value = 𝒛𝟎.𝟎𝟐𝟓 = 𝟏. 𝟗𝟔
0 𝑧𝛼
TESTING HYPOTHESIS CONCERNING POPULATION
PROPORTION
Answer:
Non-Rejection Rejection
Region Region

0 1.96

2.149

Test statistic is in the rejection region. It is greater than the


critical value.
Therefore 𝑯𝟎 can be rejected at 2.5% significance level.
There is enough evidence to conclude that more than
half of the residents in this town are opposed to
constructing a new shopping mall
TESTING HYPOTHESIS CONCERNING POPULATION MEAN
COMPARISON

 LetX1, . . . , Xn be a sample from a population with mean


μx and standard deviation σx , and Y1, . . . , Yn be a sample
from a population with mean μy and standard deviation
σy.

 Consider the following hypothesis:


H0 : μx ≤ μy vs H1 : μx > μy or
H0 : μx – μy ≤ 0 vs H1 : μx – μy > 0
TESTING HYPOTHESIS CONCERNING POPULATION MEAN
COMPARISON

H0 : μx ≥ μy vs H1 : μx < μy or
H0 : μx – μy ≥ 0 vs H1 : μx – μy < 0

H0 : μx = μy vs H1 : μx ≠ μy or
H0 : μx – μy = 0 vs H1 : μx – μy ≠ 0
TESTING HYPOTHESIS CONCERNING POPULATION MEAN
COMPARISON
 Case V : Data from two independent samples with
known variances
Corresponding estimator for population mean x is,
sample mean and population mean y is, sample mean
𝑦.

Test statistic :

(ഥ ഥ) − (𝝁𝒙 − 𝝁𝒚 )
𝒙−𝒚
~𝑵(𝟎, 𝟏)
𝟐
𝝈𝟐𝒙 𝝈𝒚
+
𝒏𝒙 𝒏𝒚
TESTING HYPOTHESIS CONCERNING POPULATION MEAN
COMPARISON
 Case VI : Data from two independent samples with
unknown variances and both samples sizes are large
Corresponding estimator for population mean x is,
sample mean and population mean y is, sample mean
𝑦.

Test statistic :
(ഥ ഥ) − (𝝁𝒙 − 𝝁𝒚 )
𝒙−𝒚
~𝑵(𝟎, 𝟏)
𝟐
𝒔𝟐𝒙 𝒔𝒚
+
𝒏𝒙 𝒏𝒚
TESTING HYPOTHESIS CONCERNING POPULATION MEAN
COMPARISON
 Case VII : Data from two independent samples with
unknown variances(but equal) and at least one samples
size is small
Corresponding estimator for population mean x is,
sample mean and population mean y is, sample mean
𝑦.

Test statistic : (ഥ ഥ) − (𝝁𝒙 − 𝝁𝒚 )
𝒙−𝒚
~𝒕(𝒏𝒙+𝒏𝒚 −𝟐, 𝜶/𝟐)
𝟏 𝟏
𝒔𝒑 +
𝒏𝒙 𝒏𝒚

𝑛𝑥 −1 𝑠𝑥2 +(𝑛𝑦 −1)𝑠𝑦2


where, 𝑠𝑝 =
𝑛𝑥 +𝑛𝑦 −2
TESTING HYPOTHESIS CONCERNING POPULATION MEAN
COMPARISON
Example:
1. In a certain supermarket, a sample of 60 customers who
used a self-service checkout lane averaged 5.2 minutes of
checkout time, and has a population standard deviation of
3.1 minutes. A sample of 72 customers who used a cashier
averaged 6.1 minutes and has a population standard
deviation of 2.8 minutes. Check whether the mean
checkout time is less for people who use self-service
checkout lane at 5% significance level.
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN
Answer:
1. Let X = check out time of customers who used self-
service checkout lane
Y = check out time of customers who used a cashier
𝑥ҧ = 5.2𝑚𝑖𝑛 , 𝑛𝑥 = 60 , 𝜎𝑥 = 3.1𝑚𝑖𝑛
𝑦ത = 6.1𝑚𝑖𝑛, 𝑛𝑦 = 72, 𝜎𝑦 = 2.8min

test whether the mean checkout time is less for


people who use self-service checkout lane.
H0 : μx ≥ μy vs H1 : μx < μy
𝜇𝑥 − 𝜇𝑦 = 0
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN COMPARISON
Answer:
Since both sample sizes are large and population
variances are known,
ഥ −𝒚
(𝒙 ഥ)−(𝝁𝒙 −𝝁𝒚 ) (𝟓.𝟐−𝟔.𝟏)−𝟎
Test Statistic = =
𝟐 𝟑.𝟏𝟐 𝟐.𝟖𝟐
𝝈𝟐 𝝈
𝒙+ 𝒚
𝟔𝟎
+ 𝟕𝟐
𝒏𝒙 𝒏𝒚

−𝟎.𝟗
= = −1.7351
𝟎.𝟓𝟏𝟖𝟕
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN COMPARISON
Answer:
𝐻1 : μx < μy 𝑜𝑟 𝐻1 : μx − μy < 0

𝛼 =0.05
𝛼 =0.05 using standardized normal table,
Critical value = −𝒛𝟎.𝟎𝟓 = −𝟏. 𝟔𝟒𝟓
−𝑧𝛼 0
Non-Rejection
Rejection Region
Region

-1.645 0

-1.7351
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN COMPARISON
Answer:
Test statistic is in the rejection region. It is less than the
critical value.
Therefore 𝑯𝟎 can be rejected at 5% significance
level. There is enough evidence to conclude that
mean checkout time is less for people who use
self-service checkout lane.
TESTING HYPOTHESIS CONCERNING POPULATION MEAN
COMPARISON
Example:
2. Fifty specimens of a new computer chip were tested for
speed in a certain application, along with 50 specimens of
chips with the old design. The average speed, in MHz, for
the new chips was 495.6, and the standard deviation was
19.4. The average speed for the old chips was 481.2, and
the standard deviation was 14.3. Can you conclude that the
mean speed for the new chips is greater than that of the
old chips at 2.5% significance level?
TESTING HYPOTHESIS CONCERNING POPULATION MEAN
COMPARISON
Example:
3. In an experiment to test the effectiveness of a new sleeping
aid, a sample of 12 patients took the new drug, and a sample
of 14 patients took a commonly used drug. Of the patients
taking the new drug, the average time to fall asleep was 27.3
minutes with a standard deviation of 5.2 minutes, and for the
patients taking the commonly used drug the average time
was 32.7 minutes with a standard deviation of 4.1 minutes.
Can you conclude that the mean time to sleep is less for the
new drug at 2.5% significance level?
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN COMPARISON
Answer:
3. Let X = time to fall sleep of the patients taking the new
drug
Y = time to fall sleep of the patients taking the commonly
used drug
𝑥ҧ = 27.3𝑚𝑖𝑛 , 𝑛𝑥 = 12 , 𝜎𝑥 = 5.2𝑚𝑖𝑛
𝑦ത = 32.7𝑚𝑖𝑛, 𝑛𝑦 = 14, 𝜎𝑦 = 4.1min

test whether the mean time to sleep is less for the new
drug.
H0 : μx ≥ μy vs H1 : μx < μy
𝜇𝑥 − 𝜇𝑦 = 0
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN COMPARISON
Answer:
Since both sample sizes are small and population
variances are unknown,
ഥ −𝒚
(𝒙 ഥ)−(𝝁𝒙 −𝝁𝒚 )
Test Statistic =
𝟏 𝟏
𝒔𝒑 +
𝒏𝒙 𝒏𝒚

𝑛𝑥 −1 𝑠𝑥2 +(𝑛𝑦 −1)𝑠𝑦2


𝑠𝑝 = =
𝑛𝑥 +𝑛𝑦 −2

12−1 5.22 +(14−1)4.12


12+14−2

515.97
𝑠𝑝 = = 4.6367
24
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN COMPARISON
Answer:
(𝟐𝟕.𝟑−𝟑𝟐.𝟕)−𝟎
Test Statistic =
𝟏 𝟏
𝟒.𝟔𝟑𝟔𝟕 +
𝟏𝟐 𝟏𝟒

−𝟓.𝟒
= = −2.9605
𝟏.𝟖𝟐𝟒
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN COMPARISON
Answer:
𝐻1 : μx < μy 𝑜𝑟 𝐻1 : μx − μy < 0
𝛼 =0.025 and 𝑛𝑥 + 𝑛𝑦 − 2 = 14 + 12 − 2 = 24
𝛼 =0.025 using t-table,
Critical value = −𝒕𝟐𝟒,𝟎.𝟎𝟐𝟓 = −2.064
−𝑡𝛼 0
Non-Rejection
Rejection Region
Region

-2.064 0

-2.9605
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN COMPARISON
Answer:
Test statistic is in the rejection region. It is less than the
critical value.
Therefore 𝑯𝟎 can be rejected at 5% significance
level. There is enough evidence to conclude that
mean time to sleep is less for the new drug.
TESTING HYPOTHESIS CONCERNING POPULATION MEAN
COMPARISON

 Let (X1, Y1),.. . . , (Xn, Yn) be a sample of ordered pairs


whose differences d1, . . . , dn are a sample from a
normal population with mean μd. Let sd be the sample
standard deviation of d1, . . . , dn .

 letμ0 be a known constant. Consider the following


hypothesis:
H0 : μd ≤ μ0 vs H1 : μd > μ0
H0 : μd ≥ μ0 vs H1 : μd < μ0
H0 : μd = μ0 vs H1 : μd ≠ μ0
TESTING HYPOTHESIS CONCERNING POPULATION MEAN
COMPARISON
 Case VIII : Data from two dependent (paired) samples
Test statistic :
(ഥ
𝒙𝑫 −𝝁𝟎 )
𝒔𝒅 ~𝒕(𝒏−𝟏)
ൗ 𝒏

(𝑑 − ത
𝑑) 2 σ𝑛
𝑖=1 𝑑𝑖
𝑤ℎ𝑒𝑟𝑒 𝑠𝑑2 = σ𝑛𝑖=1 𝑖
𝑎𝑛𝑑 𝑥ҧ𝑑 = 𝑑ҧ =
(𝑛−1) 𝑛
TESTING HYPOTHESIS CONCERNING POPULATION MEAN
COMPARISON
Example:
1. Two microprocessors are compared on a sample of six
benchmark codes to determine whether there is a difference
in speed. The times (in seconds) used by each processor on
each code are given in the following table. Can you conclude
that the mean speeds of the two processors differ at 5%
significance level?
Code 1 2 3 4 5 6
Processor A 27.2 18.1 27.2 19.7 24.5 22.1
Processor B 24.1 19.3 26.8 20.1 27.6 29.8
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN COMPARISON
Answer:
1. Test whether the mean speeds of the two processors
differ
H0 : μd = 0 vs H1 : μd ≠ 0
𝜇0 = 0
Since sample are paired,

(ഥ
𝒙𝑫 −𝝁𝟎 )
Test Statistic = 𝒔𝒅
ൗ 𝒏
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN COMPARISON
Answer:
Code A B Difference(𝑑𝑖 ) (𝑑𝑖 −𝑑)ҧ 2
1 27.2 24.1 27.2 - 24.1 = 3.1 (𝑑𝑖 −𝑑)ҧ 2 = (3.1 − (−1.483))2
(3.1 + 1.483))2 = 21.0039
2 18.1 19.3 18.1 – 19.3 = -1.2 0.0801
3 27.2 26.8 27.2 - 26.8 = 0.4 3.5456
4 19.7 20.1 19.7 - 20.1 = -0.4 1.1729
5 24.5 27.6 24.5 – 27.6 = -3.1 2.6147
6 22.1 29.8 22.1 – 29.8 = -7.7 38.6511
Total = -8.9 Total = 67.0683
σ𝑛
𝑖=1 𝑑𝑖 8.9
𝑥ҧ𝑑 = 𝑑ҧ = = −
𝑛 6
𝑑ҧ = −1.483
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN COMPARISON
Answer:
ത 2
(𝑑𝑖 −𝑑)
𝑠𝑑2 = σ𝑛𝑖=1 (𝑛−1) = 67.0683/5

𝑠𝑑2 = 13.4136
𝑠𝑑 = 13.4136 = 3.6625
(−1.483−0)
Test Statistic = 3.6625
ൗ 6
−1.483
= = −0.9918
1.4952
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN COMPARISON
Answer:
𝐻1 : μd ≠ 0
𝛼 =0.025 and n − 1 =5 (using
𝛼/2 =0.025 𝛼/2 =0.025
t-table),
Critical value
−𝒕𝟓,𝟎.𝟎𝟐𝟓 = − 2.571 and
−𝑡𝛼/2 0 𝑡𝛼/2
𝒕𝟓,𝟎.𝟎𝟐𝟓 =2.571
Non-Rejection
Region

Rejection Rejection
Region Region

−2.571 0 2.571

-0.9918
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN COMPARISON
Answer:
Test statistic is not in the rejection region.
Therefore 𝑯𝟎 cannot be rejected at 5% significance
level. There is no enough evidence to conclude that
the mean speeds of the two processors differ.
TESTING HYPOTHESIS CONCERNING POPULATION PROPORTION
COMPARISON

 Let X be the number of successes in nx independent


Bernoulli trials with success probability px , and let Y be
the number of successes in ny independent Bernoulli
trials with success probability py

 Consider the following hypothesis:


H0 : px – py ≤ 0 vs H1 : px – py > 0
H0 : px – py ≥ 0 vs H1 : px – py < 0
H0 : px – py = 0 vs H1 : px – py ≠ 0
TESTING HYPOTHESIS CONCERNING POPULATION PROPORTION
COMPARISON
 Case IX :
Test statistic :
(ෝ
𝒑𝒙 −ෝ
𝒑𝒚 )
~𝑵(𝟎, 𝟏)
𝟏 𝟏
ෝ (𝟏 − 𝒑
𝒑 ෝ) +
𝒏𝒙 𝒏𝒚

𝑥 𝑦 𝑥+𝑦
𝑤ℎ𝑒𝑟𝑒 𝑝Ƹ𝑥 = , 𝑝Ƹ𝑦 = 𝑎𝑛𝑑 𝑝Ƹ =
𝑛𝑥 𝑛𝑦 𝑛𝑥 + 𝑛𝑦
TESTING HYPOTHESIS CONCERNING POPULATION PROPORTION
COMPARISON
Example:
1. To test the effectiveness of protective packaging, a firm
shipped out 1200 orders in regular light packaging and 1500
orders in heavy-duty packaging. Of the orders shipped in light
packaging, 20 arrived in damaged condition, while of the
orders shipped in heavy duty packaging, 15 arrived in
damaged condition. Can you conclude that heavy-duty
packaging reduces the proportion of damaged shipments at
2.5% significance level?
TESTING HYPOTHESIS CONCERNING POPULATION
PROPORTION COMPARISON
Answer:
1. Let X = damaged orders shipped in light packaging
Y = damaged orders shipped in heavy-duty packaging
20
𝑥 = 20 , 𝑛𝑥 = 1200 , 𝑝𝑥 =
1200
15
𝑦 = 15, 𝑛𝑦 = 1500, 𝑝𝑦 =
1500
𝑥+𝑦 20+15 35
𝑝Ƹ = = =
𝑛𝑥 +𝑛𝑦 1200+1500 2700

test whether the heavy-duty packaging reduces the


proportion of damaged shipments.
H0 : px − py ≤ 0 vs H1 : px − py > 0
TESTING HYPOTHESIS CONCERNING POPULATION
PROPORTION COMPARISON
Answer:
(ෝ
𝒑𝒙 −ෝ
𝒑𝒚 )
Test Statistic =
𝟏 𝟏
ෝ (𝟏−ෝ
𝒑 𝒑) 𝒏 +𝒏
𝒙 𝒚

20 15

1200 1500
=
35 35 1 1
1− +
2700 2700 1200 1500

0.0067
= = 1.5220
0.0044
TESTING HYPOTHESIS CONCERNING POPULATION
MEAN
Answer:
𝛼 =0.025
0.025 using standardized normal table,
Critical value = 𝒛𝟎.𝟎𝟐𝟓 = 𝟏. 𝟗𝟔
0 𝑧𝛼

Non-Rejection Rejection
Region Region

0 1.96

1.5220
TESTING HYPOTHESIS CONCERNING POPULATION
PROPORTION COMPARISON
Answer:
Test statistic is not in the rejection region. It is less than the
critical value.
Therefore 𝑯𝟎 cannot be rejected at 2.5%
significance level. There is no enough evidence to
conclude that the heavy-duty packaging reduces
the proportion of damaged shipments.

You might also like