26
NONPARAMETRIC TESTS Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman

Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

  • Upload
    others

  • View
    10

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

NONPARAMETRIC TESTS

Frank Wilcoxon Allen Wallis

Henry Kruskal

Andrey Kolmogorov

Charles Spearman

Page 2: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

OVERVIEW

• Nonparametric tests

• Sign test

• Rank-Sum tests

• Rank Correlation

• Tests of Randomness

• Kolmogorov-Smirnov & Anderson-Darling Tests

Page 3: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

INTRODUCTION

• So far all in our “standard” tests we have assumed our data follows an underlying distribution (normal distribution)

• It is sometimes difficult to verify this assumption, especially when the sample size is small

• To overcome this problem statisticians have developed a number of nonparametric tests

Page 4: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

INTRODUCTION

• Nonparametric tests are based on the order relationships among the observations aka ranking

• Very useful for nonnormal populations and small samples sizes

• However if the normality assumption is valid for your data, the “standard” tests are more powerful.

Page 5: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

Sign Test

• This is the nonparametric alternate to the one sample t test, the paired sample t-test, and their corresponding large sample tests

• Applicable for continuous symmetrical sample population, such that the probability of getting a sample value less than the mean and the probability of getting a sample value greater than the mean are both 0.5

• What statistic can do this ?

• So yes the sign test is based on the median

Page 6: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

Sign Test Procedure

• Hypothesis test

• Sign: If a data value is greater than the hypothesized value it is assigned a plus (+) sign, of if is less than, we assign it a minus(-) sign. If it is equal to the hypothesized value we discard it from further analysis.

• Criterion: We may base the analysis on the number of plus signs or the number of minus signs

cesignificanat

test] tailed[one )(or ~~:

)(or ~~:

21

0

21

00

pH

pH

a

Page 7: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

Sign Test Procedure

• Calculations:

replace the data values with their plus or minus sign.

Sum up number of plus signs (or minus), denoted S+ ( or S- ). Find P(X ≥ S+) [or P(X ≤ S-) ] from the binomial distribution

• Decision: If P(X ≥ S+) < α, [or P(X ≤ S-) < α ]then we reject H0, otherwise we fail to reject H0.

• Example

Page 8: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

RANK-SUM TESTS

• U test

– An alternative to the two-sample t – test

– Also called the Wilcoxon test, after Frank Wilcoxon(1895 – 1965) who was a professor at Florida State University, or the Mann-Whitney test

• H test

– The nonparametric equivalent of ANOVA

– also called the Kruskal-Wallis test

– Developed in 1960 by Kruskal (University of Chicago) and Wallis (Rochester University, NY)

Page 9: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

WILCOXON TEST

• Hypotheses:

– Null hypothesis: The two populations are identical

– Alternate Hypothesis: The populations are not identical

– test at significance level α

• Criterion: reject the null hypothesis if |Zcalc |> |Zα /2|, otherwise fail to reject(“two-tailed test”)

Page 10: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

U-TEST STATISTIC

Procedure:

• Combine your data into one set and rank them from lowest to highest noting which population each item came from.

• If there are ties in the ranking we assign each tied value the average rankings of the tied values.

• Sum the ranking values for each sample, denote as W1 and W2 respectively

Page 11: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

U-TEST STATISTIC

• Compute the U statistic as U1 or U2 where

• Or we may choose to base our test on U, such that U = min(U1 , U2)

• Let’s say we used U1, going through some rigorous steps (not shown here), it turns out the sampling distribution of U1 has mean and standard deviation as follows;

2

)1(or

2

)1( 2222

1111

nnWU

nnWU

Page 12: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

U-TEST STATISTIC

• If n1 and n2 > 8, then

• If n1 and n2 are not both > 8, abandon and look for an appropriate test for your data

• If you have a lot of ties in your ranking procedure, your final test result will be approximate only.

12

)1( and

2

212121

11

nnnnnnUU

1

11

U

U

calc

UZ

Page 13: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

H TEST OR KRUSKAL-WALLIS TEST

• This is the nonparametric equivalent of ANOVA.

• Requirements

o k treatments, each with ni sample size

o n1 + n2 + … + nK = n

o ni > 5 for all k treatments

o Otherwise this test will not work for your data

Page 14: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

KRUSKAL-WALLIS TEST

• Hypotheses:

– Null hypothesis: The populations are identical

– Alternate Hypothesis: The populations are not identical

– test at significance level α

• Criterion: reject the null hypothesis if H > χ2

α, k-1, otherwise fail to reject(Yes, a Chi-square test)

Page 15: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

H STATISTIC

Procedure:

• Combine your data into one set and rank them from lowest to highest noting which population each item came from.

• If there are ties in the ranking we assign each tied value the average rankings of the tied values.

Page 16: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

H STATISTIC

• Where Ri is the sum of the ranks occupied by the ni observations in the ith treatment

)1(3)1(

12

1

2

nn

R

nnH

k

i i

i

Page 17: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

RANK-SUM TESTS

• Example : Wilcoxon test

• Example: Kruskal-Wallis test

Any Questions, Comments, or Concerns ?

Page 18: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

SPEARMANS’S RANK CORRELATION

• Analogous to Pearson’s correlation r.• Observations are replaced by their ranks. When

ties occur assign the average rank to those tied at that rank.

• Ranking is from lowest to highest• Denoted by rs

• -1 < rs < 1 . Values near 1 indicate tendency for large x, y values to be paired together, whereas -1 indicates the opposite relationship

• rs measures the strength of relationship but that the relationship may not necessarily be linear

Page 19: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

SPEARMANS’S RANK CORRELATION

• Spearman’s correlation coefficient may be stated as follows

• If Ri is the ranking an xi value, Si the ranking of a yi value, and n is the number of bivariatepairs,

n

i

i

n

i

i

n

i

ii

s

SSRR

SSRR

r

1

2

1

2

1

)()(

))((

Page 20: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

SPEARMANS’S RANK CORRELATION

• Alternate representations include;

and

121

2

1

2

1

2

1

nn

nS

nR

r

n

i

ii

s

121

41

2

1

2

nn

nnSR

r

n

i

ii

s

Page 21: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

SPEARMANS’S RANK CORRELATION

• If the sample size is large, we can test if X and Y are independent using the test statistic

How do we test independence in the “regular” method?

• RESIDUALS !! wink, wink

• Examples

srnZ .

Page 22: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

TESTS OF RANDOMNESS

Page 23: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric
Page 24: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric

KOLMOGOROV-SMIRNOV AND ANDERSON-DARLING TESTS

Page 25: Henry Kruskal Andrey Kolmogorov NONPARAMETRIC TESTSkbofosu.com/EGS2025/LECTURE 12.pdf · Frank Wilcoxon Allen Wallis Henry Kruskal Andrey Kolmogorov Charles Spearman. OVERVIEW •Nonparametric