2. Non-parametric tests
• Non-parametric tests are used when continuous
data are not normally distributed or when
dealing with discrete variables.
• Most widely used are chi-squared, Fisher's exact
tests, Wilcoxon's matched pairs, Mann–Whitney
U-tests, Kruskal–Wallis tests and Spearman rank
correlation.
5. Appropriate data
• Two-sample data. That is data with two groups
only
• Dependent variable is ordinal, interval, or ratio
•Independent variable is a factor with two
levels. That is two groups
•Observations between groups are
independent. That is not paired or repeated
measures data
6. Hypotheses
• Null hypothesis: The two groups are sampled from
populations with identical distributions. Typically, that
the sampled populations show stochastic equality.
• Alternative hypothesis (two-sided): The two groups
are sampled from populations with different
distributions. Typically, that one sampled population
exhibits stochastic dominance.
7. Interpretation
Significant results can be reported as e.g. “Values
for group A were significantly different from those
for group B.”
Other notes and alternative tests
The Mann–Whitney U test can be considered
equivalent to the Kruskal–Wallis test with only two
groups.
8. Two-sample Mann–Whitney U test- example
• Are B.Ed.-General scores significantly different
from those of B.Ed.-Special?
• The Mann–Whitney U test is conducted with
the wilcox.test function, which produces a p-
value for the hypothesis.
9. Kruskal-Wallis Test
• A collection of data samples are independent if they
come from unrelated populations and the samples do
not affect each other.
• Using the Kruskal-Wallis Test, we can decide whether
the population distributions are identical without
assuming them to follow the normal distribution.
Example
• The daily air quality measurements in Delhi, November
to March, are recorded. The ozone density are
presented in the data frame column Ozone.
10. Mood’s Median Test
• Mood’s median test is used to compare the
medians for two samples drawn from different
populations to find out if they are different.
• For example- you might want to compare the
median number of positive calls to a hotline vs.
the median number of negative comment calls to
find out if you’re getting significantly more
negative comments than positive comments (or
vice versa).
12. Continue-
• This test is the nonparametric.
- Nonparametric means that you don’t have to know what
distribution your sample came from (i.e. a normal
distribution) before running the test.
• Samples should have been drawn from distributions with
the same shape.
• The null hypothesis for this test is that the medians are the
same for both groups.
• The alternate hypothesis for the test is that the medians
are different for both groups.
13. Results for The Test
• Like most hypothesis tests, your results will
include a p-value and an alpha level (usually
5% or 0.05).
• If your p-value is less than or equal to alpha,
the medians are different and you can reject
the null hypothesis that they are the same.
14. Friedman test
• The Friedman test is the non-parametric
alternative to the one-way ANOVA with repeated
measures.
• It is used to test for differences between groups
when the dependent variable being measured is
ordinal.
• It can also be used for continuous data that has
violated the assumptions necessary to run the
one-way ANOVA with repeated measures (e.g.,
data that has marked deviations from normality).
15. Assumptions
• One group that is measured on three or more
different occasions.
• Group is a random sample from the
population.
16. • Your dependent variable should be measured at the
ordinal or continuous level.
- Examples of ordinal variables include Likert scales (e.g., a 7-
point scale from strongly agree through to strongly disagree),
amongst other ways of ranking categories (e.g., a 5-point scale
explaining how much a customer liked a product, ranging
from "Not very much" to "Yes, a lot").
- Examples of continuous variables include revision time
(measured in hours), intelligence (measured using IQ score),
exam performance (measured from 0 to 100), weight
(measured in kg), and so forth.
• Samples do NOT need to be normally distributed.
17. Example
• A researcher wants to examine whether music has an effect on the
perceived psychological effort required to perform an exercise
session.
• The dependent variable is "perceived effort to perform exercise"
and the independent variable is "music type", which consists of
three groups: "no music", "classical music" and "dance music". To
test whether music has an effect on the perceived psychological
effort required to perform an exercise session, the researcher
recruited 12 runners who each ran three times on a treadmill for 30
minutes. For consistency, the treadmill speed was the same for all
three runs. In a random order, each subject ran: (a) listening to no
music at all; (b) listening to classical music; and (c) listening to
dance music. At the end of each run, subjects were asked to record
how hard the running session felt on a scale of 1 to 10, with 1 being
easy and 10 extremely hard. A Friedman test was then carried out
to see if there were differences in perceived effort based on music
type.