You are on page 1of 32

Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Hypothesis testing (concerning one population)

Bhargav Adhvaryu Ahmedabad


Professor of Urban Science
Amrut Mody School of Management University
Bhargav Adhvaryu Hypothesis testing (concerning one population) 1 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Lecture outline

1. Introduction
2. Hypothesis test for mean
3. The 𝒑-value approach in hypothesis testing
4. Hypothesis test for proportion
5. Chi-squared (𝛘𝟐 ) goodness-of-fit test

Bhargav Adhvaryu Hypothesis testing (concerning one population) 2 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Introduction

• In “Sampling and estimation”, we discussed estimating a population parameter based on a


sample statistic.
• We saw there are two types of estimates:
1. A point estimate
2. A confidence interval (ie, range)
• However, in many situations (especially in public policy and business administration) the
analyst must arrive at a decision concerning the population parameter (ie, whether a
statement concerning a population parameter is true or false).
• A statement, which is an assertion concerning a population parameter is known as a
hypothesis.
• It is obvious that whether any statement of assertion is TRUE or FALSE cannot be
ascertained with absolute certainty, unless we survey the entire population! This is
impractical, so the decision regarding the “truthfulness” of the hypothesis must be based
on sample of observations.

Bhargav Adhvaryu Hypothesis testing (concerning one population) 3 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Introduction
Stating the hypotheses (1)
• Hypothesis testing is the procedure by which we can furnish evidence that either supports
or does not support a hypothesis, based on analysing sample data.
• Hypothesis testing procedure starts with stating two hypotheses - this is required
because if you reject one of the hypotheses, then you must accept the other.
• The statements of assertion are known as null hypothesis and alternative hypothesis.
• Null hypothesis is a statement that specifies a particular value for some population
parameter, eg

𝐇𝟎 : 𝝁 = 𝝁𝟎
• Alternative hypothesis is a statement that specifies a value for some population parameter
which is not equal to or greater than or less than something, eg

𝐇𝟏 : 𝝁 ≠ 𝝁𝟎 or 𝐇𝟏 : 𝝁 < 𝝁𝟎 or 𝐇𝟏 : 𝝁 > 𝝁𝟎
Bhargav Adhvaryu Hypothesis testing (concerning one population) 4 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Introduction
Stating the hypotheses (1)
• Let us say that a famous social media company claims that on average 1.5 billion users
log on to their platform (web and mobile app) every day.

• In this case the null hypothesis is:

HO : 𝝁 = 𝟏. 𝟓 𝐛𝐢𝐥𝐥𝐢𝐨𝐧

• A Government agency says that the above claim is untrue! Depending upon the “direction”
of the alternative argument,
• The alternative hypothesis is as follows if “direction is not known”:

H1 :𝝁 ≠ 𝟏. 𝟓 Two-tailed

• If the direction of 𝝁 is known, then H1 changes to:

H1 :𝝁 > 𝟏. 𝟓
or One-tailed
H1 :𝝁 < 𝟏. 𝟓

Bhargav Adhvaryu Hypothesis testing (concerning one population) 5 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Introduction
Acceptance and rejection regions: two-tailed test
• In hypothesis testing we check the validity of the H0 against H1,
• We then either accept or reject H0
• If we reject H0, we must accept H1
• If we take a case of a statistic which has a normal sampling distribution than the
acceptance of the null hypothesis can be shown using the following diagram (with mean
as an example) .

Confidence interval

𝜇 𝑥̅
Two-tailed hypothesis (at level of significance = α)
𝐼𝑓 𝑝 − 𝑣𝑎𝑙𝑢𝑒 > 𝛼, 𝑡ℎ𝑒𝑛 𝑎𝑐𝑐𝑒𝑝𝑡 𝐻 ; 𝑖𝑓 𝑝 − 𝑣𝑎𝑙𝑢𝑒 < 𝛼, 𝑡ℎ𝑒𝑛 𝑟𝑒𝑗𝑒𝑐𝑡 𝐻
Bhargav Adhvaryu Hypothesis testing (concerning one population) 6 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Introduction
Acceptance and rejection regions: one-tailed test

𝜇 𝜇
One-tailed hypothesis (at level of significance = α)

𝜇 𝑝 − 𝑣𝑎𝑙𝑢𝑒 < 𝛼, 𝑡ℎ𝑒𝑛 𝑟𝑒𝑗𝑒𝑐𝑡 𝐻


𝐼𝑓 𝑝 − 𝑣𝑎𝑙𝑢𝑒 > 𝛼, 𝑡ℎ𝑒𝑛 𝑎𝑐𝑐𝑒𝑝𝑡 𝐻 ; 𝑖𝑓

• The concept of p-value is explained later in the lecture.


Bhargav Adhvaryu Hypothesis testing (concerning one population) 7 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Hypothesis test for mean


Aka, NHST (null-hypothesis significance test)

Example 1

A municipal corporation claims in its annual report that the average number of complaints resolved
per year per employee is 200. The union leader claims that this is not the case and claims that the
average conflicts resolved are higher than what the management claims. To analyse this issue, a
random sample of 60 employees is taken the mean of which turns out to be 210). From past data, it
is known that the population standard deviation is 30. Do a test of significance at 95% LoC.
• Step 1: State H0 and H1
H0 : µ = 𝟐𝟎𝟎 H1 : µ > 𝟐𝟎𝟎

• Step 2: Determine appropriate test statistics and its directions. Here the test statistics is 𝒛
and it will be a one-tailed test. The value of:
𝑿 𝝁𝟎
𝒛= 𝝈
𝒏

Bhargav Adhvaryu Hypothesis testing (concerning one population) 8 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Hypothesis test for mean

Step 3: Calculate the values of test statistic

𝒙 𝝁𝟎 𝟐𝟏𝟎 𝟐𝟎𝟎
𝒄𝒂𝒍 𝝈 = 𝟑𝟎
𝒏 𝟔𝟎

Step 4: Specify a level of significance (𝜶)


It is given that LoC is 0.95 ; LoS is 0.05 = 𝛂

Step 5: Find the critical value of test statistic


𝒛𝟎. 𝟎𝟓 = 𝟏. 𝟔𝟒𝟓 ( from 𝒛 table)

Bhargav Adhvaryu Hypothesis testing (concerning one population) 9 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Hypothesis test for mean

Step 6: Compare the two values of test statistics


𝒛𝒄𝒂𝒍 = 𝟐. 𝟓𝟖 𝒂𝒏𝒅 𝒛𝒄𝒓 = 𝟏. 𝟔𝟒𝟓

Step 7: Conclude
𝒛𝒄𝒂𝒍 > 𝒛𝒄𝒓  Reject 𝑯𝒐 (ie, accept 𝑯𝟏)

• The hypothesis test provides evidence that does not support 𝑯𝒐 and hence 𝑯𝟏 must be
accepted.
• The claim of the union leader is valid, ie there is enough evidence to support the
statement that more than 200 conflicts are resolved per year per employee.

Bhargav Adhvaryu Hypothesis testing (concerning one population) 10 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Hypothesis test for mean

• In general, the acceptance region contains values of the sample mean that are consistent
with the null hypothesis (ie, those values which are reasonably similar to the
hypothesised value). If sample mean falls in accept region, then the sample provides NO
evidence to reject the null hypothesis. Conversely, the rejection region contains the
values of sample mean which are inconsistent with the null hypothesis (ie, those values
which are not reasonably similar to the hypothesised values). If sample mean falls in
rejection region, then the sample provides SOME evidence to reject the null, in favour of
the alternative hypothesis.

Bhargav Adhvaryu Hypothesis testing (concerning one population) 11 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

The 𝒑-value approach in hypothesis testing

Using example 1, steps 1 to 4 remain the same.


Step 5: Calculate the 𝒑 values corresponding to the test statistics
(𝒛 in this case)
• 𝒑-value for 𝒛 = 2.58 is 0.0049 (see figures)
• If 𝒑 > 𝛂 then accept H0
• If 𝒑 < 𝛂 then reject H0 (and accept H1)
• In this case, 𝒑 (0.0049) < 𝛂 (0.05), therefore we reject H0.

Bhargav Adhvaryu Hypothesis testing (concerning one population) 12 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

The 𝒑-value approach in hypothesis testing

• In general, smaller 𝒑-value implies that more the data contradict H0 OR there is stronger
evidence against H0 to be true. The hull hypothesis is usually a statement indicating NO
relationship or association between variables (ie, “nothing is going on” in the dataset). In

other words, as 𝒑  0, the alternative hypothesis is more likely to be “true”.

Bhargav Adhvaryu Hypothesis testing (concerning one population) 13 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

The 𝒑-value approach in hypothesis testing

A VERY IMPORTANT NOTE


• The 𝒑 -value is NOT the probability of H0 being true. In fact, it is a CONDITIONAL
PROBABILITY. That is, 𝒑 is the probability of obtaining the value of the test statistic given
H0 is true,
ie: 𝒑 = 𝐏𝐫 𝑶𝒃𝒔 𝒗𝒂𝒍𝒖𝒆 𝑯𝟎 )
• In the earlier example, p=0.0049 (ie, 1 in ca. 200) is the probability of obtaining a sample
mean = 210, when in fact population mean is 200.
• In other words, this leads the researcher to reject the null hypothesis because either a
very rare data result has been observed, or the null hypothesis is incorrect.
• Recommended further reading on 𝒑-value:
http://www.sportsci.org/resource/stats/pvalues.html
One more note!
• Some statisticians, instead of preselecting 𝛂 at arbitrary levels, such as 1, 5, or 10 %, they
obtain the 𝒑 which can also be looked upon as the lowest LoS at which a null hypothesis
can be rejected. Most statistical software packages output 𝒑 values.
Bhargav Adhvaryu Hypothesis testing (concerning one population) 14 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Hypothesis test for proportion

Example 2

The pollution control board has set a standard that at least 70% of the vehicles should have been
checked for emission levels. To check the efficiency of the traffic police, a random sample of 150
vehicles was taken, from which 93 had “inspected” label on it. Can we conclude that inspection
programme is operation below standards? Conduct a test of significance at 𝜶 =𝟎.𝟎𝟏.
Step 1: state H1 and H0
H0 : 𝝅 𝟎. 𝟕𝟎 H1 : 𝝅 < 𝟎. 𝟕𝟎
Step 2: determine appropriate test statistics and its directions.
Here the test statistics is 𝒛, this is because the normal approximation to binomial distribution
holds good (ie, if 𝒏𝒑 > 𝟓 and 𝒏𝒒 > 𝟓 then a normal distribution with mean 𝒏𝒑 and SD √𝒏𝒑𝒒 can
be used to approximate a binomial distribution. The test will be a one-tailed test.

Bhargav Adhvaryu Hypothesis testing (concerning one population) 15 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Hypothesis test for proportion

Step 3: calculate the value of the test statistic

𝒑 − 𝒑𝟎 𝟗𝟑
𝒛𝒄𝒂𝒍 = 𝒘𝒉𝒆𝒓𝒆 𝒑 = = 𝟎. 𝟔𝟐, 𝒑𝟎 = 𝟎. 𝟕, 𝒏 = 𝟏𝟓𝟎
𝒑𝟎 𝒒𝟎 𝟏𝟓𝟎
𝒏
𝟎. 𝟔𝟐 − 𝟎. 𝟕𝟎
𝒛𝒄𝒂𝒍 = = −𝟐. 𝟏𝟑𝟗
𝟎. 𝟕𝟎 × 𝟎. 𝟑𝟎
𝟏𝟓𝟎
Step 4: find critical value of test statistic at 𝛂

𝑧 = −2.32
from table

𝑧 = −2.139

Bhargav Adhvaryu Hypothesis testing (concerning one population) 16 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Hypothesis test for proportion

Step 5 : compare the two values of test statistics


𝒛𝒄𝒂𝒍 = −𝟐. 𝟏𝟑𝟗 and 𝒛𝒄𝒓 = −𝟐. 𝟑𝟐
𝒛𝒄𝒂𝒍 > 𝒛𝒄𝒓 ∴ Accept H0
Step 6 : conclude
• We have no evidence (from the sample data) that suggests rejection of H0 (at 1% Level of
significance)
• Indeed, the vehicles inspected by the traffic police meet the standards set by PCB.
• Also, confirm your inference based on p-value.
• p-value=0.0162 (ie, p>𝛂 (0.01), implies accept H0 (using PQRS or mobile app)
• Remember: p=0.0162 (ie, 1 in ca. 60) is the probability of obtaining sample proportion as
62%, when in fact the population proportion is 70%
• Note is 𝛂 was choses as 0.05, then we would end up rejecting the H0!

Bhargav Adhvaryu Hypothesis testing (concerning one population) 17 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Types of errors
Example of image recognition AI software
Case-1 • Initial assumption: image is a dog (correct null hypothesis)
• If the AI gives the result as:
• Dog => then correct decision
• Wolf => then incorrect decision
• This type of incorrect decision is known as Type I error
• Aka, false-positive; false alarm!

Case-2
• Initial assumption: image is a dog (incorrect null hypothesis)
• If the AI gives the result as:
• Wolf => then correct decision (task failed successfully!)
• Dog => then incorrect decision
• This type of incorrect design is known as Type II error
• Aka, false-negative; miss!

Bhargav Adhvaryu Hypothesis testing (concerning one population) 18 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Types of errors
(applicable to all types of hypotheses testing)
• We saw earlier that the probability of committing an error depends on the level of
confidence value that we are willing to accept.
Our Decision

We accept 𝑯𝟎 We reject 𝑯𝟎
Type I error
Correct decision!
𝑯𝟎 correct (probability=𝜶)
(probability=𝟏 − 𝜶)
FALSE ALARM!
Reality
Type II error
Correct decision!
𝑯𝟎 incorrect (probability=𝜷)
(probability=𝟏 − 𝜷)
MISS!
[OPTIONAL]
• Sometimes (𝟏 − 𝜷) is known as power of test as it denotes how good a test is to detect a
false null hypothesis.
• Products that requires stringent quality control, may find it useful to calculate type II
errors. The calculations are beyond the scope of this course but given a threshold value, it
can be easily calculated as shown in Anderson et al (2018), sections 9.6-9.7.
Bhargav Adhvaryu Hypothesis testing (concerning one population) 19 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Chi-squared 𝛘𝟐 goodness-of-fit test


Introduction (1)

• This test is conducted to see how well an observed frequency distribution fits in the
theoretical frequency distribution.
• This is a case of hypothesis testing where 𝛘𝟐 is the test statistics given as:
𝒌 𝟐
𝑶𝒊 − 𝑬𝒊
𝝌𝟐 =
𝑬𝒊
𝒊 𝟏
where;
𝛘𝟐 = a random variable whose sample distribution is approximately chi-squared distributed with 𝝂 = 𝒌 − 𝟏
degrees of freedom.
𝒌 = number of cells
𝑶𝒊 = observed frequency in cell 𝒊
𝑬𝒊 = expected frequency in cell 𝒊

Bhargav Adhvaryu Hypothesis testing (concerning one population) 20 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Chi-squared 𝛘𝟐 goodness-of-fit test


Introduction (2)

A random variable is said to be 𝛘𝟐 distributed with 𝝂 degrees of freedom, if it has a right-


skewed frequency distribution. As the degree of freedom increases, the right-skewness
decreases. The figure below shows typical distribution curves for df=5, 10, and 19. Areas
under the curve are read from a table or an app (just like in case of normal or t-distribution
curves).

Bhargav Adhvaryu Hypothesis testing (concerning one population) 21 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Chi-squared 𝛘𝟐 goodness-of-fit test


In-class example
Road accidents
Steps to conduct test 𝝌𝟐 goodness of fit test
Time of No. of
day accidents 1) Frame null and alternative hypothesis.

8-10 am 20 2) Calculate expected frequencies.

3) Calculate the values of 𝝌𝟐 test statistics


10-12 pm 22
4) Compare 𝝌𝟐 observed with 𝝌𝟐 critical value
12-2 pm 17
5) Draw conclusion
2-4 pm 18 • If observed value ≥ critical value ; reject H0; otherwise accept
4-6 pm 19 H0 (and reject H1)

6-8 pm 24 • OR is p-value ≥ α, accept H0, otherwise accept H0 (and reject

H1)
Total 120

Bhargav Adhvaryu Hypothesis testing (concerning one population) 22 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Chi-squared (𝛘𝟐 ) goodness-of-fit test


Solution to in-class example (1)

1) Frame null and alternative hypothesis.

• The null hypothesis is accidents have no bearing on time of the day (ie, other words,

observed data does follow a uniform distribution)

• The alternative hypothesis is accidents have a bearing on time of the day ( ie, in other

words, observed data does not follow a uniform distribution)

Bhargav Adhvaryu Hypothesis testing (concerning one population) 23 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Chi-squared 𝛘𝟐 goodness-of-fit test


Solution to in-class example (2)
2) Calculate expected frequencies

Bhargav Adhvaryu Hypothesis testing (concerning one population) 24 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Chi-squared 𝛘𝟐 goodness-of-fit test


Solution to in-class example (3)

3) Calculate the values of 𝝌𝟐 test statistics


𝝌𝟐 = 1.70 (see last column of previous table)

4) Compare 𝝌𝟐 observed with 𝝌𝟐 critical value

Bhargav Adhvaryu Hypothesis testing (concerning one population) 25 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Chi-squared 𝛘𝟐 goodness-of-fit test


Solution to in-class example (4)
Conclusion

Smaller the 𝒑-value, more is the evidence against H0. In this case the 𝒑 -value is significantly

larger and more importantly larger than level of significance, so we accept H0. In other

words, we do not have sufficient evidence from the data to reject H0 (and therefore we

accept it) ie, ACCIDENTS HAVE NO BEARING ON THE TIME OF THE DAY.

Some points to be noted about 𝝌𝟐 goodness-of–fit test

1. Cannot be carried on percentage values.

2. Cell values must be more than 5, if not, then adjacent cell value must be combined at the

loss of degree(s) of freedom

3. Can also be applied to test whether observed data conforms standard distributions ( ie,

Normal or Poisson)
Bhargav Adhvaryu Hypothesis testing (concerning one population) 26 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Chi-squared 𝛘𝟐 goodness-of-fit test


In-class example (Q2)

Q1: A sample survey of 300 employed persons was conducted in Gold City to ascertain
whether the jobs distribution by employer type matches the pattern at national level.
The survey data is presented in the table below. Conduct a 𝛘𝟐 goodness-of-fit test at
90% level of confidence.

Employer Type No. of Employees


Private 122 (38%)
Government 85 (32%)
Semi-government 76 (23%)
NGO 17 (7%)
Totals 300 (100%)
Note: Values in bracket indicate the national %
Bhargav Adhvaryu Hypothesis testing (concerning one population) 27 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Chi-squared 𝛘𝟐 goodness-of-fit test


Solution: in-class example (Q2)
A sample survey of 300 employed persons showing distribution of jobs by employer type in Gold City

Observed (O) Expected (E) Expected (E)


Employer type (O-E) (O-E)^2 ((O-E)^2/E)
[No.] [%] [%]
Govt 122 38% 114 8 64 0.56
Semi-government 85 32% 96 -11 121 1.26
Private 76 23% 69 7 49 0.71
NGO 17 7% 21 -4 16 0.76
Totals 300 100% 300 3.29

α= 0.1 H0= The job distribution in City A follows the national pattern
df= 3 H1= The job distribution in City A DOES NOT follows the national pattern

Method-1: Critical value approach


Chi-squared OBS 3.29
Chi-squared CRITICAL 6.2514
Conclusion Accept H0 If critical value ≥ observed value , accept H0; otherwise reject H0 (and accept H1).

Method-2: p-value approach


p-value 0.3485
α 0.1
Conclusion Accept H0 If p-value ≥ α , accept H0; otherwise, reject H0 (and accept H1).

0.3485 <--Obtained by use of in-built Excel function


Bhargav Adhvaryu Hypothesis testing (concerning one population) 28 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Chi-squared 𝛘𝟐 goodness-of-fit test FOR SELF STUDY


In-class example (Q1)

Q2: A sample survey of 100 affluent households was conducted to study their
preferences for housing typology in AUSOME City. The housing typology was
bungalows, semi-detached, quadruplex, flat and tenement, which respectively were
preferred by 32, 28, 16, 14 and 10 households. Conduct a 𝛘𝟐 goodness-of-fit test at
95% level of confidence to ascertain whether households show strong preference for
housing typology.

Bhargav Adhvaryu Hypothesis testing (concerning one population) 29 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Chi-squared 𝛘𝟐 goodness-of-fit test FOR SELF STUDY


Solution: in-class example (Q1)
A sample survey of 100 affluent households showing preferences for housing typology

Preference for Observed (O) Expected (E) (O-E) (O-E)^2 ((O-E)^2/E)


Bungalow 32 20 12 144 7.20
Semi-detached 28 20 8 64 3.20
Quadruplex 16 20 -4 16 0.80

Flat 14 20 -6 36 1.80
Tenement 10 20 -10 100 5.00
Totals 100 100 18.00

α= 0.05 H0= Affluent households show DO NOT SHOW preference for housing type
df= 4 H1= Affluent households show DO SHOW preference for housing type

Method-1: Critical value approach


Chi-squared OBS 18.00
Chi-squared CRITICAL 9.4877
Conclusion Reject H0 If critical value ≥ observed value , accept H0; otherwise reject H0 (and accept H1).

Method-2: p-value approach


p-value 0.0012
α 0.05
Conclusion Reject H0 If p-value ≥ α , accept H0; otherwise, reject H0 (and accept H1).

0.0012 <--Obtained by use of in-built Excel function


Bhargav Adhvaryu Hypothesis testing (concerning one population) 30 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Chi-squared 𝛘𝟐 goodness-of-fit test FOR SELF STUDY


In-class example (Q3)

Q3: The CID compiles data on violent crimes at national level under four heads:
murder, rape, robbery, and assault. The average values of the last decade are: 1.1%,
6.3%, 28.6% and 64%, respectively. A simple random sample of 500 violent crimes
reports from last year had distribution of these four crimes, respectively as: 3, 37,
154 and 306. Using a chi-squared test of goodness-of-fit determined if the last
year’s crime pattern has changed than the historical pattern, at 5% level of
significance.
(Adapted from Weiss, N.A. (2011). Elementary statistics (8th ed.) Addison-Wesley)

Bhargav Adhvaryu Hypothesis testing (concerning one population) 31 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.
Lecture course • TOD501: Probability and Statistics • Amrut Mody School of Management, Ahmedabad University, Monsoon 2022

Introduction Hypothesis test for mean P-value approach in HT Hypothesis test for proportion 𝝌𝟐 goodness of fit test

Chi-squared 𝛘𝟐 goodness-of-fit test FOR SELF STUDY


Solutions to in-class examples
A sample survey of 500 violent crimes

Observed (O)
Expected (E) Expected (E)
Violent crime type (O-E) (O-E)^2 ((O-E)^2/E)
[No.] [%] [%]
Murder 3 1.1% 5.5 -3 6 1.14
Rape 37 6.3% 31.5 6 30 0.96
Robbery 154 28.6% 143 11 121 0.85
Assault 306 64.0% 320 -14 196 0.61
Totals 500 100% 500 3.56
(Data adapted from Weiss, N. A. (2011). Elementary statistics (8th ed.). Addison-Wesley)
α= 0.05 H0= Last year’s crime pattern is NOT DIFFERENT than the historical pattern
df= 3 H1= Last year’s crime pattern is DIFFERENT than the historical pattern

Method-1: Critical value approach


Chi-squared OBS 3.56
Chi-squared CRITICAL 7.8147
Conclusion Accept H0 If critical value ≥ observed value , accept H0; otherwise reject H0 (and accept H1).

Method-2: p-value approach


p-value 0.3137
α 0.05
Conclusion Accept H0 If p-value ≥ α , accept H0; otherwise, reject H0 (and accept H1).

0.3137 <--Obtained by use of in-built Excel function


Bhargav Adhvaryu Hypothesis testing (concerning one population) 32 of 32

This document is for use ONLY by the students who attend this lecture
and should NOT be circulated and used outside this group of students.

You might also like