BS IMI U5 Oct23
BS IMI U5 Oct23
PGDM (2023-24)
Term-II (Oct-Jan, 2023-24)
Ruchika Lochab
Assistant Professor, Operations
IMI, Delhi
Introduction to hypothesis testing
A candidate in an
election claims 60%
support. Is the candidate
exaggerating their
level of support?
Introduction to hypothesis testing
Hypothesis testing is concerned with trying to answer questions
like these.
For example,
µ = .75 versus µ ≠ .75
p ³ .10 versus p < .10
• A new drug is developed with the goal of lowering blood pressure more than
the existing drug and the result is positive.
• The label on a soft drink bottle states that it contains 67.6 fluid ounces.
• A quality control inspector needs to check if the quantities supplied meet the
specification criteria
TESTING OF HYPOTHESES (aka. significance testing)
• Various concepts
• One tailed test and two tailed test
• Type I error and type II error
• Level of significance
• Power of test
• Testing hypotheses concerning population mean
12/13/23 11
A formal introduction to hypothesis tests
In hypothesis testing we are essentially presented with two rival hypotheses.
Examples might include:
“The coin is fair” or “the coin is biased”;
“The proportion of local people in favour of a by-pass
is 80%” or “the proportion is smaller than 80%”;
“The drug has the same effectiveness as an existing
treatment” or “the drug is more effective”.
These rival hypotheses are referred to as the null and the alternative
hypotheses.
Testing of Hypothesis
• In hypothesis testing, we decide whether to accept or reject a
particular value of a set, of particular values of a parameter or those of
several parameters.
Example:
• To determine whether the wages of men and women are equal.
• A product in the market is of standard quality.
• Whether a particular medicine is effective to cure a disease.
Parametric Hypothesis:
( )
• Example: if X ~ N µ, s 2 then µ = µ1 , µ > µ1 , µ < µ1
is a parametric hypothesis.
12/13/23 15
Null Hypothesis: H0
v The null hypothesis (denoted by H0) is a statement that the value of
a population parameter (such as proportion, mean, or standard
deviation) is equal to some claimed value.
v A null hypothesis is a claim (or statement) about a population
parameter that is assumed to be true until it is declared false.
Then
H1 : µ < µ0 or H1 : µ > µ0
H1 : µ ≠ µ 0
95 % of area
Acceptance and
0.025 of area 0.025 of area
rejection regions
in case of a two- µH 0
A critical value is any value that separates the critical region (where
we reject the null hypothesis) from the values of the test statistic
that do not lead to rejection of the null hypothesis. The critical
values depend on the nature of the null hypothesis, the sampling
distribution that applies, and the significance level a.
A formal introduction to hypothesis tests
Significance levels that are typically used are 10%, 5%, 1% and 0.1%.
These significance levels correspond to different rigours of test – the
lower the significance level, the stronger the evidence the test will
provide.
H0 : =
H1 : >
Points Right
A Right-Tailed Test
According to www.city-data.com, the average price of
homes in West Orange, New Jersey, was $459,204 in
2019. Suppose a real estate researcher wants to
check whether the current mean price of homes in
this town is higher than $459,204.
H0 : =
H1 : <
Points Left
A Left-Tailed Test
Consider the example of the mean amount of soda in all soft-drink
cans produced by a company. The company claims that these cans,
on average, contain 12 ounces of soda.
However, if these cans contain less than the claimed amount of soda,
then the company can be accused of cheating.
Suppose a consumer agency wants to test whether the mean
amount of soda per can is less than 12 ounces. Note that the key
phrase this time is less than, which indicates a left-tailed test.
A Left-Tailed Test
• Let μ be the mean amount of soda in all cans. The two possible
decisions are
This will not affect the result of the test as long as the sign in
H1 is less than (<).
When the alternative hypothesis has a less than (<) sign, the
test is always left–tailed.
Figure: A left-tailed test.
• Accepting 𝐻" (i.e., accepting null hypothesis)
means there is no statistical evidence to
reject it.
• We are not saying that the null hypothesis is
true.
12/13/23 41
P-Value
42
P-Values
More generally, the smaller the P-value, the more evidence
there is in the sample data against the null hypothesis and for
the alternative hypothesis.
Thus if the P-value exceeds the chosen significance level, the null
hypothesis cannot be rejected at that level.
Note, the P-value can be thought of as the smallest significance
level at which H0 can be rejected.
P-Values for z Tests
The calculation of the P-value depends on whether the test
is upper-, lower-, or two-tailed.
The P-value of the test is the a associated with the critical region.
Any smaller value for a expands the critical region and the test
fails to reject the null hypothesis when x = 51.3.
The P-value is easy to compute after the test statistic is observed.
48
P-value = 1 - P(48.7 < X < 51.3)
æ 48.7 - 50 51.3 - 50 ö
= 1 - Pçç <Z< ÷÷
è 2.5 / 16 2.5/ 16 ø
= 1 - P(-2.08 < Z < 2.08)
= 1 - 0.962 = 0.038
Figure: P-value is area of shaded
region when x = 51.3.
12/13/23 49
Two Procedures
P-value method
v A Type II error occurs when a false null hypotheses is not rejected. The value of β
represents the probability of committing a Type II error; that is,
v The value of 1 – β is called the power of the test. It represents the probability of not making
a Type II error.
Actual Truth of H0
Decision
H0 is true H0 is false
For example,
consider the propellant burning rate problem when we are testing
H0 : μ = 50 centimeters per second
against H1 : μ not equal 50 centimeters per second.
Suppose that the true value of the mean is μ = 52.
12/13/23 57
Broad Classification of Hypothesis Tests
Hypothesis Tests
Tests of Tests of
Association Differences
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.
Develop Null and Alternative
Hypotheses
Example:
A new teaching method is developed that is believed to be better than
the current method.
Alternative Hypothesis: H1
The new teaching method is better.
Null Hypothesis: H0
The new method is no better than the old method.
Alternative Hypothesis: H1
The label is incorrect. μ < 67.6 ounces.
H 0 : µ ³ µ0 H 0 : µ £ µ0 H 0 : µ = µ0
H a : µ < µ0 H a : µ > µ0 H a : µ ¹ µ0
H0 True H0 False
Conclusion
Accept H0 Correct
Type II Error
Decision
Correct
Reject H0 Type I Error Decision
General Rule to select
Type I error and Type II error
• Cases where Type-I error is more costly, we choose a small
value of α, namely 1%
H0: µ < 12
H1: µ > 12
p-values obtained are 12% and 2% based on two different samples when α=0.05.
The credibility of H0 when it is 12% is higher than that of 2%. So, the chance of
rejection is high in the case of 2%.
Decision based on
p-value Approach
• For two tailed test, double the tail area to obtain the
p –value.
Critical Value Approach
f(z)
Critical Region Critical Region
Acceptance
0.025% Region 0.025%
Total = 5% Level
95%
Note that the p–value is the smallest significance level at which the
null hypothesis is rejected.
Figure: The p–value for a right-tailed test.
Figure: The p–value for a two-tailed test.
Calculating the z Value for x
When using the normal distribution, the value of z for x for a test
of hypothesis about μ is computed as follows:
x -µ s
z= where s x =
sx n
The value of z calculated for x using this formula is also called the
observed value of z.
Steps to Perform a Test of Hypothesis Using the
p–Value Approach
1. State the null and alternative hypothesis.
2. Select the distribution to use.
3. Calculate the p–value.
4. Make a decision.
Example
The management of Priority Health Club claims that its
members lose an average of 10 pounds or more within
the first month after joining the club.
A consumer agency that wanted to check this claim took
a random sample of 36 members of this health club and
found that they lost an average of 9.2 pounds within the
first month of membership with a standard deviation of
2.4 pounds. Find the p–value for this test. What will your
decision be if α = .01? What if α = .05?
Example: Solution
Step 1: H0: μ ≥ 10 H1: μ < 10
p-value = .0228.
Figure: The p-value for a left-tailed test.
Example: Solution
Step 4: Since α = .01 is less than the p-value of .0228, we
do not reject the null hypothesis at this significance level.
Consequently, we conclude that the mean weight lost
within the first month of membership by the members of
this club is 10 pounds or more.
Step 3: α = .025
The < sign in the alternative hypothesis
indicates that the test is left-tailed.
Area in the left tail = α = .025.
The critical value of z is -1.96.
Figure
Example: Solution
Step 4:
s 80,000
sx = = = $16,000
n 25
x - µ 288,000 - 300,000
z= = = -.75
sx 16,000
Example: Solution
Step 5: This value of z = -.75 is greater
than the critical value of z = -1.96, and it
falls in the non-rejection region. As a
result, we fail to reject H0.
Therefore, we can state that based on the
sample information, it appears that the
mean net worth of families in this city is
not less than $300,000.
Connection between Hypothesis Tests
and Confidence Intervals
A close relationship exists between the test of a hypothesis for q, and the
confidence interval for q.
If [l, u] is a 100(1 - a)% confidence interval for the parameter q, the test of size a of
the hypothesis
H0: q = q0
H1: q ¹ q0
98
Confidence Interval Approach to Two-Tailed Tests About a
Population Mean
• Select a simple random sample from the population and use
the value of the sample mean 𝑥̅ to develop the confidence
interval for the population mean μ. (Confidence intervals are
covered in Unit 5.)
• If the confidence interval contains the hypothesized value μ0,
do not reject H0. Otherwise, reject H0. (Actually, H0 should be
rejected if μ0 happens to be equal to one of the end points of
the confidence interval.)
99
Confidence Interval Approach to Two-Tailed Tests About a Population Mean
Because the hypothesized value for the population mean, μ0 = 6, is not in this
interval, the hypothesis-testing conclusion is that the null hypothesis, H0: μ = 6,
can be rejected.
100
General Procedure for Hypothesis
Tests
1. Identify the parameter of interest.
2. Formulate the null hypothesis, H0 .
3. Specify an appropriate alternative hypothesis, H1.
4. Choose a significance level, a.
5. Determine an appropriate test statistic.
6. State the rejection criteria for the statistic.
7. Compute necessary sample quantities for calculating the test statistic.
8. Draw appropriate conclusions.
101
Tests on the Mean of a Normal Distribution, Variance Known
H0: µ = µ0
H1: µ ≠ µ0
X - µ0
Z0 =
s/ n
102
Tests on the Mean of a Normal Distribution, Variance Known
103
EXAMPLE: Propellant Burning Rate
104
EXAMPLE: Propellant Burning Rate
5. Reject H0 if: Reject H0 if the P-value is less than 0.05. The boundaries of
the critical region would be z0.025 = 1.96 and -z0.025 = -1.96.
Interpretation: The mean burning rate differs from 50 centimeters per second, based
on a sample of 25 measurements.
106
Hypothesis Tests About a Population
Mean when σ unknown
Test Statistic
The value of the test statistic t for the sample
mean x is computed as
x -µ s
t= where s x =
sx n
12/13/23 112
EXAMPLE: Golf Club Design
An experiment was performed in which 15 drivers produced by a particular
club maker were selected at random and their coefficients of restitution
measured. It is of interest to determine if there is evidence (with a = 0.05) to
support a claim that the mean coefficient of restitution exceeds 0.82.
The observations are:
0.8411 0.8191 0.8182 0.8125 0.8750
0.8580 0.8532 0.8483 0.8276 0.7983
0.8042 0.8730 0.8282 0.8359 0.8660
The sample mean and sample standard deviation are x = 0.83725 and s =
0.02456. The objective of the experimenter is to demonstrate that the mean
coefficient of restitution exceeds 0.82, hence a one-sided alternative
hypothesis is appropriate.
113
The seven-step procedure for hypothesis testing is as follows:
12/13/23 114
4. Test Statistic: The test statistic is x - µ0
t0 =
s/ n
5. Reject H0 if: Reject H0 if the P-value is less than 0.05.
12/13/23 116
Some Practical Tips
q A sample size of 30 provides good results in most cases.
If the population is skewed or has outliers, a sample size of
50 is preferred.
q The smaller the p-value, the greater the evidence
against the null H0 and hence in favour of the alternate
hypothesis H1.
q When the p-value is smaller than 0.01, the result is considered to be
very significant.
qWhen the p-value is between 0.01 and 0.05, the result is considered to
be significant.
qWhen the p-value is between 0.05 and 0.10, the result is considered by
some as marginally significant (and by most as not significant).
qWhen the p-value is greater than 0.10, the result is considered not
significant.
Hypothesis Tests
• Level of Significance:
• The level of significance is the probability of making a Type I error
when the null hypothesis is true as an equality.
• The person responsible for the hypothesis test specifies the level of
significance and the probability of making a Type I error.
• Applications of hypothesis testing that only control the Type I error
are called significance tests.
• Most applications of hypothesis testing control the probability of
making a Type I error; they do not always control the probability of
making a Type II error.
Hypothesis Tests
Table: Summary of Hypothesis Tests About a Population Mean
Case I: Testing means of a normal population with known s
Null hypothesis: H0 : µ = µ0
120
Case I: Testing means of a normal population with known s
Rejection regions for z tests: (a) upper-tailed test; (b) lower-tailed test; (c) two-tailed test
121
Case III: Testing means of a
Normal population with unknown s, and small n
122
Practice Questions
12/13/23 123
One-Tailed Tests About a Population Mean: σ Known
The EMS director wants to perform a hypothesis test, with a .05 level
of significance, to determine whether the service goal of 12 minutes
or less is being achieved.
124
1. Develop the hypotheses.
126
p –Value Approach
Critical Value Approach
p-Value Approach to Two-Tailed Hypothesis
Testing
• Compute the p-value using the following three steps:
1. Compute the value of the test statistic 𝑧.
2. If 𝑧 is in the upper tail (𝑧 > 0), compute the probability that 𝑧 is greater than or equal
to the value of the test statistic. If 𝑧 is in the lower tail (𝑧 < 0), compute the
probability that 𝑧 is less than or equal to the value of the test statistic.
3. Double the tail area obtained in step 2 to obtain the p-value.
129
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 𝑧α/2
(the 𝑧-value with an area of α/2 in the upper tail of the distribution).
• The rejection rule is:
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.
131
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.
Perform a hypothesis test, at the 0.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
134
p-Value Approach
Critical Value Approach
4. Determine the critical value and the rejection rule.
138
Tests about a Population Mean: σ Unknown
139
p -Values and the t Distribution
• The format of the t distribution table provided in most statistics
textbooks does not have sufficient detail to determine the exact p-
value for a hypothesis test.
• However, we can still use the t distribution table to identify a
range for the p-value.
• An advantage of computer software packages is that the computer
output will provide the p-value for the t distribution.
140
Example: Highway Patrol
One-Tailed Test About a Population Mean: σ Unknown
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 α =
0.05 to test the hypothesis. 141
One-Tailed Test About a Population Mean: σ
Unknown
1. Develop the hypotheses.
142
One-Tailed Test About a Population Mean: σ
Unknown
p –Value Approach
4. Compute the p –value.
143
One-Tailed Test About a Population Mean: σ
Unknown
Critical Value Approach
4. Determine the critical value and the rejection rule.
144
One-Tailed Test About a Population Mean: σ
Unknown
145
Example
At Canon Food Corporation, it used to take an average of 90 minutes for
new workers to learn a food processing job. Recently the company
installed a new food processing machine.
The supervisor at the company wants to find if the mean time taken by
new workers to learn the food processing procedure on this new machine is
different from 90 minutes.
A sample of 20 workers showed that it took, on average, 85 minutes for
them to learn the food processing procedure on the new machine. It is
known that the learning times for all new workers are normally distributed
with a population standard deviation of 7 minutes.
Find the p–value for the test that the mean learning time for the food
processing procedure on the new machine is different from 90 minutes.
What will your conclusion be if α = .01?
Solution
Step 3:
s 7
sx = = = 1.56524758 min utes
n 20
x -µ 85 - 90
z= = = -3.19
sx 1.56524758
Step 4: Because α = .01 is greater than the p-value of .0014, we reject the null
hypothesis at this significance level.
Therefore, we conclude that the mean time for learning the food processing
procedure on the new machine is different from 90 minutes.
Here we may also assume that for values beyond 3,
the area would be approximately 1, so for
calculating rejection region, let’s say of LHS, subtract
this half of approximately 1 value from 0.5 (because
that’s how we find significant region). The p value
thus could be thought of as some very small value
0.0000something, which is anyhow less than
alpha=0.01.
So, we reject null hypothesis.
151
Example
The management at Massachusetts Savings Bank is always concerned about the
quality of service provided to its customers. With the old computer system, a
teller at this bank could serve, on average, 22 customers per hour.
The management noticed that with this service rate, the waiting time for
customers was too long. Recently the management of the bank installed a new
computer system in the bank, expecting that it would increase the service rate
and consequently make the customers happier by reducing the waiting time.
To check if the new computer system is more efficient than the old system, the
management of the bank took a random sample of 70 hours and found that
during these hours the mean number of customers served by tellers was 27 per
hour with a standard deviation of 2.5. Testing at the 1% significance level,
would you conclude that the new computer system is more efficient than the
old computer system?
Example: Solution
Step 1: H0 : μ = 22 H1 : μ > 22
Step 4:
s 2.5
sx = = = .29880715
n 70
x -µ 27 - 22
t= = = 16.733
sx .29880715
The value of the test statistic t = 16.733 is greater than the critical value of t = 2.382,
and it falls in the rejection region. Consequently, we reject H0. As a result, we
conclude that the value of the sample mean is too large compared to the
hypothesized value of the population mean, and the difference between the two
may not be attributed to chance alone.
One Sample t Test for Population Mean -
A car dealer offers generous package to customers who would like their purchasers to have
high quality extras fitted to the cars. Historically, people who access this offer spend £2300
per customer. The owner is concerned that recently this average spend has changed and
requested after discussions with a data analyst that this is tested. The analyst recommended
a one-sample t-test. To test this hypothesis, the data analyst checked the data for the last
five years to confirm that the population spend follows approximately a normal distribution
and then collects the spending data for the last seven customers (£): 2220, 2621, 2025, 1890,
2890, 2380, and 1890.
H0: μ = 2300
Population:
Sample:
H1: μ ≠ 2300
Normally distributed
n=7
(Two tail test)
μ = 2300, σ = unknown
α = 5% = 0.05
157
solution
Step 1 - State hypothesis
1. Null hypothesis H0: µ = 2300
2. Alternative Hypothesis H1: µ ≠ 2300 (the sign
implies a two-tail test)
Step 2 - Select test
• Number of samples - one sample.
• The statistic we are testing - testing for a difference between a sample mean and population mean (µ = 2300).
Therefore, two-tail test. Population standard deviation is not known.
• Size of the sample - small (n = 7).
• Nature of population from which sample drawn – normal population distribution, sample size is small, and
population standard deviation is unknown. The sample standard deviation will be used as an estimate of the
population standard deviation and the sampling distribution of the mean is a t distribution with n – 1 degrees
of freedom.
159
solution
Step 5 - Make a decision - Two alternative
approaches considered
From statistical tables, the two-tail critical
test statistic tcri = t (0.05/2, 6) = 2.45
The calculated test statistic tcal = - 0.18 and
the critical t value ± 2.45 are compared to
decide which hypothesis statement to
accept.
Find the p-value for the test that mean life of all such batteries is less
than 65 months. What will your conclusion be if the significance level is
2.5%?
Example: Solution
Step 1: H0 : μ ≥ 65 H1 : μ < 65
Step 3: The < sign in the alternative hypothesis indicates that the test is
left-tailed
s 3
sx = = = .44721360
n 45
x -µ 63.4 - 65
t= = = -3.578
sx .44721360
and df = n – 1 = 45 – 1 = 44
p-value < .001
Figure: The required p-value
Thank You!
12/13/23 165