Topic 10 - Non-Parametric

You might also like

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

Topic 10:

Used to make inferences about infinite


dimensional parameters in statistical models
Contents
1) Overviews
2) Assumptions of parametric & non-parametric tests
3) Testing the assumption of normality
4) Commonly used non-parametric tests
1: Overviews
Variable
• A characteristic that is observed or manipulated.
– Dependent
– Independent

Data
• Measurements or observations of a variable
1) Nominal or Classificatory Scale: Gender, ethnic, background,
eye colour, blood group
2) Ordinal or Ranking Scale: School performance, social
economic class
3) Interval Scale: Celsius or Fahrenheit scale
4) Ratio Scale: Kelvin scale, weight, pulse rate, respiratory rate
Parameter
• is any numerical quantity that characterizes a given
population or some aspect of it.
• Most common statistics parameters are mean, median, mode,
standard deviation.
2: Assumptions of parametric &
non-parametric tests
Assumptions
Assumption Parametric test Non-parametric test
Normality ✓ The populations are normally ✓ Data do not follow any
& Level of distributed (follow normal specific distribution
measurement distribution curve) ✓ Test statistics is arbitrary
✓ Test statistics based on ✓ Data measured by any scale:
distribution nominal/ ordinal
✓ The data is in interval or ratio
scale
Homogeneity ✓ The selected population is No assumptions made about the
of variances representative of general population distribution
population
✓ samples of several groups come
from population with same
variance
Independence ✓ Data are independent & not ✓ Data are dependent/ conditional
& random data influence the behaviour of on one another
another ✓ Data are given in ranks
✓ data are selected randomly
Parametric test procedures
1) Involve Population Parameters
– Ex: Population Mean
2) Have Stringent Assumptions
– Example: Normal Distribution
3) Require Interval Scale or Ratio Scale
– Whole Numbers or Fractions
– Example: weight in kilogram (78, 64.5, 53.2)
4) Examples: z-Test, t-Test, ANOVA
Non-parametric test procedures
1) Do not involve population parameters
2) No stringent distribution assumptions “Distribution-
free”
3) Data measured on any scale
– Ratio or Interval
– Ordinal Ex: Good-Better-Best
– Nominal Ex: Male-Female
4) Example: Wilcoxon-Mann-Whitney Test
Advantages of non-parametric tests
1) Can be used with all scales
2) Easier to compute/ calculate & less time consuming
than parametric tests when sample size is small.
3) Make fewer assumptions
4) Need not involve population parameters
✓ Distribution free!!
5) Results may be as exact as parametric procedures
✓ Many non-parametric methods make it possible to work
with very small samples, particularly helpful in collecting
pilot study data or medical researcher working with a
rare disease.
Disadvantages of
non-parametric tests
1) May waste information if data permit using
parametric procedures
✓ Example: Converting data from ratio to ordinal scale
2) Require a larger sample size than the corresponding
parametric test in order to achieve the same power
3) Difficult to compute by hand for
large samples
4) Statistical tables are not
readily available
Limitations of
non-parametric methods
• Statistical methods which require no
assumptions about populations are usually
less efficient .

• As the sample size get larger, data


manipulations required for non-parametric
tests becomes laborious/requiring
considerable effort & time.

• A collection of tabulated critical values for


a variety of non-parametric tests under
situations dealing with various sample sizes
is not readily available.
Parametric vs non parametric
3: Testing the assumption of
normality
Normality
• This assumption is only broken if there are large &
obvious departures from normality
• This can be checked by
✓ Inspecting a histogram
✓ Skewness & kurtosis ( Kurtosis describes the peak of the
curve Skewness describes the symmetry of the curve.)
✓ Kolmogorov-Smirnov (K-S) test (sample size is ≥50 )
✓ Shapiro-Wilk test (if sample size is <50)
(Sig. value >0.05 indicates normality of the distribution)
4: Commonly used non-
parametric tests
parametric test &
their non-
parametric
k is number of group Equivalents

Comparison Comparison
Relationship
k=2 k>2
non-parametric tests equivalent

One- Kruskal
Wilcoxon Mann- Friedman Spearman
sample
matched Whitney -Wallis Test Rank
sign pairs test Test Correlation
U Test
test
parametric tests

One- Two
Paired t Independent One- Repeated Correlation
Sample
Test Sample t- Way Measures
t Test ANOVA
3&10/05/2018 ASH25302 Test ANOVA
(equivalent to one sample t-test)
Purpose
• To test whether the sample median of one measurement taken
on a single population is different from an expected value E

Hypothesis
• 1: State Ho & Ha; 2: read sig.- value; 3: decision & conclusion

Ho: The median of the sample is not significantly different from the
expected value
Ha: The median of the sample is significantly different from the
expected value
Criteria Decision
sig-value < α Reject HO
sig-value  α Fail to Reject HO
Example:
The Internal Revenue Service (IRS) claims that it should typically
take about 160 minutes to fill out a 1040 tax form. A researcher
believes that the IRS's claim is not correct and that it generally
takes people longer to complete the form. He recorded the time
(in minutes) it took 30 individuals to complete the form.

Research question:
It typically takes longer than 160 minutes to fill out the form
Measurement:
Time in minutes to fill out the form
Statistical Model:
Assume the underlying distribution is Normal.

Null hypothesis:
Ho : μ = 160 (status quo)
Alternative hypothesis:
H1 : μ > 160 (research question)
Output shows t statistics (1.7001), the degrees of freedom (29), p-value
(0.04991), 95% confidence interval (160.0283, ∞) and the sample estimate of
the parameter, mean of x, 209.4.
When the problem is set up this way, with the assumption of the underlying
distribution being normal, the p-value is 0.04991. Therefore we reject the null
hypothesis and conclude that it takes on average longer than 160 to complete
the 1040 form.
The one-
sample
sign test

example 1:
A test score is
compared to a
median score
Time
example 2: fill in the
tax forms is
test median compared to a
score score expected 160
minutes form
filling
Sign Test
✓ Used for paired data, can be ordinal or continuous
✓ Simple & easy to interpret
✓ Makes no assumptions about distribution of the data
✓ Not very powerful
✓ To evaluate H0 we only need to know the signs of the
differences
✓ If half the differences are positive & half are negative, then
the median = 0 (H0 is true).
✓ If the signs are more unbalanced, then that is evidence
against H0.
➢ Children in an orthodontia study
were asked to rate how they felt
about their teeth on a 5 point scale.
➢ Survey administered before & after
treatment.

How do you feel about


your teeth?
1. Wish I could change
them
2. Don’t like, but can put
up with them
3. No particular feelings
one way or the other
4. I am satisfied with
them
5. Consider myself
fortunate in this area
Rating Rating
child before after

1 1 5
2 1 4
3 3 1
4 2 3 Use the sign test to evaluate
5 4 4 whether these data provide
6 1 4 evidence that orthodontic
7 3 5
treatment improves children’s
8 1 5
9 1 4
image of their teeth.
10 4 4
11 1 1
12 1 4
13 1 4
14 2 4
15 1 4
16 2 5
17 1 4
18 1 5
19 4 4
20 3 5
Rating Rating
child before after change
1 1 5 4
2 1 4 3
3 3 1 -2
4 2 3 1 First, for each child, compute
5 4 4 0 the difference between the 2
6 1 4 3
ratings
7 3 5 2
8 1 5 4
9 1 4 3
10 4 4 0
11 1 1 0
12 1 4 3
13 1 4 3
14 2 4 2
15 1 4 3
16 2 5 3
17 1 4 3
18 1 5 4
19 4 4 0
20 3 5 2
Rating Rating
child before after change sign
1 1 5 4 + • The sign test looks at the
2 1 4 3 + signs of the differences
3 3 1 -2 -
4 2 3 1 +
– 15 children felt better
5 4 4 0 0 about their teeth (+
6 1 4 3 + difference in ratings)
7 3 5 2 +
– 1 child felt worse (- diff.)
8 1 5 4 +
9 1 4 3 + – 4 children felt the same
10 4 4 0 0 (difference = 0)
11 1 1 0 0
• If H0 were true we’d expect an
12 1 4 3 +
equal number of positive &
13 1 4 3 +
14 2 4 2 +
negative differences.
15 1 4 3 + (P value from table 0.004)
16 2 5 3 +
17 1 4 3 +
18 1 5 4 +
19 4 4 0 0
20 3 5 2 +
(equivalent to paired t-test)

Purpose
• To test whether the medians of two paired sets of measurements
from a same identifiable population are different from each other

Hypothesis
• 1: State Ho & Ha; 2: read sig.- value; 3: decision &
WILCOXON conclusion

Ho: The median difference is not significantly different from the zero
Ha: The median difference is significantly different from the zero
Criteria Decision
sig-value < α Reject HO
sig-value  α Fail to Reject HO
Wilcoxon
Matched Pairs
Signed-ranks
Test

exampleA1:single group of
people measured
twice e.g. before
& after a
treatment example 2:
Related people
measured once
e.g. a single
group of husband
& wives
Wilcoxon signed-rank test
• is a non-parametric statistical hypothesis test used when
comparing 2 related samples, matched samples, or repeated
measurements on a single sample to assess whether their
population mean ranks differ (i.e. it is a paired difference
test).
• It can be used as an alternative to the paired Student’s t-
test, t-test for matched pairs, or the t-test for dependent
samples when the population cannot be assumed to be
normally distributed.
• Wilcoxon t-test, the test statistic is reported as a value of T.
• Similar to sign test, but take into consideration the magnitude
of difference among the pairs of values. (Sign test only
considers the direction of difference but not the magnitude of
differences)
Assumption - Wilcoxon signed-rank test
1) Data are paired & come from the same population.
2) Each pair is chosen randomly & independently.
3) The data are measured at least on an ordinal
scale (i.e., they cannot be nominal).
The Wilcoxon signed rank test – single sample
A random sample of 10 students marks:
64, 69, 40, 64, 65, 65, 82, 59, 64, 74

Is there evidence at the 5% level to suggest that the median


mark is greater than 63?

Ho: population median mark = 63 marks


H1: population median mark > 63 marks
(1 tail)
Calculate the difference between each value & the median.

Difference = data value - median


N 1 2 3 4 5 6 7 8 9 10

Mark 64 69 40 64 65 65 82 59 64 74

Median 63 63 63 63 63 63 63 63 63 63

Difference 1 6 -23 1 2 2 19 -4 1 11

Ignore the signs, rank the differences


Smallest = rank 1
Difference 1 6 -23 1 2 2 19 -4 1 11

Ranks 2 7 10 2 4.5 4.5 9 6 2 8

1 2 3 4 5 6 7 8 9 10

2 4.5
Difference 1 6 -23 1 2 2 19 -4 1 11

Ranks 2 7 10 2 4.5 4.5 9 6 2 8

+ Ranks 2 7 2 4.5 4.5 9 2 8

- Ranks 10 6

The totals are:

T+ = 2 + 7 + 2 +4.5 + 4.5 + 9 + 2 + 8 = 39
T- = 10 + 6 = 16
The smallest is test statistic, which is 16.
Wilcoxon signed rank test table
1-tail test, 5% level, n = 10
Critical value = 11

Test statistic = 16

If test statistic  critical value,


reject Ho

In this case, test statistic (16)  critical value (11)


so, Ho accepted

Null hypothesis, Ho: population median mark = 63 marks

This shows the no significant evidence that the median mark is


greater than 63
The Wilcoxon signed rank test – paired sample
The marks obtained from the mock and A level examination, by a
random sample of 13 students shown in the table below:
n 1 2 3 4 5 6 7 8 9 10 11 12 13
Mock 40 65 53 79 87 42 80 63 51 82 27 71 29
A level 45 68 47 75 88 60 77 69 60 88 30 73 35

At 5% significant level, did the students perform better in the A


level than mock examination?

Ho: population median different = 0


H1: population median different > 0 (1 tail)
Find the differences (A-level – Mock examination), then rank them.
n 1 2 3 4 5 6 7 8 9 10 11 12 13
Mock 40 65 53 79 87 42 80 63 51 82 27 71 29
A level 45 68 47 75 88 60 77 69 60 88 30 73 35
Difference 5 3 -6 -4 1 18 -3 6 9 6 3 2 6
+ Ranks 7 4 1 13 9.5 12 9.5 4 2 9.5
- Ranks 9.5 6 4

The totals are:

T+ = 7 + 4 + 1 + 13 + 9.5 + 12 + 9.5 + 4 + 2 +9.5 = 71.5


T- = 9.5 + 6 + 4 = 19.5
The smallest is test statistic, which is 19.5.
Wilcoxon signed rank test table
1-tail test, 5% level, n = 13
Critical value = 21

Test statistic = 19.5

If test statistic  critical value,


reject Ho
In this case,
test statistic (19.5)  critical value (21)
so, Ho rejected

Alternative hypothesis, H1:


population median different > 0

This shows the significant evidence that the students did better in
A-level than mock examination
(equivalent to two
independent sample t-
test)

Purpose
• To test whether the medians of two unpaired sets of
measurements are different from each other

Hypothesis
• 1: State Ho & Ha; 2: read sig.- value; 3: decision &
WILCOXON conclusion

Ho: The median of the two samples are not significantly different from
the zero
Ha: The median of the two samples are significantly different from the
zero
Criteria Decision
sig-value < α Reject HO
sig-value  α Fail to Reject HO
Wilcoxon-Mann- example 1:
Whitney Test/ Mann- To test whether
Whitney U Test experimentally
treated
organism are
example 2: different from
controls
One species is
different from
another example 3:
To compare the
numbers of ground
beetles in 2 different
treated fields (1 is an
arable crop & the
other being
permanent pasture)
✓ a non-parametric test used to compare 2 independent
groups of sampled data (compare median) - when we
have to test 2 populations are identical
✓ also called the rank sum test, Wilcoxon-test, Wilcoxon
rank sum test, U-test, Mann-Whitney-U-test
✓ The test statistic for the Mann-Whitney test is U.
✓ This value is compared to a table of critical values for U
based on the sample size of each group.
✓ test for assessing whether 1 of 2 samples of
independent observations tends to have larger values
than the other.
✓ null hypothesis

H0: μ1 = μ2μ1 = μ2 (since there are 2 populations)

✓ alternative hypothesis

H1:μ1 ≠ μ2μ1 ≠ μ2
Wilcoxon-Mann-Whitney test procedures
1) Assign Ranks, ri, to the n1 + n2 sample observations
✓ If unequal sample sizes, let n1 refer to smaller-sized
sample, smallest value = 1
2) Sum the Ranks, Ri, for Each Sample
3) Test Statistic
✓ Null hypothesis: both samples come from the same
underlying distribution
✓ where R is the sum of ranks
in sample 1.
✓ Compute also (n1n2 – U). If this expression is larger than
the above U, then this becomes the final U statistic.
✓ At N>=20, U begins to approximate t, so the test stat
changes to a t-value.
✓ For convenience, take the smaller sample as the first
sample.
✓ Find the mean & variance of the sampling distribution of U
statistic, which is given by
Example:
The concentration of cholesterol (a type of fat) in the blood is associated with the
risk of developing heart disease, such that higher concentrations of cholesterol
indicate a higher level of risk, and lower concentrations indicate a lower level of
risk. If lower the concentration of cholesterol in the blood, risk for developing heart
disease can be reduced. Being overweight and/or physically inactive increases the
concentration of cholesterol in blood. Both exercise and weight loss can reduce
cholesterol concentration. However, it is not known whether exercise or weight
loss is best for lowering cholesterol concentration. Therefore, a researcher decided
to investigate whether an exercise or weight loss intervention was more effective in
lowering cholesterol levels. To this end, the researcher recruited a random sample
of inactive males that were classified as overweight. This sample was then
randomly split into two groups: Group 1 underwent a calorie-controlled diet (i.e.,
the 'diet' group) and Group 2 undertook an exercise-training programme (i.e., the
'exercise' group). In order to determine which treatment programme was more
effective, cholesterol concentrations were compared between the two groups at
the end of the treatment programmes.
From this data, it can be concluded that
cholesterol concentration in the diet group
was statistically significantly higher than the
exercise group (U = 110, p = .014).
(equivalent to one way
ANOVA)
Purpose
William Henry
("Bill") Kruskal • To test whether the medians of two or more sets of
1919 – 2005 unrelated measurements are different from each other

Hypothesis
• 1: State Ho & Ha; 2: read sig.- value; 3: decision &
conclusion
Wilson Allen Wallis
1912 – 1998

Ho: The medians of the samples are not significantly different from one
another
Ha: The medians of the samples are significantly different from one
another
Criteria Decision
sig-value < α Reject HO
sig-value  α Fail to Reject HO
Kruskal-
Wallis Test

example 1:
To test whether one
or more groups of
experimentally
treated organism are
different from example 2:
controls To test whether
two or more
species are
different from
another
(equivalent to repeated ANOVA)

Purpose
• To test whether the medians of two or more sets of
related measurements are different from each other

Hypothesis
• 1: State Ho & Ha; 2: read sig.- value; 3: decision &
conclusion
Milton Friedman
1912 – 2006

Ho: The medians of the samples are not significantly different from
each other
Ha: The medians of the samples are significantly different from each
other
Criteria Decision
sig-value < α Reject HO
sig-value  α Fail to Reject HO
Friedman example 1:

ANOVA Test to test whether 1 group


of experimentally
treated organisms are
different at several times
after a treatment

example 2:
to test whether 2 or
more sets of example 3:
measurements taken To compare numbers
at known time points of pellets eaten by
are different from birds among 3 sets of
each other slugs pellets
(controls- with
nothing added; ones
with added quinine;
ones with added chili)
(equivalent to Pearson Product Moment Correlation)

Purpose
• To test whether the ranks sets of paired
measurements are linearly associated.

Hypothesis
Charles Spearman • 1: State Ho & Ha; 2: read sig.- value; 3: decision &
(1863–1945) conclusion

Ho: There is no significantly correlation between the two variables


Ha: There is a significantly correlation between the two variables

Criteria Decision
sig-value < α Reject HO
sig-value  α Fail to Reject HO
exampleto1:test whether there
is any relationship
between the density
of tadpoles & their
dragonfly larvae
predators at 12 to test
example 2: whether
ponds dominance of
male rats related
to the levels of
testosterone in
their blood
Applying the tests in SPSS
software
Normality tests
Chi-square tests
The Sign, Wilcoxon and McNemar test
Mann Whitney U test
• Mann whitney U
Kruskal Wallis H test
Friendman’s ANOVA and Cochran’s
Spearman’s rho correlation test

You might also like