Topic 9.
Nonparametric
Methods
LECTURE NOTES
Prepared by DRIZ
Prepared by DRIZ
Contents
Hypothesis Testing on Population Proportion
Chi-Square Distribution
Goodness-of-Fit Test
Contingency Table Analysis
Prepared by DRIZ
Introduction to Non-Parametric Methods
In the previous topics we conducted hypothesis tests on a single population mean, two population means, and three
or more population means. These tests assume that the populations follow a normal distribution and that the data are
of ratio or interval scale. Some tests, however, make no assumption regarding the shape of the population
distribution (i.e. assumption of a normal distribution is NOT necessary). These tests are called nonparametric tests.
Non-parametric methods are statistical techniques that do not rely on data belonging to any
particular distribution. Assumptions:
• Independence: The observations must be independent of each other. This means the value of one
data point doesn't influence another.
• Level of measurement: Non-parametric tests are often used with ordinal data (data that can be
ranked) or nominal data (categorical data without a specific order).
• Shape of distributions: While they don't assume a specific distribution (like normal
distribution), some tests do assume that the distribution of the data is the same across groups.
Although non-parametric methods are super useful, they do have some limitations:
• Less powerful: Non-parametric tests might not detect differences in your data as easily as parametric tests. It’s like
using a magnifying glass instead of a microscope - it's good, but not as powerful for spotting small details.
• Less efficient: They might not give the best results when your data follows a normal distribution. It's like using a
general tool instead of a specialised one—it works, but not perfectly.
• Less detailed: Non-parametric methods often don't give as much specific information about our data. It's like knowing
that people like a new product without knowing why they like it.
• Complex calculations: Some non-parametric methods can be harder to calculate and might require special software or
a more advanced understanding.
Prepared by DRIZ
In this topic, you will be introduced to several nonparametric tests for nominal level data:
• Hypothesis tests for proportions (one and two samples)
• Goodness-of-fit test that compares an observed distribution to an expected one
• Contingency table analysis that studies the relationship between two variables when one
or both are nominal scale
Hypothesis Testing: One Population Proportion
Hypothesis tests on proportions are typically used for nominal level data because nominal data is categorical and doesn't
have an inherent order or ranking. To test a hypothesis about a population proportion, a random sample is chosen from the
population. It is assumed that the binomial assumptions are met (recall Topic 4). This test is appropriate when the normal
approximation to the binomial conditions are met i.e. when 𝑛𝜋 and 𝑛 1 − 𝜋 are both greater than 5.
𝒙
Recall that a proportion is the ratio of the number of successes to the number of observations i.e. 𝒑 =
𝒏
The six steps for the hypothesis testing are similar but to calculate the test statistic, we use:
𝒑−𝝅
𝒁=
𝝅(𝟏 − 𝝅)
where 𝒏
𝜋 is the population proportion
𝑝 is the sample proportion
𝑛 is the sample size
Prepared by DRIZ
Example 1
Research at IIUM indicates that half of the students change their major area of study after their first year in a program. A random
sample of 100 students in KENMS revealed that 48 had changed their major area of study after their first year. Has there been a
significant decrease in the proportion of students who change their major after their first year in this program? Test at the 0.05
level of significance.
Prepared by DRIZ
Example 2
An article written in a local newspaper, “The Star”, reported that a job awaits only one in three new university graduates.
The major reasons given were an overabundance of university graduates and an uncertain economic condition, due to
current change in political administration. A survey of 200 recent graduates from IIUM revealed that 80 students had
jobs. At the 0.01 significance level, can we conclude that a larger proportion of IIUM students have jobs? Show all the
steps in hypothesis testing.
Prepared by DRIZ
Hypothesis Testing: Two Population Proportions
Besides testing a single population proportion, we can also test whether two sample proportions come from populations that
are equal. To conduct the test, we assume each sample is large enough that the normal distribution will serve as a good
approximation of the binomial distribution. The test statistic follows a 𝑍-distribution, using the formula
𝒑𝟏 − 𝒑𝟐
𝒁=
𝒑𝒄 (𝟏 − 𝒑𝒄 ) 𝒑𝒄 (𝟏 − 𝒑𝒄 )
𝒏𝟏 + 𝒏𝟐
where
𝑛1 is the number of observations in the first sample
𝑛2 is the number of observations in the second sample
𝑝1 is the proportion in the first sample that possess the trait
𝑝2 is the proportion in the second sample that possess the trait
𝑝𝑐 is the pooled estimate of the population proportion and is computed using the formula
𝒙𝟏 + 𝒙𝟐
𝒑𝒄 =
𝒏𝟏 + 𝒏𝟐
where
𝑋1 is the number possessing the trait in the first sample
𝑋2 is the number possessing the trait in the second sample
Prepared by DRIZ
Example 3
The Roper Organization conducted identical surveys 5 years apart. One question asked of women was “Are the men kind,
gentle and thoughtful?” The earlier survey revealed that, of the 3000 women surveyed, 2010 said that they were. The later
survey revealed that 1530 of the 3000 women surveyed thought that the men were kind, gentle and thoughtful. At the .05
level of significance, can we conclude that women think men are less kind, gentle and thoughtful in the later survey
compared with the earlier one?
Prepared by DRIZ
Example 4
The Ice Swirl wants to compare men and women in terms of preference for eating their ice cream out of a cone
to determine if there is a gender difference. They took a sample of 500 customers (240 men and 260 women)
and asked if they prefer cones over bowls. They found that 124 men preferred cones and 90 women preferred
cones. Test, at the .05 significance level, if there is any gender difference in the preference for eating ice
cream. Also find the 𝑝-value.
Prepared by DRIZ
Chi-Square Distribution
While the hypothesis test for proportions still uses the normal distribution, the other nonparametric tests use a different
test statistic, known as the chi-square distribution. A chi-square (χ2) statistic is a measure of the difference between the
observed and expected frequencies of the outcomes of a set of events or variables.
Characteristics of the Chi-square distribution
• The chi-square is positively skewed.
• The value of chi-square is non-negative.
• There is a family of chi-square distributions that are based on degrees of freedom
o When the 𝑑𝑓 change a new distribution is created.
o As the 𝑑𝑓 increase, the distribution approaches a normal distribution
Limitations of Chi-Square
If there is an unusually small expected frequency in a cell, chi-square might result in an erroneous conclusion. This can
happen because the expected frequencies, 𝑓 appear in the denominator and dividing it by a very small number makes the
quotient quite large.
Two generally accepted policies:
1) If there are only two cells, the expected frequency in each cell should be at least 5
2) For more than two cells, chi-square should not be used if more than 20 per cent of the 𝑓 cells have expected
frequencies less than 5.
One way to resolve the problem is to combine categories. Prepared by DRIZ
Goodness-of-Fit Test
The goodness-of-fit test is used to compare an observed frequency, 𝑓 to an expected frequency, 𝑓 . There are two cases – when
the expected frequencies are equal and when they are not. To conduct the test, the usual 6-step process is used.
Step 1: State the null and alternative hypotheses
𝐻0: There is no difference between the observed and the expected value.
𝐻1: There is a difference between the observed and the expected value
Step 2: Select the level of significance, 𝛂
Step 3: Calculate the test statistic 𝒇𝒐 − 𝒇𝒆 𝟐
The test statistic follows a 𝜒2 distribution, and the formula is 𝜒𝟐 =
𝒇𝒆
where
𝑓𝑜 is an observed frequency in a particular category
𝑓𝑒 is the expected frequency in a particular category with 𝑑𝑓 = (𝑘 − 1); 𝑘 is the number of categories
Step 4: Formulate the decision rule
To find the critical value, need to know the 𝑑𝑓 = (𝑘 − 1)
The decision rule is to reject 𝐻0 if 𝝌𝟐 > 𝝌𝟐
Step 5: Make a decision
Step 6: Interpret the result
Prepared by DRIZ
Example 5 (Equal Expected Frequencies)
A department store, A, has four competitors: B, C, D, and E. Store A hires a consultant to determine if the percentage of
shoppers who prefer each of the five stores is the same. A survey of 1100 randomly selected shoppers is conducted, and
the results about which one of the stores shoppers prefer are below.
Store Number of shoppers
A 262
B 234
C 204
D 190
E 210
Using the goodness-of-fit test at the .05 significance level, is there enough evidence to conclude that the proportions are
really the same?
Prepared by DRIZ
Example 6 (Unequal Expected Frequencies)
For many years TV executives used the guideline that 30 per cent of the audiences were watching each of the
traditional big three prime-time networks and 10 per cent were watching cable stations on a weekday night. A
random sample of 500 viewers last Monday night showed that 165 homes were tuned in to the ABC affiliate, 140 to
the CBS affiliate, 125 to the NBC affiliate and the remainder was viewing a cable station. At the 0.05 significance
level, can we conclude that the guideline is still reasonable?
Prepared by DRIZ
Contingency Table Analysis
Recall in Topic 2, if we wish to study the relationship between two variables when one or both are nominal scale, we tally the
results in a contingency table, i.e. a table that classifies each observation according to two identifiable characteristics. A
contingency table analysis is used to investigate whether the two characteristics are related.
To conduct the contingency table analysis, the usual 6-step hypothesis testing procedure is used.
Step 1: State the null and alternative hypotheses
𝐻0: There is no relationship between …
𝐻1: There is a relationship between …
Step 2: Select the level of significance, 𝜶
Step 3: Calculate the test statistic, which follows the 𝜒2 distribution.
(1) Compute the expected frequencies:
(𝑹𝒐𝒘 𝒕𝒐𝒕𝒂𝒍)(𝑪𝒐𝒍𝒖𝒎𝒏 𝒕𝒐𝒕𝒂𝒍)
𝒇𝒆 =
𝑮𝒓𝒂𝒏𝒅 𝒕𝒐𝒕𝒂𝒍
Prepared by DRIZ
Contingency Table Analysis
Step 3: Calculate the test statistic, which follows the 𝜒2 distribution.
(2) Compute the test statistic
(𝒇𝒐 − 𝒇𝒆 )𝟐
𝜒𝟐 =
𝒇𝒆
where
𝑓 is the observed frequencies
𝑓 is the expected frequencies
Step 4: Formulate the decision rule
To find the critical value, need to know the degrees of freedom and 𝛼.
The decision rule is to reject 𝐻0 if 𝝌𝟐 > 𝝌𝟐
𝑑𝑓 = 𝑟 − 1 𝑐 − 1
where 𝑟 is the number of rows; 𝑐 is the number of columns
Step 5: Make a decision
Step 6: Interpret the result
Prepared by DRIZ
Example 7
The air travel industry conducted a survey to determine if air travel anxiety depends upon the frequency of air travel.
The number of passengers self-reporting air travel anxiety based on their frequent flier status is given below.
Frequency of air travel Anxiety No anxiety
Not frequent fliers 12 28
Frequent fliers 3 37
Is there an association between air travel anxiety and frequent flier status? Test at the .05 level of significance.
Also estimate the 𝑝-value.
Prepared by DRIZ
Example 8
A study regarding the relationship between age and the amount of pressure sales personnel feel in relation to their jobs
revealed the following sample information. At the .01 significance level, is there a relationship between job pressure and age?
Degree of job pressure
Age (years) Low Medium High
Less than 25 20 18 22
25 up to 40 50 46 44
40 up to 60 58 63 59
60 and older 34 43 43
Prepared by DRIZ
Example 9
The following table shows a random sample of 180 employees taken from the entire workforce of a supermarket. Test
whether an employee’s gender has any association with his or her type of job, at the 5% level of significance.
Male Female
Supervisor 20 15
Shelf stacker 20 30
Cashier 10 35
Cleaner 10 40
Prepared by DRIZ
Prepared by DRIZ