Nonparametric Inference

54
Nonparametric Nonparametric Inference Inference

description

Nonparametric Inference. Why Nonparametric Tests?. - PowerPoint PPT Presentation

Transcript of Nonparametric Inference

Page 1: Nonparametric Inference

Nonparametric Nonparametric InferenceInference

Page 2: Nonparametric Inference

Why Nonparametric Why Nonparametric Tests?Tests?

• We have been primarily discussing parametric We have been primarily discussing parametric tests; i.e. , tests that hold certain assumptions tests; i.e. , tests that hold certain assumptions about when they are valid, e.g. t-tests and about when they are valid, e.g. t-tests and ANOVA both had assumptions regarding the ANOVA both had assumptions regarding the shape of the distribution (normality) and about shape of the distribution (normality) and about the necessity of having similar groups the necessity of having similar groups (homogeneity of variance). (homogeneity of variance).

• When these assumptions hold we can use When these assumptions hold we can use standard sampling distributions (e.g. t-standard sampling distributions (e.g. t-distribution, F-distribution) to find p-values.distribution, F-distribution) to find p-values.

Page 3: Nonparametric Inference

Why Nonparametric Tests?Why Nonparametric Tests?• When these assumptions are violated it is When these assumptions are violated it is

necessary to turn to tests that do not have necessary to turn to tests that do not have such stringent assumptions ~ such stringent assumptions ~ nonparametric or "distribution-free" tests. nonparametric or "distribution-free" tests.

• Specifically, there are three cases which Specifically, there are three cases which necessitate the use of non-parametric tests:necessitate the use of non-parametric tests:

1) The data for the response is 1) The data for the response is not at least not at least interval scale, i.e. interval scale, i.e. measurements. measurements. For example the response might For example the response might be ordinal.be ordinal.

2) The distribution of the data for 2) The distribution of the data for the response is the response is not normal. not normal. Recall that a relatively normal Recall that a relatively normal distribution is distribution is assumed for parametric tests. assumed for parametric tests.

3) There exists severely unequal 3) There exists severely unequal variances variances between groups, between groups, i.e. there is i.e. there is obviously a obviously a violation of the homogeneity of violation of the homogeneity of variance variance assumption required for parametric assumption required for parametric tests. tests.

In the last two cases, we have In the last two cases, we have interval level data, but it violates interval level data, but it violates our parametric assumptions. our parametric assumptions. Therefore, we no longer treat this Therefore, we no longer treat this data as interval, but as ordinal. In a data as interval, but as ordinal. In a sense, we demote it because it fails sense, we demote it because it fails to meet specific assumptions.to meet specific assumptions.

Page 4: Nonparametric Inference

Table of Parametric & Table of Parametric & Nonparametric TestsNonparametric Tests

Parametric TestParametric TestNonparameNonparame

trictricTestTest

Purpose of Purpose of TestTest

Two-Sample Two-Sample t-Test (either case)t-Test (either case)

Mann-Mann-Whitney/ Whitney/ Wilcoxon Wilcoxon Rank Sum Rank Sum

TestTest

Compare two Compare two independent independent samplessamples

Paired t-TestPaired t-TestSign Test orSign Test or

Wilcoxon Wilcoxon Signed-Rank Signed-Rank

TestTest

Compare Compare dependent dependent samplessamples

Oneway ANOVAOneway ANOVA Kruskal-Kruskal-Wallis TestWallis Test

Compare Compare k-independent k-independent samplessamples

Page 5: Nonparametric Inference

Independent Independent SamplesSamples

• For For twotwo populations we use… populations we use… Mann-Whitney/Wilcoxon Mann-Whitney/Wilcoxon Rank Sum Test Rank Sum Test

• For For three or morethree or more populations populations we use…we use…

Kruskal-Wallis Test Kruskal-Wallis Test (at the (at the end)end)

Page 6: Nonparametric Inference

Mann-Whitney/Wilcoxon Rank Mann-Whitney/Wilcoxon Rank Sum TestSum Test

• Alternative to two-sample t-TestAlternative to two-sample t-Test• Use when…Use when…

- populations being sampled are not - populations being sampled are not normally normally distributed. distributed.

- sample sizes are small so assessing - sample sizes are small so assessing normality isnormality is not possible ( not possible (nnii << 20 20).).

- response is ordinal- response is ordinal

Page 7: Nonparametric Inference

Mann-Whitney/Wilcoxon Rank Mann-Whitney/Wilcoxon Rank Sum TestSum Test

General HypothesesGeneral HypothesesHHoo: distribution of pop. A and pop. B are the : distribution of pop. A and pop. B are the

same, i.e. A = B same, i.e. A = BHHAA: distribution of pop. A and pop. B are NOT : distribution of pop. A and pop. B are NOT

the same, i.e A = B the same, i.e A = BHHAA: distribution of pop. A is shifted to the right : distribution of pop. A is shifted to the right

of pop. B, i.e. A > B. of pop. B, i.e. A > B.HHAA: distribution of pop. A is shifted to the left of : distribution of pop. A is shifted to the left of

pop. B, i.e. A < B pop. B, i.e. A < B

Page 8: Nonparametric Inference

Mann-Whitney/Wilcoxon Rank Mann-Whitney/Wilcoxon Rank Sum TestSum Test

HHoo: A = B vs. H: A = B vs. HAA: A : A > B> B

Q: Is there evidence that the values in population A are generally larger than those in population B?

Page 9: Nonparametric Inference

Mann-Whitney/Wilcoxon Rank Mann-Whitney/Wilcoxon Rank Sum TestSum Test

(Test Procedure)(Test Procedure)1.1. Rank all Rank all N = nN = nAA + n + nB B observations in the combined observations in the combined

sample from both populations in ascending order.sample from both populations in ascending order.2.2. Sum the ranks of the observations from populations A Sum the ranks of the observations from populations A

and B separately and denote the sums wand B separately and denote the sums wAA and w and wBB. . Assign average rank to tied observations.Assign average rank to tied observations.

3.3. For HFor HAA: A < B reject Ho if w: A < B reject Ho if wAA is “small” or w is “small” or wBB is “big”. is “big”.For HFor HAA: A > B reject Ho if w: A > B reject Ho if wAA is “big” or w is “big” or wBB is “small”. is “small”.

4.4. Use tables to determine how “big” or “small” the rank Use tables to determine how “big” or “small” the rank sums must be in order to reject Hsums must be in order to reject Ho o or use software to or use software to conduct the test.conduct the test.

Page 10: Nonparametric Inference

Mann-Whitney/Wilcoxon Rank Mann-Whitney/Wilcoxon Rank Sum TestSum Test

(Critical Value Table)(Critical Value Table)This table contains the value the smaller rank sum must be less than in order to reject the Ho for a one-tailed test situation for two significance levels ( = .05 & .01)

Tables exist for the two-tailed tests as well.

n is the sample size of the group with the smaller rank sum.

Page 11: Nonparametric Inference

Example: Huntington’s Example: Huntington’s Disease and Disease and

Fasting Glucose Fasting Glucose LevelsLevels Davidson et al. studied the responses Davidson et al. studied the responses

to oral glucose in patients with to oral glucose in patients with Huntington’s disease and in a group Huntington’s disease and in a group of control subjects. The five-hour of control subjects. The five-hour responses are shown below. Is there responses are shown below. Is there evidence to suggest the five-hour evidence to suggest the five-hour glucose (mg present) is greater for glucose (mg present) is greater for patients with Huntington’s disease? patients with Huntington’s disease? Ho: Control = Huntington’s i.e.

C = H

HA: Control < Huntington’s i.e. C < H

Page 12: Nonparametric Inference

Example:Example: Observations & Observations & RanksRanks

Control Group (nControl Group (nAA = 10) = 10) Huntington’s Disease (nHuntington’s Disease (nBB = = 11)11)

8383 85857373 89896565 86866565 91919090 77777777 93937878 1001009797 8282

85 85 92927575 8686

8686

1.51.5

3

4

5.5

5.5

78

9

10.5

10.5

13

1313

15

1617

18

19

2021

wA = 78 wB = 153

Page 13: Nonparametric Inference

Example:Example: Critical Value Table Critical Value Table

Here,

nC = 10 (control)

nH= 11 (Huntington’s)

we will reject

Ho: C = H

in favor of

HA: C < H

if the rank sum for the control group is less than 86 at = .05 level and less than 77 at = .01 level.

Page 14: Nonparametric Inference

Example: Example: Decision/ConclusionDecision/Conclusion

Using the Wilcoxon Rank Sum Test we have Using the Wilcoxon Rank Sum Test we have evidence to suggest that the five hour glucose evidence to suggest that the five hour glucose level for individuals with Huntington’s disease level for individuals with Huntington’s disease is greater than that for healthy controls (p is greater than that for healthy controls (p < .05).< .05).

Note:Note: p < .05 because the observed rank sum for p < .05 because the observed rank sum for

the control group is less than 86 which is the control group is less than 86 which is the the critical value for critical value for = .05. = .05.

Page 15: Nonparametric Inference

Rank Sum Test in JMPRank Sum Test in JMP

The p-values reported based upon large sample approximations which generally should not be used when sample sizes are small. Here the conclusion reached is the same but in general we should use tables if they are available.

Page 16: Nonparametric Inference

Dependent Dependent SamplesSamples

•Sign TestSign Test•Wilcoxon Signed-Wilcoxon Signed-Rank TestRank Test

Page 17: Nonparametric Inference

Sign TestSign Test• The sign test can be used in place of the The sign test can be used in place of the

paired t-test when we have evidence that the paired t-test when we have evidence that the paired differences are NOT normally paired differences are NOT normally distributed. distributed.

• It can be used when the response is ordinal. It can be used when the response is ordinal. • Best used when the response is difficult to Best used when the response is difficult to

quantify and only improvement can be quantify and only improvement can be measured, i.e. subject got better, got worse, measured, i.e. subject got better, got worse, or no change.or no change.

• Magnitude of the paired difference is lost Magnitude of the paired difference is lost when using this test.when using this test.

Page 18: Nonparametric Inference

Sign TestSign Test• The sign test looks at the number of (+) The sign test looks at the number of (+)

and (-) differences amongst the nonzero and (-) differences amongst the nonzero paired differences. paired differences.

• A preponderance of +’s or –’s can indicate A preponderance of +’s or –’s can indicate that some type of change has occurred.that some type of change has occurred.

• If the null hypothesis of no change is true If the null hypothesis of no change is true we expect +’s and –’s to be equally likely we expect +’s and –’s to be equally likely to occur, i.e. P(+) = P(-) = .50 and the to occur, i.e. P(+) = P(-) = .50 and the number of each observed follows a number of each observed follows a binomial distribution.binomial distribution.

Page 19: Nonparametric Inference

Example: Sign TestExample: Sign Test• A study evaluated hepatic arterial A study evaluated hepatic arterial

infusion of floxuridine and cisplatin infusion of floxuridine and cisplatin for the treatment of liver metastases for the treatment of liver metastases of colorectral cancer. of colorectral cancer.

• Performance scores for 29 patients Performance scores for 29 patients was recorded before and after was recorded before and after infusion. Is there evidence that infusion. Is there evidence that patients had a better performance patients had a better performance score after infusion?score after infusion?

Page 20: Nonparametric Inference

Example: Sign TestExample: Sign TestPatientPatient

Before Before (B) (B) InfusionInfusion

After After (A) (A) InfusionInfusion

DifferenDifference (A – ce (A – B)B)

PatientPatientBefore Before (B) (B) InfusionInfusion

After After (A) (A) InfusionInfusion

DifferenDifference (A – ce (A – B)B)

11 22 11 -1-1 1616 00 00 0022 00 00 00 1717 00 33 3333 00 00 00 1818 22 33 1144 11 00 -1-1 1919 22 33 1155 33 33 00 2020 33 22 -1-166 11 00 -1-1 2121 00 44 4477 11 33 22 2222 00 33 3388 00 00 00 2323 11 22 1199 00 00 00 2424 00 33 331010 00 00 00 2525 00 22 221111 11 00 -1-1 2626 11 11 001212 11 11 00 2727 33 33 001313 22 11 -1-1 2828 11 22 111414 33 11 -2-2 2929 00 22 221515 00 00 00

Page 21: Nonparametric Inference

Example: Sign TestExample: Sign Test• HHoo: No change in performance score following : No change in performance score following

infusion, or more specifically median infusion, or more specifically median change in performance score is 0. change in performance score is 0.

• HHAA: Performance scores improve following : Performance scores improve following infusion, or more specifically median infusion, or more specifically median

change in performance score > 0.change in performance score > 0.

Intuitively we will reject Ho if there is a Intuitively we will reject Ho if there is a “large” number of +’s.“large” number of +’s.

Page 22: Nonparametric Inference

Example: Sign Test Example: Sign Test PatientPatient

Before Before (B) (B) InfusionInfusion

After After (A) (A) InfusionInfusion

DifferenDifference (A – ce (A – B)B)

PatientPatientBefore Before (B) (B) InfusionInfusion

After After (A) (A) InfusionInfusion

DifferenDifference (A – ce (A – B)B)

11 22 11 -1 -1 1616 00 00 0022 00 00 00 1717 00 33 3333 00 00 00 1818 22 33 1144 11 00 -1-1 1919 22 33 1155 33 33 00 2020 33 22 -1-166 11 00 22 2121 00 44 4477 11 33 00 2222 00 33 3388 00 00 00 2323 11 22 1199 00 00 00 2424 00 33 331010 00 00 -1-1 2525 00 22 221111 11 00 00 2626 11 11 001212 11 11 -1-1 2727 33 33 001313 22 11 -2-2 2828 11 22 111414 33 11 00 2929 00 22 221515 00 00 00

-

-

-

--

-+

+++

+++++

++

17 nonzeros differences, 11 +’s 6 –’s

Page 23: Nonparametric Inference

Example: Sign TestExample: Sign Test• If If HHoo is true, X = the number of +’s has a is true, X = the number of +’s has a

binomial dist. with n = 17 and p = P(+) binomial dist. with n = 17 and p = P(+) = .50. = .50.

• Therefore the p-value is simply the Therefore the p-value is simply the P(X P(X >> 11|n=17, p = .50)=.166 > 11|n=17, p = .50)=.166 >

• We fail to reject We fail to reject HHoo, there is insufficient , there is insufficient evidence to conclude the performance score evidence to conclude the performance score improves following infusion (p = .166).improves following infusion (p = .166).

Page 24: Nonparametric Inference

Wilcoxon Signed-Rank Wilcoxon Signed-Rank TestTest

• The problem with the sign test is that the The problem with the sign test is that the magnitude or size of the paired magnitude or size of the paired differences is lost.differences is lost.

• The Wilcoxon Signed-Rank Test uses The Wilcoxon Signed-Rank Test uses ranks of the paired differences to retain ranks of the paired differences to retain some sense of their size.some sense of their size.

• Use when the distribution of the paired Use when the distribution of the paired differences are NOT normal or when differences are NOT normal or when sample size is small.sample size is small.

• Can be used with an ordinal response.Can be used with an ordinal response.

Page 25: Nonparametric Inference

Wilcoxon Signed Rank TestWilcoxon Signed Rank Test(Test Procedure)(Test Procedure)

• Exclude any differences which Exclude any differences which are zero.are zero.

• Put the rest of differences in Put the rest of differences in ascending order ascending order ignoring their ignoring their signssigns..

• Assign them ranks.Assign them ranks.• If any differences are equal, If any differences are equal,

average their ranks.average their ranks.

Page 26: Nonparametric Inference

Example: Wilcoxon Signed Example: Wilcoxon Signed Rank TestRank Test

Resting Energy Expenditure (REE) Resting Energy Expenditure (REE) for Patient with Cystic Fibrosisfor Patient with Cystic Fibrosis

• A researcher believes that patients with A researcher believes that patients with cystic fibrosis (CF) expend greater cystic fibrosis (CF) expend greater energy during resting than those energy during resting than those without CF. To obtain a fair comparison without CF. To obtain a fair comparison she matches 13 patients with CF to 13 she matches 13 patients with CF to 13 patients without CF on the basis of age, patients without CF on the basis of age, sex, height, and weight. sex, height, and weight.

Page 27: Nonparametric Inference

Example: Wilcoxon Signed Example: Wilcoxon Signed Rank TestRank Test

PairPairCF CF (C)(C)

HealthHealthy (H)y (H)

DifferenDifference ce

d = C - d = C - HH

Sign of Sign of DifferenDifferen

cece

Abs. Abs. Diff.Diff. |d||d|

Rank Rank |d||d|

Signed Signed RankRank

11 11531153 996996 157157 ++ 157157 6622 11321132 10801080 5252 ++ 5252 3333 11651165 11821182 -17-17 -- 1717 2244 14601460 14521452 88 ++ 88 1155 16341634 11621162 472472 ++ 472472 131366 14931493 16191619 -126-126 -- 126126 5577 13581358 11401140 218218 ++ 218218 9988 14531453 11231123 330330 ++ 330330 111199 11851185 11131113 7272 ++ 7272 441010 18241824 14631463 361361 ++ 361361 12121111 17931793 16321632 161161 ++ 161161 771212 19301930 16141614 316316 ++ 216216 881313 20752075 18361836 239239 ++ 239239 1010

1-23

4

-5

6

78

9

10

11

12

13

Page 28: Nonparametric Inference

Example: Wilcoxon Signed Example: Wilcoxon Signed Rank TestRank Test

PairPairCF CF (C)(C)

HealthHealthy (H)y (H)

DifferenDifference ce

d = C - d = C - HH

Signed Signed RankRank

11 11531153 996996 157157 6622 11321132 10801080 5252 3333 11651165 11821182 -17-17 -2-244 14601460 14521452 88 1155 16341634 11621162 472472 131366 14931493 16191619 -126-126 - 5- 577 13581358 11401140 218218 9988 14531453 11231123 330330 111199 11851185 11131113 7272 441010 18241824 14631463 361361 12121111 17931793 16321632 161161 771212 19301930 16141614 316316 881313 20752075 18361836 239239 1010

We then calculate the sum of the positive ranks ( T+ ) and the sum of the negative ranks (T- ).

Here we have

T+ = 6 + 3 + 1 + 13 + 9 + 11 + 4 + 12 + 7 + 8 + 10 = 84

and

T- = 2 + 5 = 7

Page 29: Nonparametric Inference

Wilcoxon Signed Rank TestWilcoxon Signed Rank Test(Test Statistic)(Test Statistic)

• Intuitively we will reject the Intuitively we will reject the HHoo ,which ,which states that there is no difference states that there is no difference between the populations, if either one between the populations, if either one of these rank sums is “large” and the of these rank sums is “large” and the other is “small”.other is “small”.

• The Wilcoxon Signed Rank Test uses The Wilcoxon Signed Rank Test uses the smaller rank sum, the smaller rank sum, T = min( TT = min( T+ + ,T,T- - )) , , as the test statistic.as the test statistic.

Page 30: Nonparametric Inference

Example: Wilcoxon Signed Example: Wilcoxon Signed Rank TestRank Test

For the cystic fibrosis example we have For the cystic fibrosis example we have the following hypotheses:the following hypotheses:

HHoo:: there is no difference in the resting there is no difference in the resting energy expenditure of individuals with energy expenditure of individuals with CF and healthy controls who are the CF and healthy controls who are the same gender, age, height, and weight.same gender, age, height, and weight.

HHAA:: the resting energy expenditure of the resting energy expenditure of individuals with CF is greater than individuals with CF is greater than that of healthy individuals who are the that of healthy individuals who are the same gender, age, height, and weight.same gender, age, height, and weight.

MEDIAN PAIRED DIFFERENCE = 0

MEDIAN PAIRED DIFFERENCE > 0

Page 31: Nonparametric Inference

Example: Wilcoxon Signed Example: Wilcoxon Signed Rank TestRank Test

HHAA:: the resting energy expenditure of the resting energy expenditure of individuals with CF is greater than that individuals with CF is greater than that of healthy individuals who are the same of healthy individuals who are the same gender, age, height, and weight.gender, age, height, and weight.

• The alternative is clearly supported if T+ The alternative is clearly supported if T+ is “large” or T- is “small”. is “large” or T- is “small”.

• The test statistic The test statistic T = min( TT = min( T+ + , T, T-- ) = 7 ) = 7• Is T = 7 considered small, i.e. what is the Is T = 7 considered small, i.e. what is the

corresponding p-value? corresponding p-value? • To answer this question we need a Wilcoxon Signed To answer this question we need a Wilcoxon Signed

Rank Test table or statistical software.Rank Test table or statistical software.

Page 32: Nonparametric Inference

Example: Wilcoxon Signed Example: Wilcoxon Signed Rank TestRank Test

This table gives the value of T = min( T+ , T- ) that our observed value must be less than in order to reject Ho for the both two- and one-tailed tests.

Here we have n = 13 & T = 7. We can see that our test statistic is less than 21 ( = .05) and 12 ( = .01) so we will reject Ho and we also estimate that our p-value < .01.

Page 33: Nonparametric Inference

Example: Wilcoxon Signed Example: Wilcoxon Signed Rank TestRank Test

• We conclude that individuals We conclude that individuals with cystic fibrosis (CF) have a with cystic fibrosis (CF) have a large resting energy large resting energy expenditure when compared expenditure when compared to healthy individuals who are to healthy individuals who are the same gender, age, height, the same gender, age, height, and weight (p < .01).and weight (p < .01).

Page 34: Nonparametric Inference

Analysis in JMPAnalysis in JMP

The test statistic is reported as (T+ - T-)/2 = (84 – 7)/2 = 38.50

but we only need p-value = .0023. Select Test Mean

from Difference pull-down menu, 0 for null value, and check Wilcoxon option.

Page 35: Nonparametric Inference

Analysis in SPSSAnalysis in SPSS

Click on CF first and then Healthy to specify that the paired difference will be defined as CF – Healthy & specify which tests to conduct. Note: the Difference column is not actually used in the SPSS analysis.

Page 36: Nonparametric Inference

Independent Independent SamplesSamples

• If we have three or more If we have three or more populations to compare we populations to compare we use…use…

Kruskal – Wallis TestKruskal – Wallis Test

Page 37: Nonparametric Inference

Kruskal-Wallis TestKruskal-Wallis Test• One-way ANOVA for a completely One-way ANOVA for a completely

randomized design is based on the randomized design is based on the assumption assumption of normality of normality and and equality of varianceequality of variance..

• The nonparametric alternative not relying The nonparametric alternative not relying on these assumptions is called the on these assumptions is called the Kruskal-Kruskal-Wallis TestWallis Test..

• Like the Mann-Whitney/Wilcoxon Rank Sum Like the Mann-Whitney/Wilcoxon Rank Sum Test we use the sum of the ranks assigned to Test we use the sum of the ranks assigned to each group when considering the combined each group when considering the combined sample as the basis for our test statistic.sample as the basis for our test statistic.

Page 38: Nonparametric Inference

Kruskal-Wallis TestKruskal-Wallis TestBasic Idea:Basic Idea:1) Looking at all observations together, 1) Looking at all observations together, rank them. rank them.

2) Let R2) Let R11, R, R22, …,R, …,Rkk be the sum of the be the sum of the ranks ranks of each group of each group

3) If some R3) If some Rii’s are much larger than ’s are much larger than others, others, it indicates the response values in it indicates the response values in different groups come from different different groups come from different populations populations..

Page 39: Nonparametric Inference

Kruskal-Wallis TestKruskal-Wallis Test• The test statistic isThe test statistic is

where,where, N = total sample size = n1 + n2 + ... +

nk

k

ik

i

ii

NnRn

NNH

1

21~

21

)1(12

rank overall average 2

1

groupfor rank average

N

inR

i

i

Page 40: Nonparametric Inference

Kruskal-Wallis TestKruskal-Wallis Test• The test statistic isThe test statistic is

• Under the null hypothesis, this has an Under the null hypothesis, this has an approximate chi-square distribution approximate chi-square distribution with with df = k -1df = k -1, i.e. ., i.e. .

• The approximation is OK when each The approximation is OK when each group contains at least 5 observations.group contains at least 5 observations.

• NN = total sample size = = total sample size = nn11 + n + n22 + ... + n + ... + nkk

k

ik

i

ii

NnRn

NNH

1

21~

21

)1(12

21k

Page 41: Nonparametric Inference

Chi-squared Distribution Chi-squared Distribution and p-valueand p-value

21k

Area = p-value

2

Page 42: Nonparametric Inference

Example: Kruskal-Wallis Example: Kruskal-Wallis TestTest

A clinical trial evaluating the fever A clinical trial evaluating the fever reducing effects of aspirin, ibuprofen, and reducing effects of aspirin, ibuprofen, and acetaminophen was conducted. Study acetaminophen was conducted. Study subjects were adults seen in an ER with subjects were adults seen in an ER with diagnoses of flu with body temperatures diagnoses of flu with body temperatures between 100between 100oo F and 100.9 F and 100.9oo F. Subjects F. Subjects were randomly assigned to treatment. were randomly assigned to treatment. Changes in body temperature were Changes in body temperature were recorded recorded 2 hrs. after administration of treatments.2 hrs. after administration of treatments.

Page 43: Nonparametric Inference

Example: Kruskal-Wallis Example: Kruskal-Wallis TestTestResulting Data: Temperature Resulting Data: Temperature

Decrease (deg. F)Decrease (deg. F)AspiriAspirinn

RanRankk

IbuprofIbuprofenen

RanRankk

AcetaminopAcetaminophenhen

RanRankk

.95.95 .39.39 .19.191.481.48 .44.44 1.021.021.331.33 1.311.31 .07.071.281.28 2.482.48 .01.01

1.391.39 .62.62-.39 -.39 (i.e. temp (i.e. temp increase)increase)

1

2

3

45

6

7

8

9

10

11

12

13

14

15

N = 15 R1 = 44 R2 = 50 R3 = 26 n1 = 4 n2 = 5 n3 = 6

Page 44: Nonparametric Inference

Example: Kruskal-Wallis Example: Kruskal-Wallis TestTest

2on with distributi square-chi i.e. ~ 833.6

2115

6266

2115

5505

2115

4444

)115(1512

21

)1(12

22

1

df

NnRn

NNH

k

i i

ii

N = 15 R1 = 44 R2 = 50 R3 = 26 n1 = 4 n2 = 5 n3 = 6

Page 45: Nonparametric Inference

Chi-squared Distribution Chi-squared Distribution and p-valueand p-value

833.6

Area = .033

22

Page 46: Nonparametric Inference

Kruskal-Wallis in JMP Kruskal-Wallis in JMP (Demo)(Demo)

Analyze > Fit Y by X

RESULTS

R1 = 44 n1 = 4

R2 = 50 n2 = 5

R3 = 26 n3 = 6

H = 6.833 df = 2

p = .033

Page 47: Nonparametric Inference

Decision/ConclusionDecision/Conclusion• Using the Kruskal-Wallis test have Using the Kruskal-Wallis test have

evidence to suggest that the evidence to suggest that the temperature changes after taking the temperature changes after taking the different drugs are not the same (p different drugs are not the same (p = .033).= .033).

• Now we might like to know which Now we might like to know which drugs significantly differ from one drugs significantly differ from one another.another.

Page 48: Nonparametric Inference

Multiple Comparisons forMultiple Comparisons forKruskal – Wallis TestKruskal – Wallis Test

• If we decide at least two populations If we decide at least two populations differ in term of what is typical of differ in term of what is typical of their values we can use multiple their values we can use multiple comparisons to determine which comparisons to determine which populations differ.populations differ.

• To do this we calculate an To do this we calculate an approximate p-value for each pair-approximate p-value for each pair-wise comparison and then compare wise comparison and then compare that p-value to a Bonferroni corrected that p-value to a Bonferroni corrected significance level significance level

Page 49: Nonparametric Inference

Multiple Comparisons forMultiple Comparisons forKruskal – Wallis TestKruskal – Wallis Test

1) , 0(~11

12)1(

N

nnNN

nR

nR

z

ji

j

j

i

i

ij

)( ijzZP

To determine if group i significantly differs from group j we compute

and then compute p-value = and compare to /2m where m is the number of possible pair-wise comparisons, m =

.

2)1( kk

Page 50: Nonparametric Inference

Multiple Comparisons forMultiple Comparisons forKruskal – Wallis TestKruskal – Wallis Test

• Comparing Aspirin to AcetominophenComparing Aspirin to AcetominophenN = 15 Aspirin Acetominophen

R1 = 44 R3 = 26 n1 = 4 n3 = 6

Ho.reject tofail we thus.0833 than lessnot is value-p 01044.)31.2(

31.2

61

41

12)16(15

626

444

1112

)1(

ZP

nnNN

nR

nR

z

ji

j

j

i

i

ij

Computing the Bonferroni corrected significance level we have .05/2(3) = .00833

Page 51: Nonparametric Inference

Multiple Comparisons forMultiple Comparisons forKruskal – Wallis TestKruskal – Wallis Test

As this is not significant no others will As this is not significant no others will either, so how can this be? either, so how can this be?

The problem is the Bonferroni correction The problem is the Bonferroni correction is too conservative and the approximate is too conservative and the approximate normality of the multiple comparison normality of the multiple comparison is valid only when sample sizes are is valid only when sample sizes are “large” and the sample sizes here quite “large” and the sample sizes here quite small.small.

Thus the comparison shown is fine for a Thus the comparison shown is fine for a demonstration of the procedure but the demonstration of the procedure but the results cannot be trusted.results cannot be trusted.

ijz

Page 52: Nonparametric Inference

Nonparametric Multiple Nonparametric Multiple Comparisons in JMPComparisons in JMP

Page 53: Nonparametric Inference

Nonparametric Multiple Nonparametric Multiple Comparisons in JMPComparisons in JMP

Page 54: Nonparametric Inference

Nonparametric Tests in RNonparametric Tests in R