You are on page 1of 34

https://www.investopedia.com/terms/n/nonparametric-statistics.

asp
Clarke KR (1993) Non-parametric multivariate analyses of changes in community structure. Aust J
Ecol 18:117-43.
Non-Parametric Data Analysis Techniques for Biological Students

1.Introduction to Nonparametric data


Non parametric tests are statistical tests that do not rely on assumptions of the underline
probability distribution that data are drawn from. These probability distributions are described by
small number of parameters. The most common example for such probability distributions are
normal distribution.

Parametric Non Parametric


1 The model structure of parametric model The model structure of non-parametric
is determined without experience or sense model is determined by data.
data (priori)
2 Number and the nature of the parameters Number and the nature of the parameters
are fixed in advance are flexible
3 Data are assumed to come from normal Does not assume that data are drawn from
distribution a normal distribution. Shape of the
distribution is estimated.
4 Include parameters such as mean,
standard deviation, variance, Pearson
correlation etc.
5 As the need for parameters is relieved, the
data becomes more applicable to a larger
variety of tests.
6 Parametric statistics generally require Nonparametric statistics are typically
interval or ratio data. used on data that nominal or ordinal.
7 Often nonparametric methods will be
used when the population data has an
unknown distribution, or when the sample
size is small.
8 Less powerful than parametric statistics
that means non-parametric test
In cases where parametric testing is more
appropriate, nonparametric methods will
be less efficient.

2. Analysis of similarities (ANOSIM)


Introduction

1
Analysis of similarity is a robust non-parametric test that was proposed by Clarke & Green
(1988). ANOSIM is widely used in the field of ecology where assumptions underlying in
univariate or multivariate parametric tests are often violated.

Purpose
ANOSIM is used to determine whether there are statistically significant difference between two
or more groups.

This is similar to ANOVA. Here instead of using raw data in ANOVA, use a ranked
dissimilarity matrix by converting distances into rank. Here comparing distances between groups
with distances within groups.

ANOSIM is a non-parametric multivariate technique which was design for multiple response
variables while Kruskal Wallis and Mann-Whitney U were designed for single response variable.

Formula of the statistic


The test statistic R is calculated by

r B−r W
R=
M
2
r B=¿ Average of rank similarities of pairs of samples from different groups
r W =¿Average of rank similarities of pairs among replicates within group
n( n−1)
M= where n is the number of samples.
2

Interpretation of R
R is constrained between −1 (if all the lowest ranks are between groups) to +1 (If all the lowest
ranks are within groups). Positive values of R reflects more similarity within groups. That means
the grouping variable is important. The negative R values represent more similarities between
groups. The R values which is close to zero indicates that no difference between treatment and
within treatment similarities.

An R value close to “1.0” suggests dissimilarity between groups while an R value close to “0”
suggests an even distribution of high and low ranks within and between groups”

Working example

Manual calculation

2
S12 S2
S11 S13 S21 S22
3
S1 0
1
S1
0.5 0
2
S1 0.8
0.7 0
3 5
S2 1.0 1.0 1.0
0
1 6 5 5
S2 06 0.9 0
0.7 0.4
2 7 5
S2 0.5 0.6 0.6 0.9 0.3
0
3 6 5 4 6 2

S1 S12 S2 S2 S2
S13
1 1 2 3
S1
1
S1
3
2
S1
10 8.5
3
S2 13. 13.
15
1 5 5
S2
7 8.5 2 11
2
S2
4 6 5 12 1
3

r B= ( 15+13.5+ 13.5+7+8.5+
9 )= 9 =8.28
2+ 4+ 6+5 74.5

rW = ( 3+10+ 8.5+6 11+12+1 )= 45.56 =7 .58


n( n−1) 6 (6−1)
M= = =15
2 2

3
8.28−7.58
R= =0.093
15
2

The value of the R is 0.1. That means it is close to zero. It indicates no difference between
groups and within group similarities. We can conclude that group variable is not an important
variable.

Analysis using PAST

4
3. Anderson–Darling test: tests whether a sample is drawn from a given distribution
The Anderson–Darling test is a statistical test of whether or not a given sample of data is drawn
from a certain probability distribution. As an example the normal distribution.
The test calculates the Anderson-Darling statistic
2
A =−n−S
n
1
S= ∑ ( 2i−1 ) [ ln F ( X i ) + ln ⁡(1−F ( X n −i +1 )) ]
n i=1

Wheren =sample size F ( X )=¿ cumulative distribution function of the specified distribution i=ith
sample when data is sorted in asending order.

Example

5
4. Non-parametric bootstrap method: estimates the accuracy/sampling distribution of a statistic
Bootstrap is a method of estimating the variance of an estimator to find out the confidence
interval. It’s a resampling procedure that uses data from one sample to generate a sampling
distribution by repeatedly taking random samples from the known sample, with replacement.

Why we need sampling distribution?


Sampling distribution is needed to estimate the confidence interval.

Steps to create a bootstrap sampling distribution


 Replace the population with the sample
 Sample with replacement A times. A should be large.
 Compute sample medians each time, M i
 Obtain the approximate distribution of the sample median.
When an approximate distribution is there one can calculate the standard error of sampling
distribution by estimating the standard deviation.

6
5. Cochran's Q: tests whether k treatments in randomized block designs with 0/1 outcomes
have identical effects
Cochran’s Q test is a non-parametric statistical test which is used for testing k =2 or more related
samples where the response variable is binary. Cochran’s Q is a special case of non-parametric
Friedman test. Friedman test is also used to detect differences among related samples with
numerical responses. When the response is binary Friedman test equals to Cochran’s Q test.

7
6. Cohen's kappa (k)
Cohen’s kappa is a non-parametric statistical test to quantify the level of agreement between two
raters or reliability between two raters where the variable measured is in categorical or nominal
scale. Not only can the reliability between two raters, Kohen’s Kappa also be used when same
rater makes the measurement at two different times.

Cohen’s kappa coefficient can be calculated using the formula;

P o−Pe
k=
1−Pe
Where Pe is the hypothetical probability of the two raters randomly match their choices and Po
is the observed probability that both raters are making the same choice.

Calculating Cohen’s kappa

Example:
Two dietitians (A and B) rated randomly selected 50 students in a rural school of their nutrient
status. If students are having daily requirement of nutrition they are categorized as normal and if
students couldn’t meet the requirement they are categorized as undernutrition.
The categorization was done after having a five minute discussion with each student. The data
obtained is given in the table below.

Rater Rater Rater Rater Rater


Rater2 Rater2 Rater2 Rater2 Rater2
1 1 1 1 1
UN UN Normal Normal UN UN Normal Normal Normal Normal
Normal Normal UN UN Normal Normal Normal Normal UN UN
UN UN UN UN UN UN Normal UN UN UN
UN Normal UN UN Normal Normal UN UN Normal UN
Normal Normal Normal Normal UN Normal UN UN Normal Normal
Normal UN UN Normal UN UN Normal Normal Normal Normal
UN UN UN UN UN Normal Normal UN Normal Normal
Normal Normal UN UN Normal Normal UN Normal UN UN
Normal UN UN UN Normal Normal UN UN Normal UN
Normal UN Normal Normal UN UN Normal Normal UN UN

The Null Hypothesis H 0 : K=0 and the Alternative Hypothesis H 1 : K ≠ 0

Manual calculation of k

8
The summary of the evaluations of raters A and B is given in the below contingency table.

Rater B

Normal Undernutrition

Normal 18 7 25
Rater A
Undernutrition 5 20 25

23 27 50

The probability that both raters have same opinion(Po ):

18 20 38
+ = =0.76
50 50 50

Calculation of Pe
Probability of both raters randomly diagnosing nutrient status of students are “Normal”:

25
∗23
50 575
= =0.23
50 2500

Probability of both raters randomly diagnosing nutrient status of students are


“Undernutrition:

25
∗27
50 675
= =0.27
50 2500

Probability that both raters are randomly in agreement Pe :

0.23+ 0.27=0.5

Then the Cohen’s kappa coefficient can be calculated as:

0.76−0.5
k= =0.52
1−0.5

Evaluation of kappa coefficient

9
The table of Landis & Koch (1977) can be used as a guide.

Kapp Level of
a Agreement
>0.8 Almost Perfect
>0.6 Substantial
>0.4 Moderate
>0.2 Fair
0-0.2 Slight
<0 Poor

The calculated Cohen’s kappa indicates that the raters A and B are having moderate
reliability or agreement.

Calculate Cohen’s kappa with SPSS


1. Enter data in the SPSS data sheet.

2. Go to Analyze Descriptive Statistics Crosstabs

10
3. Click on “Crosstabs”

11
4. Add Rater 1 to Row(s) and Rater 2 to Column(s)

5. Click on Statistics

12
6. Select “Kappa” and click continue

7. Click on Cells and select “Observed” and “Round Cell Counts”

8. Click Continue and then click OK.

13
9. You will obtain the following Output

Case Processing Summary


Cases
Valid Missing Total
N Percent N Percent N Percent
Rater_1 * Rater_2 50 100.0% 0 0.0% 50 100.0%

The cross tabulation table generated by SPSS is cell counts of the categories of two raters.

Rater_1 * Rater_2 Cross tabulation


Count
Rater_2
Normal UN Total
Rater_1 Normal 18 7 25
UN 5 20 25
Total 23 27 50

The Symmetric Measures table presents the Cohen’s kappa and it is 0.52 indicating a moderate level of
agreement between two raters. Furthermore, since the P is less than 0.05 , Kappa coefficient is
significantly different from zero.
Symmetric Measures
Asymptotic Approximate
a b
Value Standard Error Approximate T Significance
Measure of Agreement Kappa .520 .120 3.689 .000
N of Valid Cases 50
a. Not assuming the null hypothesis.
b. Using the asymptotic standard error assuming the null hypothesis.

14
7. Weighted Cohen’s kappa

Weighted Cohen’s kappa is used to quantify the level of agreement between two raters when the
variable measured in ordinal scale.

15
8. Friedman two-way analysis of variance
The Friedman test is a non-parametric statistical test for analyzing randomized complete block
designs when response variable is measured in ordinal scale or ratio scaled response variable is
not normally distributed. Friedman test is an extension of the sign test where there are more than
two treatments.

The Friedman test statistic is given by

[ ]
k
12
FR= ∑
nk (k +1) i=1
2
R i −30 ( k +1 )

Where n=number of observations per treatment, k = number of treatments, R2i =sum of each
squared observation in ith treatment.

Example
Suppose a researcher wants to know the best flavored yoghurt out of the three types of flavors he
has added to yoghurt i.e. Carrot, Mango and Guava in terms of consumer preference. She
selected randomly 10 consumers and recorded their preference to all three flavors.
(do not prefer = 1, slightly not prefer = 2, neutral = 3, slightly prefer =4, highly prefer = 5)

Consume
r Carrot Mango Guava
1 1 3 4
2 2 4 2
3 4 4 2
4 1 4 3
5 1 3 4
6 1 4 3
7 3 5 1
8 4 4 4
9 3 5 1
10 4 4 3

1. Enter data in the variable view.

16
2. Select “Analyze”  “Nonparametric Tests”  “Legacy dialogs”  “K Related Samples”

3. Select the treatment variable columns as “Test Variables” and select “Friedman” as “Test
Type”.

17
4. Then Click “OK”.
5.
6. Following output is obtained
Ranks
Mean Rank
Carrot 1.65
Mango 2.60
Guava 1.75

Test Statisticsa
N 10
Chi-Square 6.606

18
df 2
Asymp. Sig. .037
a. Friedman Test

19
9. Empirical Likelihood Ratio Test

10. Kaplan–Meier Estimator/Product Limit Estimator


The Kaplan-Meier is a non-parametric statistic that is used to analyze “time to event” between
two or more independent groups. The event is a dichotomous categorical outcome such as
survived or not survived.
Survival analysis deals with any kind of dichotomous categorical outcomes where temporal
aspects are of interest.
Kaplan-Meier curve graphically represent the survival function by plotting time in x axis and
survival rate in the y axis.

Survival Rate: Suppose a researcher wants to find the survival time of following a dietary plan
by group of people, the start time is the point where individu

Example
Click Analyze.

Drag the cursor over the Survival drop-down menu.

Click on Kaplan-Meier.

Click on the "time" variable to highlight it.

Click on the arrow button to move the variable into the Time: box.

Click on the dichotomous categorical outcome variable to highlight it.

Click on the arrow button to move the variable into the Status: box.

Click on the Define Event button.

In the Single value: box, enter the value or "level" of the dichotomous categorical outcome
variable that denotes the event has occurred. Example: "1"

Click Continue.

Click on the "grouping" or categorical predictor variable to highlight it.

20
Click on the arrow button to move the variable into the Factor: box.

Click on the Compare Factor button.

Click on the Log rank box to select it.

Click Continue.

Click the Options button.

In the Plots table, click on the Survival box to select it.

Click Continue.

Click OK.

11. Kendall's tau: measures statistical dependence between two variables


Kendall’s tau is used to quantify the level of agreement between two raters when the
response variable is measured in ordinal scale.
12. Kendall's W: a measure between 0 and 1 of inter-rater agreement.
13. Kolmogorov–Smirnov test: tests whether a sample is drawn from a given
distribution, or whether two samples are drawn from the same distribution.

21
14. Kruskal–Wallis one-way analysis of variance

by ranks: tests whether > 2 independent samples are drawn from the same distribution.

Example
Suppose a researcher wanted to find out which aesthetic medium out of music, dancing and
painting is best medium to alleviate depression status of students in an orphanage. She
selected 30 depressed students and randomly assigned into three groups. Each group consists
of 10 students. The researcher ensured that all 30 students have same level of depression.
One group listened music for 30 min once in three days, the second group was allowed to
participate for a dancing session of 30 min once in three days and third group was
participated in painting session of 30 min once in three days. The experiment was conducted
for a period of one month. At the end of the month each participant was asked to rate how
they feel depression into a 1-10 likert scale. One is fully depressed and 10 is fullest happy.
The data received is given in the table below.

Music Dancing Painting


7 2 8
6 3 10
8 6 9
10 3 2
5 2 6
3 2 5
2 3 6
7 7 7
6 2 6
9 1 1

1. Enter data in the data view.

22
2. Go to “Analyze”  “Nonparametric Test”  “Legacy Dialogs”  “K Independent

Samples”
3. Select “Score” as the test variable, select “Aesthetic Medium” as the grouping variable and
select “Kruskal-Wallis H” as the “Test Type”.

23
4. Click “Define Range…” and enter the minimum value (1) as well as the maximum value (3)

24
5. Click “Continue” and then click “Ok”.

6. The following output is obtained.

Ranks
Aesthetic_Medium N Mean Rank
Scores Music 10 19.20
Dancing 10 9.50
Painting 10 17.80
Total 30

25
Test Statisticsa,b
Scores
Kruskal-Wallis H 7.247
df 2
Asymp. Sig. .027
a. Kruskal Wallis Test
b. Grouping Variable:
Aesthetic_Medium

26
15. Kuiper's test: tests whether a sample is drawn from a given distribution, sensitive
to cyclic variations such as day of the week.
16. Logrank test: compares survival distributions of two right-skewed, censored
samples.

27
17. Mann–Whitney U
or Wilcoxon rank sum test: tests whether two samples are drawn from the same distribution,
as compared to a given alternative hypothesis.

Example
A trial is run to assess the effectiveness of two types of therapy programs on reducing
academic stress of undergraduate students. 12 undergraduates who are suffering from stress
condition were selected and randomly grouped into two of six members each. One group
involved in a forest therapy program one hour per week for a period of one month. The
second group involved in a yoga program for a period of one month at the frequency of one
hour per week. At the end of the month students were asked to rank their level of stress into a
0 to 10 likert scale (Extremely stressful = 0 moderately stressful = 5 not at all stressful = 10).

Forest
Yoga
Therapy
6 2
8 2
6 4
6 5
4 5
7 4

1. Enter given data in the data view.

2. Select “analyze”  “Nonparametric Test”  “Legacy Dialogs” “2 Independent


Sample…”

28
3. Select the variable “Stress Level” into the “Test Variable List” box and select the “Therapy”
variable into the “Grouping Variable” box

29
4. Click “Define Groups…” and enter the group variable values (1 and 2) for identifying groups
to be compared.

5. Click “Continue”

30
6. Select “Mann-Whitney” as the “Test Type” and then Click “OK”

7. The obtained output is given below.

Ranks
Therapy N Mean Rank Sum of Ranks
Stress_Level Forest Therapy 6 9.00 54.00
Yoga 6 4.00 24.00
Total 12

Test Statisticsa
Stress_Level
Mann-Whitney U 3.000
Wilcoxon W 24.000
Z -2.445
Asymp. Sig. (2-tailed) .014
Exact Sig. [2*(1-tailed Sig.)] .015b
a. Grouping Variable: Therapy
b. Not corrected for ties.

18. McNemar's test: tests whether, in 2 × 2 contingency tables with a dichotomous


trait and matched pairs of subjects, row and column marginal frequencies are equal.
31
19. Median test: tests whether two samples are drawn from distributions with equal
medians.
20. Pitman's permutation test: a statistical significance test that yields exact p values
by examining all possible rearrangements of labels.
21. Rank products: detects differentially expressed genes in replicated microarray
experiments.
22. Siegel–Tukey test: tests for differences in scale between two groups.
23. Sign test: tests whether matched pair samples are drawn from distributions with
equal medians.

32
24. Spearman's rank correlation coefficient
: measures statistical dependence between two variables using a monotonic function.

Example

33
25. Squared ranks test: tests equality of variances in two or more samples.
26. Tukey–Duckworth test: tests equality of two distributions by using ranks.
27. Wald–Wolfowitz runs test: tests whether the elements of a sequence are mutually
independent/random.
28. Wilcoxon signed-rank test: tests whether matched pair samples are drawn from
populations with different mean ranks.
29. Quantile regression analysis (For a second example, consider a
different researcher who wants to know whether average hours of sleep
is linked to how frequently one falls ill. Because many people get sick
rarely, if at all, and occasional others get sick far more often than most
others, the distribution of illness frequency is clearly non-normal, being
right-skewed and outlier-prone. Thus, rather than use a method that
assumes a normal distribution for illness frequency, as is done in
classical regression analysis, for example, the researcher decides to
use a nonparametric method such as quantile regression analysis. )

34

You might also like