Mann Whitney U Test: ENS 185 - Data Analysis

Download as pdf or txt
Download as pdf or txt
You are on page 1of 100

ENS 185 - Data Analysis

Mann
Whitney U
Test
Adelantar . Asturias . Arsulo . Ali. Borjel . Binuhat
Catinggan . Catulong . Cellona . Dandang
Contents
1 2 3 4
History and Description and Derivation of Application and
Definition Concept Formulas Examples
History
and Definition
History
The Mann-Whitney U-Test, named after Henry Mann and
Donald R. Whitney, was developed in 1947.
It was initially introduced as a non-parametric alternative
to the parametric t-test for independent samples.
The motivation behind its development was to have a
statistical test that could handle data with non-normal
distributions or other violations of parametric assumptions.
The test gained popularity due to its versatility and
robustness, making it suitable for a wide range of research
fields.
History
The Mann-Whitney U-Test has been extensively used in
disciplines such as psychology, biology, sociology, and
economics, among others. •Its application extends to both
experimental and observational studies, allowing
researchers to compare two independent groups without
requiring assumptions about the underlying distributions.
Over time, the test has undergone refinements and
variations, including the Mann-Whitney-Wilcoxon test and
the Wilcoxon rank-sum test, which have expanded its
utility and applicability in different research contexts.
Definition
The Mann-Whitney U-Test is a statistical test used to compare the
distributions of two independent samples.

It is a non-parametric test, meaning it does not assume a specific


distribution shape for the data.

The test assesses whether there is a significant difference between the


medians of the two samples

It focuses on the ranks of the data rather than the actual values, making it
suitable for ordinal or non-normally distributed data.
Definition
The test works by combining the two samples, assigning ranks to the
combined data, and calculating a U statistic.

The U statistic represents the probability that a randomly selected value


from one sample is greater than a randomly selected value from the other
sample.
By comparing the observed U statistic to the expected distribution under the
null hypothesis, a p-value is calculated to determine the significance of the
difference between the two samples.
A small p-value suggests evidence of a significant difference, while a large p-
value indicates no significant difference between the samples.
Description
and Concept
To use the Mann-Whitney U test, you
need two independent groups of data.
1 State the null and alternative hypothesis and rejection criteria. The null hypothesis
states that median difference between the pairs ranks of the observations is zero and the
alternative hypothesis states that the median difference between the ranks of data is not
zero.

2 Perform a ranking in all observations. Combine two samples of data together, and sort
the data in ascending order. If there are ties (i.e., multiple observations with the same
value), assign the average rank to each tied observation.

3 Calculate the U Statistic for the two groups. The formula is given as: U =
n1n2+0.5n1(n1+1)-R1, where n1 and n2 are the sample sizes of the two groups, and R1 is the
sum of ranks for Group 1.
To use the Mann-Whitney U test, you
need two independent groups of data.
4 Determine the critical value associated with the U statistic. Look up the critical value
for the Z-score in the standard normal distribution table or use a statistical software
package to obtain the p-value associated with the Z-score.

5 Compare the obtained p-value with the significance level (e.g., α = 0.05) to make a
decision. If the p-value is less than the significance level, you reject the null hypothesis and
conclude that there is a significant difference between the two groups.
t's important to note that the Mann-Whitney U test
only detects a difference between the groups but
does not provide information about the direction
or magnitude of the difference. Additionally, it
assumes that the observations in each group are
independent and come from continuous
distributions.

Alternatively, if you have access to statistical


software such as R, Python, or SPSS, you can input
your data and let the software handle the
calculations and hypothesis testing for you. These
software packages typically have built-in
functions or modules for conducting the Mann-
Whitney U test.
Overall, the Mann-Whitney U test is a useful non-parametric test
for comparing two independent groups when the assumptions of
the t-test are not met or when dealing with ordinal or skewed
data.
Derivation
of Formulas
Derivation
Calculate the U statistic:
The U statistic is defined as the sum of ranks for one of the samples.
There are two possible U statistics:
U1: The sum of ranks for Sample 1.
U2: The sum of ranks for Sample 2.
Application
and Examples
Applications
The Mann-Whitney U test, (Wilcoxon rank-sum
test), is a non-parametric statistical test used to
determine if there is a significant difference
between the distributions of two independent
groups. It is often used as an alternative to the
independent samples t-test when the assumptions
for parametric testing are violated, such as when
the data is not normally distributed or when the
sample sizes are small.
You can use the Mann-Whitney U
test in the following scenarios:
1 2

Comparing two independent groups: When Non-parametric data: When your data does
you have two independent groups, and you not meet the assumptions required for
want to determine if there is a significant parametric tests, such as normally distributed
difference between their distributions. For data or equal variances. The Mann-Whitney U
example, you may want to compare the exam test does not assume any specific distribution
scores of students who received different and can handle ordinal, interval, or skewed
teaching methods to see if there is a data.
significant difference in their performances.
You can use the Mann-Whitney U
test in the following scenarios:
3 4

Small sample sizes: When your sample sizes Ordinal or ranked data: The Mann-Whitney U
are small, the Mann-Whitney U test can be a test is designed to analyze ranked or ordinal
more appropriate choice compared to the t- data, where the values are ordered but the
test, which assumes larger sample sizes for intervals between them may not be equal.
accurate results.
It is important to note that the Mann-Whitney U test is only
applicable for independent samples. If you have paired or
related samples, you should consider using the Wilcoxon
signed-rank test instead.

Remember, before conducting any statistical test, it is


essential to assess the assumptions of the test and ensure that
the test is appropriate for your specific research question and
data.
Example 1
The reaction time is measured among small group
of men and women (refer to the table below). It
was claimed that there is no significant difference
in the rank sum of the gathered data. Is the claim
valid? Use a=0.05.
Female

Male
Example 2
A new approach to prenatal care is proposed for pregnant
women living in a rural community. The new program involves
in-home visits during the course of pregnancy in addition to
the usual or regularly scheduled visits. A pilot randomized trial
with 15 pregnant women is designed to evaluate whether
women who participate in the program deliver healthier
babies than women receiving usual care. The outcome is the
APGAR scoretext annotation indicator measured 5 minutes
after birth. Recall that APGAR scores range from 0 to 10 with
scores of 7 or higher considered normal (healthy), 4-6 low and
0-3 critically low. The data are shown below. Is there
statistical evidence of a difference in APGAR scores in women
receiving the new and enhanced versus usual prenatal care?
CONTENTS

01 02 02 03

INTRODUCTION PROCEDURE FORMULAS EXAMPLES


PART 01

INTRODUCTION
The TEST

Wilcoxon Signed Rank Test,


named after Frank Wilcoxon, is 1
a test used in analyzing or
comparing two quantitative
measurements taken from the 2
same sample.

The "signed-rank" aspect of the test refers to the


fact that it uses the signed ranks of the
differences between paired observations.
USES

Ordinal Data Non-continuous Data

Hypothesis Testing Paired Data Analysis

Small Sample Sizes


PART 02

PROCEDURE
and FORMULAS
Case 1: Paired data

1 State the null hypothesis (H0) and alternative hypothesis (H1). The null
hypothesis states that there is no significant difference between the medians of
the paired samples, while the alternative hypothesis states that there is a
significant difference.
2 Calculate each paired difference, di = xi - yi, where xi, yi are the pairs of
observations.
3 Rank the dis, ignoring the signs (i.e. assignTitle
rank 1 to the smallest
,rank 2 to the next etc.) text
4 Label each rank with its sign, according to the sign of di.
Calculate W +, the sum of the ranks of the positive dis, and W−, the sum of the
5 ranks of the negative dis. (As a check the total, W + + W−, should be equal to
, where n is the number of pairs of observations in the sample).
Case 2: Single set of
observations
1 State the null hypothesis - the median value is equal to some value M.

2 Calculate the difference between each observation and the hypothesized


median, di = xi − M.
3 Apply Steps 3-5 as above.
Under the null hypothesis, we would expect the distribution of the differences to be approximately
symmetric around zero and the distribution of positivesTitle
and negatives to be distributed at random
among the ranks. Under this assumption, it is possible to work out the exact probability of every
possible outcome for W. To carry out the test,text
we therefore proceed as follows:
6 Choose W = min (W−, W +).
Use tables of critical values for the Wilcoxon signed rank sum test to find the
probability of observing a value of W or more extreme. Most tables give both one-
7 sided and two-sided p-values. If not, double the one-sided p-value to obtain the
two-sided p-value. This is an exact test.
Normal Approximation

If the number of observations/pairs is such that


( + )
is large enough (>30), a normal approximation
( + ) ( + )( + )
can be used with µW = and σW = .

Dealing with ties:


There are two types of tied observations that may Title
arise when using the Wilcoxon signed
rank test: text
Observations in the sample may be exactly equal to M (i.e., 0 in the case of
paired differences). Ignore such observations and adjust n accordingly.
Two or more observations/differences may be equal. If so, average the

ranks across the tied observations and reduce the variance by for
each group of t tied rank
PART 03

EXAMPLES
EXAMPLE 1

In an effort to increase production of an automobile part, the factory manager


decides to play music in the manufacturing area. Eight workers are selected, and
the number of items each produced for a specific day is recorded. After one week
of music, the same workers are monitored again. The data are given in the table.
At \alpha = 0.05, can the manager conclude that listening to music has increased
production? Use the Wilcoxon Signed-Rank Test since there is no mention of the
population being normally distributed.

Worker 1 2 3 4 5 6 7 8 9
Before 6 8 10 9 5 12 9 5 7
After 10 12 9 12 8 13 8 5 10
EXAMPLE 2

Weight Loss Study Suppose you are conducting a


study on the effectiveness of a new weight loss
program. You have collected data from 20
participants who followed the program for 12
weeks. You want to determine if there is a
significant difference in weight before and after
the program.
Thank you
for listening
KRUSKAL-WALLIS
1 WAY ANOVA
KRUSKAL-WALLIS
TEST

The Kruskal-Wallis test is a nonparametric test that can be

used to compare three or more groups on a continuous


or ordinal dependent variable. It is considered the

nonparametric alternative to the one-way ANOVA, and an

extension of the Mann-Whitney U test to allow the


comparison of more than two independent groups.
TEST
STATISTIC

The test statistic for the Kruskal- where:

Wallis test is a chi-squared statistic k is the number of groups


with k-1 degrees of freedom, where Ri​is the sum of the ranks for group i
n is the total number of observations
k is the number of groups. The test

statistic is calculated as follows:


P - VALUE If the p-value is less than the
significance level, then the null
KRUSKAL-WALLIS hypothesis is rejected and there is
evidence to suggest that the medians
The p-value for the Kruskal-Wallis test can of the groups are not equal.
be calculated using a chi-squared table. The

p-value is the probability of obtaining a chi- The magnitude of the chi-squared


squared statistic at least as extreme as the statistic can be used to determine the
size of the difference between the
one that was observed, assuming that the medians.
null hypothesis is true.
EXAMPLE #1

A clinical study is designed to assess differences in albumin levels in adults following diets

with different amounts of protein. Low protein diets are often prescribed for patients with
kidney failure. Albumin is the most abundant protein in blood, and its concentration in the

serum is measured in grams per deciliter (g/dL). Clinically, serum albumin concentrations
are also used to assess whether patients get sufficient protein in their diets. Three diets are

compared, ranging from 5% to 15% protein, and the 15% protein diet represents a typical

American diet. The albumin levels of participants following each diet are shown below.
EXAMPLE #1

H0: The three population medians are equal versus


H1: The three population medians are not all equal

EXAMPLE #2

Does physical exercise alleviate depression? We find some depressed people and check
that they are all equivalently depressed to begin with. Then we allocate each person

randomly to one of three groups: no exercise; 20 minutes of jogging per day; or 60 minutes
of jogging per day. At the end of a month, we ask each participant to rate how depressed

they now feel, on a Likert scale that runs from 1 ("totally miserable") through to 100

(ecstatically happy").
EXAMPLE #2
EXAMPLE #2
Rank all of the scores, ignoring which group they belong to. The procedure for ranking is as
follows: the lowest score gets the lowest rank. If two or more scores are the same then they
are "tied". "Tied" scores get the average of the ranks that they would have obtained, had
they not been tied. Here's the scores again, now with their ranks in brackets:
EXAMPLE #2
Solve for H:
EXAMPLE #2
EXAMPLE #2

The likelihood of obtaining a value of H as large as the one we've found,


purely by chance, is somewhere between 0.05 and 0.01 - i.e. pretty
unlikely, and so we would conclude that there is a difference of some
kind between our three groups.
CONCLUSION

01
The Kruskal-Wallis test is a 03
powerful
nonparametric test that can be used to
compare three or more groups on a
continuous or ordinal dependent variable. It
is a useful alternative to the one-way
ANOVA when the data is not normally
distributed.
THANK YOU!
1 - Introduction 2 3

The Friedman Two-Way Analysis of Variance (ANOVA) is the nonparametric


version of the ordinary two-way ANOVA test. We can recall that a non-
parametric test is used whenever the data doesn’t follow a normal
distribution, the sample size is small, and in this case, the data can be
arranged in a two-way classification. The test statistic follows an approximate
chi-squared distribution with k-1 degrees of freedom.

FRIEDMAN TWO-WAY ANALYSIS OF VARIANCE


1 2 - Formula 3

The test statistic, denoted by Friedman as 𝐹𝑟 , is computed as follows:

12
𝐹𝑟 = ∑𝑇𝑖2 − 3𝑏 𝑘 + 1
𝑏𝑘 𝑘 + 1
where,
b = the number of rows (blocks)
k = the number of columns (treatments)
T = the ranks in each column

FRIEDMAN TWO-WAY ANALYSIS OF VARIANCE


1 2 3 - Applications

• Measuring the mean scores of subjects during three or more time points.
• Measuring the mean scores of subjects under three different conditions.

APPLICATIONS OF FRIEDMAN TEST


1 2 3 4 – Example 1

Suppose you wish to compare the reaction times of people exposed to six
different stimuli. A reaction time measurement is obtained by subjecting a
person to a stimulus and then measuring the time until the person presents
some specified reaction. The objective of the experiment is to determine
whether differences exist in the reaction times for the stimuli used in the
experiment. To eliminate the person-to-person variation in reaction time,
four persons participated in the experiment and each person’s reaction time
(in seconds) was measured for each of the six stimuli.

EXAMPLE #1
1 2 3 4 – Example 1

Stimulus

Subject 1 2 3 4 5 6

1 0.6 (2.5) 0.9 (6) 0.8 (5) 0.7 (4) 0.5 (1) 0.6 (2.5)

2 0.7 (3.5) 1.1 (6) 0.7 (3.5) 0.8 (5) 0.5 (1.5) 0.5 (1.5)

3 0.9 (3) 1.3 (6) 1.0 (4.5) 1.0 (4.5) 0.7 (1) 0.8 (2)

4 0.5 (2) 0.7 (5) 0.8 (6) 0.6 (3.5) 0.4 (1) 0.6 (3.5)

Sum 𝑇1 = 11 𝑇2 = 23 𝑇3 = 19 𝑇4 = 17 𝑇5 = 4.5 𝑇6 = 9.5

EXAMPLE #1
Stimulus
1 2 3 4 – Example 1
Subject 1 2 3 4 5 6
1 0.6 (2.5) 0.9 (6) 0.8 (5) 0.7 (4) 0.5 (1) 0.6 (2.5)
2 0.7 (3.5) 1.1 (6) 0.7 (3.5) 0.8 (5) 0.5 (1.5) 0.5 (1.5)
3 0.9 (3) 1.3 (6) 1.0 (4.5) 1.0 (4.5) 0.7 (1) 0.8 (2)
4 0.5 (2) 0.7 (5) 0.8 (6) 0.6 (3.5) 0.4 (1) 0.6 (3.5)
Sum 𝑇1 = 11 𝑇2 = 23 𝑇3 = 19 𝑇4 = 17 𝑇5 = 4.5 𝑇6 = 9.5
1. State the HYPOTHESIS

𝐻0 : There is no significant difference among the mean reaction time across the
population
(µ1 = µ2 = µ3 )

𝐻𝑎 : At least one population mean is different from the rest.

EXAMPLE #1
Stimulus
1 2 3 4 – Example 1
Subject 1 2 3 4 5 6
1 0.6 (2.5) 0.9 (6) 0.8 (5) 0.7 (4) 0.5 (1) 0.6 (2.5)
2 0.7 (3.5) 1.1 (6) 0.7 (3.5) 0.8 (5) 0.5 (1.5) 0.5 (1.5)
3 0.9 (3) 1.3 (6) 1.0 (4.5) 1.0 (4.5) 0.7 (1) 0.8 (2)
4 0.5 (2) 0.7 (5) 0.8 (6) 0.6 (3.5) 0.4 (1) 0.6 (3.5)
Sum 𝑇1 = 11 𝑇2 = 23 𝑇3 = 19 𝑇4 = 17 𝑇5 = 4.5 𝑇6 = 9.5

2. Find the CRITICAL VALUE

For 𝛼 = 0.05 and 𝑑𝑓 = 6 − 1 = 5,


2
reject 𝐻0 if 𝐹𝑟 > 𝜒0.05

2
𝜒0.05 = 11.07

EXAMPLE #1
Stimulus
1 2 3 4 – Example 1
Subject 1 2 3 4 5 6
1 0.6 (2.5) 0.9 (6) 0.8 (5) 0.7 (4) 0.5 (1) 0.6 (2.5)
2 0.7 (3.5) 1.1 (6) 0.7 (3.5) 0.8 (5) 0.5 (1.5) 0.5 (1.5)
3 0.9 (3) 1.3 (6) 1.0 (4.5) 1.0 (4.5) 0.7 (1) 0.8 (2)
4 0.5 (2) 0.7 (5) 0.8 (6) 0.6 (3.5) 0.4 (1) 0.6 (3.5)
3. Find the OBSERVED VALUE Sum 𝑇1 = 11 𝑇2 = 23 𝑇3 = 19 𝑇4 = 17 𝑇5 = 4.5 𝑇6 = 9.5
2
𝜒0.05 = 11.07

12
𝐹𝑟 = ∑𝑇𝑖2 − 3𝑏 𝑘 + 1 , 𝑓𝑜𝑟 𝑏 = 4, 𝑘 = 6
𝑏𝑘 𝑘 + 1
12
𝐹𝑟 = (112 + 232 + 192 + 172 + 4.52 + 9.52 ) − 4(6) 6 + 1
4 6 6 + 1
𝐹𝑟 = 16.75

EXAMPLE #1
1 2 3 4 – Example 1

4. Interpret the RESULT


2
𝜒0.05 = 11.07
𝐹𝑟 = 16.75
2 𝐹𝑟 = 16.75
2 𝜒0.05 = 11.07
𝐹𝑟 > 𝜒0.05
Reject 𝐻0

EXAMPLE #1
1 2 3 4 – Example 1

4. CONCLUSION

A Friedman test was conducted on 4 people to examine their reaction time


that is exposed to 6 different stimuli. Each person was exposed to each
stimulus.

Results showed that the type stimulus used lead to statistically significant
differences in reaction time.

EXAMPLE #1
EXAMPLE #2:
Drug
We want to know if the mean
Patient 1 2 3
reaction time of subjects is
𝑇1 𝑇2 𝑇3

1 4 5 2
different on three different
2 3 1

2 6 2.5

6 2.5

4 1

drugs. To test this, we recruit 10 3 3 1

8 3

4 2

patients and measure each of 4 4 2

7 3

3 1

their reaction times (in seconds) 5 3 2

7 3

2 1

on the three different drugs. 6 2 1.5

8 3

2 1.5

The results for each patient are 7 2 2

4 3

1 1

shown: 8 7 3

6 2

4 1

9 6 3

4 2

3 1

10 5 2.5

5 2.5

2 1

𝑇 21.5 27 11.5
Drug
Patient 1 𝑇1 2 𝑇2 3 𝑇3
1 4 2 5 3 2 1
2 6 2.5 6 2.5 4 1
3 3 1 8 3 4 2
4 4 2 7 3 3 1
5 3 2 7 3 2 1
6 2 1.5 8 3 2 1.5
7 2 2 4 3 1 1
8 7 3 6 2 4 1
9 6 3 4 2 3 1
10 5 2.5 5 2.5 2 1
𝑇 21.5 27 11.5
Drug
Patient 1 𝑇1 2 𝑇2 3 𝑇3
1 4 2 5 3 2 1
2 6 2.5 6 2.5 4 1 1. State the hypothesis
3 3 1 8 3 4 2
4 4 2 7 3 3 1
𝐻0 : There is no significant difference
among the mean reaction time across the
5 3 2 7 3 2 1
population
6 2 1.5 8 3 2 1.5 (µ1 = µ2 = µ3 )
7 2 2 4 3 1 1
8 7 3 6 2 4 1
9 6 3 4 2 3 1
𝐻𝑎 : At least one population mean is
different from the rest.
10 5 2.5 5 2.5 2 1
𝑇 21.5 27 11.5
Drug
2. Perform the Friedman Test
Patient 1 𝑇1 2 𝑇2 3 𝑇3
2
1 4 2 5 3 2 1 For 𝛼 = 0.05 and 𝑑𝑓 = 2, reject 𝐻0 if 𝐹𝑟 > 𝑥0.05
2
𝜒0.05 = 5.99
2 6 2.5 6 2.5 4 1
3 3 1 8 3 4 2
4 4 2 7 3 3 1 12
𝐹𝑟 = ∑𝑇𝑖2 − 3𝑏 𝑘 + 1 , 𝑓𝑜𝑟 𝑏 = 10, 𝑘 = 3
5 3 2 7 3 2 1 𝑏𝑘 𝑘 + 1
6 2 1.5 8 3 2 1.5 12
𝐹𝑟 = (21.52 + 272 + 11.52 ) − 3(10) 3 + 1
10 3 4 + 1
7 2 2 4 3 1 1
8 7 3 6 2 4 1 𝐹𝑟 = 12.35
9 6 3 4 2 3 1
10 5 2.5 5 2.5 2 1
𝑇 21.5 27 11.5
3. Interpret the results 4. Report the results
2
𝜒0.05 = 5.99
𝐹𝑟 = 12.35

2 A Friedman Test was conducted on 10


𝐹𝑟 > 𝜒0.05
patients to examine the effect that three
different drugs had on response time. Each
Reject 𝐻0 patient used each drug once.

Results showed that the type of drug used


lead to statistically significant differences in
response time

2
𝜒0.05 = 5.99 𝐹𝑟 = 12.35
SPEARMAN RANK
CORRELATION
Siarez, Melrose
Sigua, Havie Joy
Solatorio, Christian Jude
Tadem, Gisserie
Teburon, Sittie Ayesha
Tornea, Justine Nicole
Tumlad, Clark
Vencilao, Hannah Gwendoline
Yahya, Nor Hayna
Zorilla, Jhapet
SPEARMAN’S RANK CORRELATION (SPEARMAN
RANK CORRELATION OR SPEARMAN’S RHO)
Named after Charles Spearman
Typically denoted either with the Greek letter rho (ρ), or rs
and is primarily used for data analysis
Measures the strength and direction of association between
two ranked variables. It basically gives the measure of
monotonicity of the relation between two variables i.e. how
well the relationship between two variables could be
represented using a monotonic function.
Similar to the Pearson correlation coefficient.
TO UNDERSTAND SPEARMAN’S RANK CORRELATION, IT IS
IMPORTANT TO UNDERSTAND MONOTONIC FUNCTION.

Monotonic function - one that either never increases or


never decreases as its independent variable changes.

The following graph illustrates the monotonic function:

FIG 1- A MONOTONICALLY FIG 2- A MONOTONICALLY FIG 3- A FUNCTION THAT IS


INCREASING FUNCTION DECREASING FUNCTION NOT MONOTONIC
FIG 1- A MONOTONICALLY FIG 2- A MONOTONICALLY FIG 3- A FUNCTION THAT IS
INCREASING FUNCTION DECREASING FUNCTION NOT MONOTONIC

Figure 1: Monotonically Increasing: As the variable X


increases, the variable Y never decreases.
Figure 2: Monotonically Decreasing: As the variable X
increases, the variable Y never increases.
Figure 3: Not Monotonic: As the X variable increases, the
Y variable sometimes decreases and sometimes
increases.
All bivariate correlation analyses express the strength of association
between two variables in a single value between -1 and +1. This value is
called the correlation coefficient.
Positive Correlation Coefficient: positive relationship between the two
variables (as values of one variable increase, values of the other variable
also increase)
Negative Correlation Coefficient: negative relationship (as values of one
variable increase, values of the other variable decrease).
Correlation Coefficient of Zero: no relationship exists between the
variables. However, correlation coefficients like Spearman and Pearson
assume a linear relationship between variables. Even if the correlation
coefficient is zero, a non-linear relationship might exist.
Spearman correlation (unlike Pearson correlation coefficient ) does not
require continuous-level data (interval or ratio), because it uses ranks
instead of assumptions about the distributions of the two variables.
Spearman correlation does not assume that the variables are normally
distributed. A Spearman correlation analysis can therefore be used in
many cases in which the assumptions of the Pearson correlation
(continuous-level variables, linearity, heteroscedasticity, and normality)
are not met.
FORMULA FOR SPEARMAN’S RANK
CORRELATION:

p = Spearman’s rank correlation coefficient


di = Difference between the two ranks of each
observation
n = Number of observations
The Spearman Rank Correlation can take a
value from +1 to -1 where,
A value of +1 : perfect association of rank
A value of 0 : no association between rank
A value of -1 means a perfect negative
association of rank
A value of -1 : perfect negative association
of rank

Note: The closer the ⍴ value to 0, the weaker


the association between the two ranks.
EXAMPLE:
Consider the score of 5 students in Math and
Science that are mentioned in the table.
EXAMPLE:
Step 1: Create a table for the
given data.

Step 2: Rank both the data in


descending order. The
highest marks will get a rank
of 1 and the lowest marks
will get a rank of 5.

Step 3: Calculate the


difference between the
ranks (d) and the square
value of d.

Step 4: Add all your d square


values.
EXAMPLE:
Step 5: Insert these values into the formula.

The Spearman’s Rank Correlation for the given data is


0.3. The value is near 0, which means that there is a weak
correlation between the two ranks.
EXAMPLE:
EXAMPLE:
EXAMPLE:
The hypothesis tested is that prices should decrease with distance
from the key area of gentrification surrounding the Contemporary
Art Museum. The line followed is Transect 2 in the map below, with
continuous sampling of the price of a 50cl bottle water at every
convenience store.
EXAMPLE:
Hypothesis
We might expect to find that the price of a bottle of water decreases
as distance from the Contemporary Art Museum increases. Higher
property rents close to the museum should be reflected in higher
prices in the shops. The hypothesis might be written like this: The
price of a convenience item decreases as distance from the
Contemporary Art Museum increases.

The more objective scientific research method is always to assume


that no such price-distance relationship exists and to express the
null hypothesis as: there is no significant relationship between the
price of a convenience item and distance from the Contemporary
Art Museum.
EXAMPLE:
EXAMPLE:
EXAMPLE:

We now have the formula: R = 1 - (1713/990) which gives a value for


R: 1 - 1.73 = -0.73

What does this Rs value of -0.73 mean?


The closer Rs is to +1 or -1, the stronger the likely correlation. A perfect positive
correlation is +1 and a perfect negative correlation is -1. The Rs value of -0.73
suggests a fairly strong negative relationship.
EXAMPLE:

In the example, the value -0.73 (or +0.73) gives a significance level of slightly
less than 5%. That means that the probability of the relationship you have
found being a chance event is about 5 in a 100. You are 95% certain that your
hypothesis is correct. The reliability of your sample can be stated in terms of
how many researchers completing the same study as yours would obtain
the same results: 95 out of 100.
EXAMPLE:
THANK
YOU!
REFERENCES

https://www.statisticssolutions.com/free-resources/directory-of-
statistical-analyses/spearman-rank-correlation/
https://www.simplilearn.com/tutorials/statistics-
tutorial/spearmans-rank-correlation
https://www.questionpro.com/blog/spearmans-rank-coefficient-
of-correlation/
https://www.questionpro.com/blog/spearmans-rank-coefficient-
of-correlation/

You might also like