You are on page 1of 6

5/15/2023

MAP 716: BIOSTATISTICS II AND COMPUTTING


Introduction

• Non parametric tests are also referred as distribution-free


Lecture 3: NON PARAMETRIC TECHNIQUES tests because they are based on fewer assumptions (e.g., they do
not assume that the outcome is approximately normally
distributed).
• Parametric tests involve specific probability distributions (e.g., the
Lecturer: normal distribution) and the tests involve estimation of the key
Dr Alice Lakati parameters of that distribution (e.g., the mean or difference in
Senior Lecturer means) from the sample data.
Amref International University
• The cost of fewer assumptions is that nonparametric tests are
generally less powerful than their parametric counterparts (i.e.,
when the alternative is true, it may be less likely to reject H0).

MAP 716 Non-Parametric Methods by Dr. AS MAP 716 Non-Parametric Methods by Dr. AS
5/15/2023 5/15/2023
Lakati Lakati

Introduction… Normality test


• Sometimes in practice it may be difficult to assess • Can be done using Kolmogorov-Smirnov test, the
whether a continuous outcome follows a normal Anderson-Darling test, and the Shapiro-Wilk test
distribution and, thus, whether a parametric or
nonparametric test is appropriate.
• There are several statistical tests that can be used to • The null hypothesis for each test is H0: Data follow
assess whether data are likely from a normal distribution. a normal distribution versus H1: Data do not follow
a normal distribution.
• The most popular are the Kolmogorov-Smirnov test, the
Anderson-Darling test, and the Shapiro-Wilk test.
• Each test is essentially a goodness of fit test and • If the test is statistically significant (e.g., p<0.05),
compares observed data to quantiles of the normal (or then data does not follow a normal distribution,
other specified) distribution. and a nonparametric test is warranted.

MAP 716 Non-Parametric Methods by Dr. AS MAP 716 Non-Parametric Methods by Dr. AS
5/15/2023 5/15/2023
Lakati Lakati

Normality tests.. Normality..


• The most practical
approach to assessing
• These tests for normality can be subject to low normality involves
power. investigating the
Histogram

distributional form of
• Specifically, the tests may fail to reject H0: Data follow
10

the outcome in the


a normal distribution when in fact the data do not sample using a 8

histogram and
follow a normal distribution.
• To augment that with
6
Frequency

data from other studies,


if available, that may
4

• Low power is a major issue when the sample size is indicate the likely 2

small which unfortunately is often when we wish to distribution of the


outcome in the
Mean = 98.6765
Std. Dev. = 3.95214

employ these tests.


0 N = 34

population.
90.00 95.00 100.00 105.00 110.00

body length in mm for right side

MAP 716 Non-Parametric Methods by Dr. AS MAP 716 Non-Parametric Methods by Dr. AS
5/15/2023 5/15/2023
Lakati Lakati

1
5/15/2023

Non-parametric Non parametric: Advantages

• There are some situations when it is clear that the • This test do not make distributional assumptions
outcome does not follow a normal distribution. These • They often replace the actual observations with ranks
include situations: • They are easy to calculate and are not affected by
1. When the outcome is an ordinal variable or a rank, extreme values
2. When there are definite outliers or
3. When the outcome has clear limits of detection.
• Can be performed on ordinal data

MAP 716 Non-Parametric Methods by Dr. AS MAP 716 Non-Parametric Methods by Dr.
5/15/2023 5/15/2023
Lakati AS Lakati

Disadvantages Non Parametric Methods


Non parametric method Use Parametric equivalent
Sign test Simplified form of Wilcox on signed
• They lack power and loss of information of the rank test

original data Wilcox on signed rank test Test of differences between paired
observations
Paired t-test

• Less powerful, if Ho is false it requires a large Wilcox on signed sum test Comparison of two groups Two-sample t-test

sample size to provide sufficient evidence to reject Mann-Whitney U test Alternative of Wilcox on rank sum Two sample t-test
test which give identical results
• Hypotheses tested tend to be less specific
Kruskal-Wallis Comparison of several groups One way analysis of variance

Spearman’s rank Correlation Measures association between two Correlation coefficient


• If large observations are tied, then Qt and Qw variables

overestimate the standard deviations Friedman’s test Comparison of groups defined by


their values on two variables
Two-way analysis of variance

Median test Use to compare one group One sample t-test


MAP 716 Non-Parametric Methods by Dr. MAP 716 Non-Parametric Methods by Dr. AS
5/15/2023 5/15/2023
AS Lakati Lakati

Median Test Median Test… Example


• Use to test hypothesis that the population median mo i.e • Before treatment: 30 35 32.5 36 40
proportion of population with observations greater than or
less than the median is = 0.5 • After treatment: 35 31 33 40 34
Procedure;
• Rank the observations from the lowest to highest and decide • We order them to obtain median
the median. Find how many observations are above and below
the median. Create a chi-square table and use the formula for
chi-square to test the hypothesis
• Before treatment: 30 32.5 35 36 38
• Example: • After treatment: 31 33 35 40 41
• Five mice in a lab experiment of which temperature is recorded •
before and after the drug has been administered.
MAP 716 Non-Parametric Methods by Dr. AS MAP 716 Non-Parametric Methods by Dr. AS
5/15/2023 5/15/2023
Lakati Lakati

2
5/15/2023

Median Test… Example Median Test… Example


• Median is 35; construct a 2 by 2 table, no significant • Before treatment: 30 35 32.5 36 40
difference • After treatment: 35 31 33 40 34

• If the two samples are not from the same subject • We order them to get median
(independent) you order them all together and get
median. • Chi-square – sum (e-o)2/e2
• Compare with chi-square 1 with 1df at alpha
0.05 = 3.84 • Expected e= RTXCT/GT

MAP 716 Non-Parametric Methods by Dr. AS MAP 716 Non-Parametric Methods by Dr. AS
5/15/2023 5/15/2023
Lakati Lakati

Sign Test Example ..


• Is not based on any assumptions and does not use
parameters. • Example: Five mice in a lab experiment of which
• Data collection is easy temperature is recorded before and after the drug
• Probability rule does not hold has been administered.
• It looks at the signs
• It has a chi-square distribution with one degree of freedom
• e.g • Before treatment: 30 35 32.5 36 40
• n1 = Σd1 (+ve) • After treatment: 35 31 33 40 34
• n2 = Σd2 (-ve)

• Formula : |sum V+ – sum V-|-1/n1+n2


MAP 716 Non-Parametric Methods by Dr. AS MAP 716 Non-Parametric Methods by Dr. AS
5/15/2023 5/15/2023
Lakati Lakati

Wilcoxon Sign Rank Test Wilcoxon Sign Rank Test


example
• Use to compare two samples from populations that
are not independent. • Before treatment: 33 29 30 40 35 36 38
• It combines signs and ranks. • After treatment: 38 34 40 28 31 42 36
• Difference
• Compute the sum of the ranks ΣX2 • Rank
• Sum of the +ve and –ve ranks

• Lower rank become the test statistics and check


for significance in the Wilcoxon table

MAP 716 Non-Parametric Methods by Dr. AS MAP 716 Non-Parametric Methods by Dr. AS
5/15/2023 5/15/2023
Lakati Lakati

3
5/15/2023

Example Example…

• Before treatment: 33 29 30 40 35 36 38 • for this the significance is the opposite


• After treatment: 38 34 40 28 31 42 36

MAP 716 Non-Parametric Methods by Dr. AS MAP 716 Non-Parametric Methods by Dr. AS
5/15/2023 5/15/2023
Lakati Lakati

Spearman’s Rank Coefficient Of


Correlation.
Example
• Is use to determine the degree to which two variables • The table below shows scores of continuous
are related if the data cannot attain the rule of normal
distribution. assessment test (CAT’s) and final examination from
• sample of 17 MPH students from the School of
• The observations are ranked and the difference Public Health. We would like to determine is there
between the rank of x and y is obtained. is a correlation between CAT scores and final
examination score.

• Applying the formula


• r= 0.713
• r’= 1- {6(Σd2)/n(n2-1)}

MAP 716 Non-Parametric Methods by Dr. AS MAP 716 Non-Parametric Methods by Dr. AS
5/15/2023 5/15/2023
Lakati Lakati

Spearman’s Rank Coefficient of Correlation example

X Y Rank of x Rank y Difference D2


(x-y)
53 60 10 8 2 4
66 65 5 4.5 .5 .25
73 65 1 4.5 -3.5 12.25

SUM ??

MAP 716 Non-Parametric Methods by Dr. AS MAP 716 Non-Parametric Methods by Dr. AS
5/15/2023 5/15/2023
Lakati Lakati

4
5/15/2023

Mann-Whitney U-test
Example
• Is an extension of Kruskal Walis but based on U
product.
• It takes into account the measurement and rank them
and then sum the ranks for each group.
Example
• The lower value becomes the test statistics Group 1 : 15 20 30 35 n=4
Group 2 : 18 12 25 28 36 n=5

MAP 716 Non-Parametric Methods by Dr. AS MAP 716 Non-Parametric Methods by Dr. AS
5/15/2023 5/15/2023
Lakati Lakati

Output for Mann-Whitney U-Test: If P<0.05


Interpretation reject Ho

• Manual calculation we can only tell IF


• P<alpha
• P>alpha

• If the calculated value is greater than critical value


at a set alpha, then the P<alpha

• If the calculated value is less than critical value at a


set alpha, then the P> alpha
MAP 716 Non-Parametric Methods by Dr. AS MAP 716 Non-Parametric Methods by Dr. AS
5/15/2023 5/15/2023
Lakati Lakati

Kruskal Wallis Test


Kruskal Wallis Test
• Is an extension of Wilcox on when we have three groups.
• We give the observations ranks from lowest to highest
• Is applicable when comparing independent groups
• We use a statistics that takes into account n1+n2+n3 =N
• It has a H-statistics

• It has a chi-square with k-1= df and k is the number of groups


MAP 716 Non-Parametric Methods by Dr. AS MAP 716 Non-Parametric Methods by Dr. AS
5/15/2023 5/15/2023
Lakati Lakati

5
5/15/2023

Example Kruskal Wallis Test: Outputs


• Temperature for three groups of mice on different
treatments

• Grp1: 15 , 20, 30, 35


• Grp 2: 18, 12, 25, 20, 32
• Grp 3: 21, 25, 35, 40, 33

Approach : rank the observations and obtain R 2/n1


per group
Calculate H-statistics
MAP 716 Non-Parametric Methods by Dr. AS MAP 716 Non-Parametric Methods by Dr. AS
5/15/2023 5/15/2023
Lakati Lakati

MAP 716 Non-Parametric Methods by Dr. AS


5/15/2023
Lakati

You might also like