Hypothesis Testing
Dr. Md Azad Uddin
Associate Professor,
North South University
May 23, 2025
Contents
Introduction: Real Life Scenario
Steps in Hypothesis Testing
Set up Hypotheses
Significance Level
Errors in Hypothesis Testing
Test Statistic
Make a Decision
Interpretation/Inference
Example
Introduction: Real Life Scenario
▶ Usual strategies to increase the sales volume: Launching
a campaign, hiring a new manager, choosing a new
pricing strategy
Managerial Problem
▶ In a online retailer, the company founds that the average
sales per customer was $50.
▶ You’re the marketing manager at that retail company.
▶ You’ve launched a new digital ad campaign aiming to
increase it’s average sales volume per customer.
▶ Management wants to know: Has the new ad campaign
increased the average sales per customer?
Introduction: Real Life Scenario
▶ A randomly sampled 100 customers after the campaign
shows that their average sale per customer was $52.3
with the standard deviation $10.
▶ What would you recommend to the CEO?
▶ Roll it out nationwide?
▶ Test further?
▶ Hypothesis testing turns uncertainty into actionable
insight
Hypothesis Testing
▶ Hypothesis testing is a statistical method used to make
decisions or inferences about population parameters based
on sample data.
▶ The Logic
▶ State a hypothesis about a population, usually
concerning a population parameter
▶ Predict characteristics of a sample
▶ Obtain a random sample from the population
▶ Compare obtained data to prediction to see if they are
consistent
Hypothesis Testing
Hypothesis Testing
▶ Hypothesis Testing involves
→ making an initial statement/assumption (the hypothesis)
, next
collecting sample data → measuring the statistic
→ Determine the correct distribution to perform the test
and then
→ test whether the assumption is likely to be true or false.
Steps in Hypothesis Testing
▶ Hypothesis testing can be used to test the claims
scientifically
▶ Steps in Hypothesis Testing
▶ Define the Objective/Question
▶ Set up Hypotheses
▶ Collect the Sample data and Calculate the test statistic
▶ Set the significance Level (usually given)
▶ Choose the appropriate test statistic
▶ Make a Decision
▶ Critical value Approach (Rejection/Non-rejection
Region)
▶ P-value Approach
▶ Confidence Interval Approach
▶ Make a conclusion, written in terms of the original
problem.
What we will cover ...
▶ HYPOTHESIS TESTING of ONE POPULATION
PARAMETERS (Mean and Proportion): Z, T-TEST
▶ HYPOTHESIS TESTING of TWO POPULATION
(Independent/Paired) PARAMETERS (Mean and
Proportion): Z, T-TEST
▶ HYPOTHESIS TESTING for MORE THAN TWO
POPULATION PARAMETERS: ANOVA (F test)
▶ HYPOTHESIS TESTING for CATEGORICAL
VARIABLES: CHI-SQUARE TEST
Learning Objectives
▶ To understand the logical framework of tests of
hypotheses.
▶ To learn basic terminology connected with hypothesis
testing.
Step 1. Set up Hypotheses
Set up Hypotheses
▶ Statistical hypothesis: a claim about the value of a
parameter or population characteristic.
▶ In any hypothesis-testing problem, there are always two
competing hypotheses under consideration:
1. The status quo (null) hypothesis
2. The research (alternative) hypothesis
▶ The objective of hypothesis testing is to decide, based on
sample information, if the alternative hypotheses is
actually supported by the data.
▶ The two possible conclusions:
1. Reject H0 .
2. Fail to reject Ha .
Set up Hypotheses
Null Hypothesis:
▶ A null hypothesis is a claim (or statement) about a
population parameter (such as proportion, mean, or
standard deviation) that is assumed to be true until it is
declared false.
▶ Null hypothesis is denoted by H0
Set up Hypotheses
Alternative Hypothesis:
▶ An alternative hypothesis is a claim about a population
parameter that will be true if the null hypothesis is false.
▶ Alternative Hypothesis and is denoted by Ha or H1 .
▶ The symbolic form of the alternative hypothesis must use
one of these symbols: ̸=, <, >.
▶ Based on the sign of Ha , Hypothesis test can be of One
tail (left/right) and two tailed:
For the null hypothesis H0 : µ = µ0 then.
1. Ha : µ > µ0 (Right tail)
2. Ha : µ < µ0 (Left tail)
3. Ha : µ ̸= µ0 (Two tail test)
Define Null and Alternative Hypothesis
▶ Recall the example of Ad Campaign
▶ Define Null and Alternative Hypothesis
Define Null and Alternative Hypothesis
▶ Recall the example of Ad Campaign
▶ Define Null and Alternative Hypothesis
µ is the average sales per customer of the retailer
H0 : µ = $50
Ha : µ > $50
▶ The equality sign is always with the null hypothesis.
▶ The alternate hypothesis is the claim for which we are
seeking statistical proof.
Step 2. Data Collection and
Calculate Statistic
Data Collection and Calculate Statistic
▶ µ is the population mean
▶ P is the population proportion
▶ σ is the population standard deviation
▶ Sample mean and Standard deviation are calculated using
the following formulas
P
Xi
Mean, X̄ =
n
v
u (X − X̄ )2
uP
i
SD, s = t
n−1
▶ p is the sample proportion
X
p=
n
Data Collection and Calculate Statistic
▶ Recall the example of Ad Campaign
▶ Sample mean and Standard deviation are given
Mean, X̄ = $52.3
SD, s = $10
▶ In some cases, the sample data will be given. You have to
calculate mean and Standard deviation
Recall the techniques from BUS 172
Step 3. Significance Level
Errors in Hypothesis Testing
A Type I error occurs when a true null hypothesis is rejected.
Type I error = Reject H0 | H0 is true
A Type II error occurs when a false null hypotheses is not
rejected.
Type II error = Do not reject H0 | H0 is false
Significance Level
▶ The value of α represents the probability of committing
this type of error; that is,
α = P(Type I error) = P(H0 is rejected | H0 is true)
is called the significance level of the test.
▶ Common choices for α’s are 0.05, 0.01, and 0.10.
▶ In most of the cases of problem solving, α will be given.
If not given, you can choose any level for α such as 0.05,
0.01, and 0.10.
Power of the Test
▶ The value of β represents the probability of committing a
Type II error; that is,
β = P(Type II error) = P(H0 is not rejected | H0 is false)
▶ The value of (1 − β) is called the power of the test. It
represents the probability of not making a Type II error.
Controlling Type I and Type II Errors
▶ For any fixed α, an increase in the sample size n will
cause a decrease in β
▶ For any fixed sample size n, a decrease in α will cause an
increase in β. Conversely, an increase in α will cause a
decrease in β.
▶ To decrease both α and β, increase the sample size.
Step 4. Appropriate Test
Statistic
Test Statistic
▶ A test statistic is a value calculated from the sample data
used to decide whether to reject the null hypothesis.
▶ Test statistic is found by converting the sample statistic
to a score with the assumption that the null hypothesis is
true.
▶ Various test statistic can be derived depending the nature
of the hypothesis and the assumptions made about the
data.
▶ Common test statistics include the z-statistic (for large
samples or known population standard deviation) and the
t-statistic (for small samples or unknown population
standard deviation), Chi-square test, F-test.
Test Statistic
Test Statistic
To test a population mean, when the population variance is
known, or the sample size is large (n > 30), we use
one-sample z-test. The z-test statistic is
X̄ − µ0
Z=
√σ
n
This Z is the calculated value of Z-test statistic and denoted
as ZCalc
Test Statistic
Tests for Comparing Means:
▶ One-sample z-test: This test is used when the population
variance is known, or the sample size is large (n > 30).
▶ Two-sample z-test: This test is used when the population
variances are known, or the sample sizes are large
(n > 30).
▶ One-sample t-test: This test is used when the population
variance is unknown, and the sample size is small
(n < 30).
▶ Two-sample t-test: This test is used when the population
variances are unknown, and the sample sizes are small
(n < 30).
▶ Paired t-test: This test is used to compare the means of
two related samples when the population variances are
unknown, and the sample size is small (n < 30).
Test Statistic
Tests for Comparing Proportions
▶ One-sample proportion test: This test is used to compare
the proportion of a sample to a known population
proportion. The normal approximation is used when both
np ≥ 10 and n(1 − p) ≥ 10 (data should have at least 10
"successes" and at least 10 "failures" ) (in some books, it
is 5)
▶ Two-sample proportion test: This test is used to compare
the proportions of two independent samples. The normal
approximation is used when both np ≥ 10 and
n(1 − p) ≥ 10 (data should have at least 10 "successes"
and at least 10 "failures" ) (in some books, it is 5)
Test Statistic
Other Common Tests
▶ Goodness of fit test: This test is used to determine
whether a sample fits a specific distribution. It is used to
compare the observed frequencies of a categorical variable
to the expected frequencies under a particular distribution.
▶ Testing for independence of two attributes (Contingency
Tables): This test is used to determine whether there is a
relationship between two categorical variables. It is often
used in the form of a chi-square test, which compares the
observed frequencies in a contingency table to the
expected frequencies under the assumption of
independence.
▶ ANOVA (Analysis of Variance): This test is used to
compare the means of three or more independent
samples. It is used to determine whether there is a
significant difference between the means of the groups.
Step 5. Make a Decision
Decision Rule
▶ We always test the null hypothesis. The initial conclusion
will always be one of the following:
1. Reject the null hypothesis.
2. Fail to reject the null hypothesis.
▶ Note: Failing to reject H0 only means inability to accept
H1 , and it does not mean to accept H0 .
▶ Three procedures to make decisions in hypothesis testing
1. The critical-value approach
2. The p-value approach
3. The confidence interval approach
Decision Rule
1. Critical Value Approach
▶ A critical value (or rejection region) 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 α.
▶ Critical Values are obtained from the distribution tables
(see in the respective Tables from the text)
Decision Rule
1. Critical Value Approach
▶ Find the critical value for specific α and test (ZCrit or
tCrit )
▶ Reject H0 if |ZCalc | ≥ |ZCrit | (i.e., calculated value of the
test statistic falls in the rejection region).
▶ Very convenient when graph is made: mark the critical
value in the plot which divides the plot into Rejection and
Non-rejection regions.
Decision Rule
1. Critical Value Approach
Decision Rule
1. Critical Value Approach
Common Critical Values of Z:
Decision Rule
2. p-value Approach (most prevalent)
▶ p-value: The P-value (or probability value) is the
probability of getting a value of the test statistic that is
at least as extreme as the one representing the sample
data, assuming that the null hypothesis is true.
▶ p-value is the smallest level of α at which H0 is rejected.
▶ Find the p-value and compare the p-value with α
▶ Smaller-and-smaller P-values → stronger-and-stronger
evidence against H0
▶ If p − value ≤ α, reject H0 at α level of significance.
Decision Rule
How to fine p-value?
The calculation of the P-value depends on whether the test is
upper-, lower-, or two-tailed.
One-Tailed Z-Test (Right Tail)
p − value = P(Z > ZCalc )
One-Tailed Z-Test (Left Tail)
p − value = P(Z < −ZCalc )
Two-Tailed Z-Test:
p−value = 2x (Area to the right or left of the absolute value of the z
Decision Rule
3. Confidence Intervals Approach
▶ reject H0 at α level of significance if the population
parameter does not included in the (1 − α)100%
confidence interval.
Decision Rule
How to find CI?
(1 − α)100% CI for µ, when σ is known
σx σx
X̄ − Zα/2 √ < µ < X̄ + Zα/2 √
n n
(1 − α)100% CI for µ, when σ is unknown
S S
X̄ − tα/2,n−1 √ < µ < X̄ + tα/2,n−1 √
n n
(1 − α)100% confidence interval for p is given by
s s
p(1 − p) p(1 − p)
p̂ − Zα/2 ≤ p ≤ p̂ +
n n
Step 6. Make a Conclusion
Interpretation/Inference
Make a conclusion on the population parameter based on your
result.
Example
Exercise
A publisher of college textbooks claims that the average price
of all hardbound college textbooks is $127.50. A student group
believes that the actual mean is higher and wishes to test their
belief. State the relevant null and alternative hypotheses.
Exercise
A publisher of college textbooks claims that the average price
of all hardbound college textbooks is $127.50. A student group
believes that the actual mean is higher and wishes to test their
belief. State the relevant null and alternative hypotheses.
Solution:
The default option is to accept the publisher’s claim unless
there is compelling evidence to the contrary. Thus the null
hypothesis is H0 : µ = 127.50.
Since the student group thinks that the average textbook price
is greater than the publisher’s figure, the alternative
hypothesis in this situation is Ha : µ > 127.50.
Exercise
State the null and alternative hypotheses for each of the
following situations.
1. The average July temperature in a region historically has
been 74.5°F. Perhaps it is higher now.
2. The average weight of a female airline passenger with
luggage was 145 pounds ten years ago. The FAA believes
it to be higher now.
3. The average stipend for doctoral students in a particular
discipline at a state university is $14,756. The department
chairman believes that the national average is higher.
4. The average room rate in hotels in a certain region is
$82.53. A travel agent believes that the average in a
particular resort area is different.
5. The average farm size in a predominately rural state was
69.4 acres. The secretary of agriculture of that state
asserts that it is less today.
Exercise
Solution
1. H0 : µ = 74.5 vs. Ha : µ > 74.5
2. H0 : µ = 145 vs. Ha : µ > 145
3. H0 : µ = 14756 vs. Ha : µ > 14756
4. H0 : µ = 82.53 vs. Ha : µ ̸= 82.53
5. H0 : µ = 69.4 vs. Ha : µ < 69.4
Define Null and Alternative Hypothesis
1. According to [Link], the average price of
homes in West Orange, New Jersey, was $461,216 in
2007. Suppose a real estate researcher wants to check
whether the current average price of homes in this town is
higher than 2007. Define Null and Alternative Hypothesis
for this claim.
Define Null and Alternative Hypothesis
1. According to [Link], the average price of
homes in West Orange, New Jersey, was $461,216 in
2007. Suppose a real estate researcher wants to check
whether the current average price of homes in this town is
higher than 2007. Define Null and Alternative Hypothesis
for this claim.
H0 : µ = $461, 216
Ha : µ > $461, 216
Define Null and Alternative Hypothesis
1. According to a survey by Consumer Reports magazine
conducted in 2008, a sample of sixth graders selected
from New York schools showed that their backpacks
weighed an average of 18.4 pounds (USA TODAY, August
3, 2009). Now the government wants to check whether or
not this mean weight has changed since that survey.
Define Null and Alternative Hypothesis for this claim.
Define Null and Alternative Hypothesis
1. According to a survey by Consumer Reports magazine
conducted in 2008, a sample of sixth graders selected
from New York schools showed that their backpacks
weighed an average of 18.4 pounds (USA TODAY, August
3, 2009). Now the government wants to check whether or
not this mean weight has changed since that survey.
Define Null and Alternative Hypothesis for this claim.
H0 : µ = 18.4pounds
Ha : µ ̸= 18.4pounds
Define Null and Alternative Hypothesis
1. 10 years ago, the census bureau estimated that the
average number of U.S. citizens residing in rural counties
to be 75,000. Now, they wish to see if the average has
decreased.
Define Null and Alternative Hypothesis
1. 10 years ago, the census bureau estimated that the
average number of U.S. citizens residing in rural counties
to be 75,000. Now, they wish to see if the average has
decreased.
H0 : µ = 75, 000
Ha : µ < 75, 000
Exercise
A manufacturer claims that the average weight of its packaged
products is 500 grams. A quality control inspector randomly
selects a sample of 36 packages and measures their weights.
The sample mean is found to be 495 grams, and the
population standard deviation is known to be 15 grams.
Test the manufacturer’s claim at a 1% significance level.
Solution
1.
H0 : µ = 500grams
Ha : µ ̸= 500grams
(Two-tailed test)
2. significance level α = 0.01
3. Since, Test statistic is
X̄ − µ0 495 − 500
ZCalc = = = −23.09
√σ √15
n 36
4. Critical Value: For a two-tailed test and α = 0.01,
ZCrit = ±2.576
5. Decision: Since −2 is within the range of -2.576 to
+2.576, we fail to reject the null hypothesis.
6. Interpretation: Therefore, There is not enough evidence
at the 1% significance level to reject the manufacturer’s
claim that the average weight is 500 grams.
Exercise
An inventor has developed a new, energy-efficient lawn mower
engine. He claims that the engine will run continuously for
more than 5 hours (300 minutes) on a single gallon of regular
gasoline. (The leading brand lawnmower engine runs for 300
minutes on 1 gallon of gasoline.)
From his stock of engines, the inventor selects a simple
random sample of 50 engines for testing. The engines run for
an average of 305 minutes. The true standard deviation σ is
known and is equal to 30 minutes, and the run times of the
engines are normally distributed.
Test hypothesis that the mean run time is more than 300
minutes. Use a 0.05 level of significance.
Solution
1.
H0 : µ = 300minutes
Ha : µ > 300minutes
2. significance level α = 0.05
3. Test statistic
X̄ − µ0 300 − 305
ZCalc = = =
√σ √30
n 50
4. Critical Value, Zα=0.05 = +1.65
5. Make a Decision:
6. Interpretation
Thank you
email: [Link]@[Link]