23
Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Embed Size (px)

Citation preview

Page 1: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education.

Chapter 23

Nonparametric Methods

Page 2: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-2

Many measurements are ordered information with no quantitative values or units. Surveys of opinion using categories such as “very satisfied,” “satisfied,” “neither satisfied nor dissatisfied,” “dissatisfied,” or “very dissatisfied” is a prime example of measurements without quantitative units.

These scales were first developed by Rensis Likert and are known as Likert scales. These data can be quite useful but how do you discern the difference between “very satisfied” and “satisfied” or “dissatisfied” versus “very dissatisfied.” These data have no units, so how can we compare them?

Page 3: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-3

23.1 Rank

When data has a clear order that cannot be quantified, rank is used to get a clearer understanding of the data. To rank the data, from two or more groups, order all the data and number them consecutively. For tied data levels, use the average of its consecutive numbers for the rank of each of the tied data values.

Example: Two small classes take a test; rank their letter grades.

Class 1 A+ C- B D A- C+

Class 1 ranks

Class 2 A- D B A B+ C

Class 2 ranks

12 3 6.5 1.5 9.5 5

9.5 1.5 6.5 11 8 4

Page 4: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-4

23.2 The Wilcoxon Rank-Sum/Mann-Whitney Statistic

The Wilcoxon rank-sum and the Mann-Whitney statistic use the sum of the ranks for each group to determine if the two groups are different. Because the sum of all the ranks is a known value only one of the group’s sums is needed to test the hypothesis.

H0: The two groups are the same.

HA: The two groups differ.

We need a P-value to determine whether the rank sums found are out of the ordinary. For smaller groups all possible rank sum can be computed and used to determine the probability of having a rank sum as extreme as the one found given the null is not rejected. Tables are available of critical values for rank sums of smaller groups.

Page 5: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-5

23.2 The Wilcoxon Rank-Sum/Mann-Whitney Statistic

Using the Central Limit Theorem for Larger Groups

To test larger groups we use the Central Limit Theorem. The means tend to be normally distributed as the sample size grows. Thus, we can expect the sums to be normally distributed since the sample size is constant. All we need to know is the expected value (the mean), and the standard deviation to use a normal distribution in order to find the P-value.

For groups 1 and 2, with corresponding rank sums, T1 and T2,

1 2( ) ( 1) / 2i iE T n n n 1 2 1 2( ) ( 1) /12iVar T n n n n

[ 1 2]i or

Page 6: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-6

23.2 The Wilcoxon Rank-Sum/Mann-Whitney Statistic

When to Use the Wilcoxon/Mann-Whitney Test• Use when data consists of grades or ordered categories• These tests can also be used to replace numeric data with ranks when there is a possibility of extreme outliers, which would affect other tests. • With quantitative data the Wilcoxon/Mann-Whitney only has about 95% of the power of a corresponding two sample t-test • Using these tests simply to ignore outliers is a bad idea. Outliers are interesting in their own right and ignoring them may result in missing an important fact or instance.

Page 7: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-7

23.2 The Wilcoxon Rank-Sum/Mann-Whitney Statistic

Assumptions and Conditions

Nonparametric methods do not require assumptions about distributions. However, we still have some assumptions about the structure of the data:

Independence Assumption. The data values are mutually independent. Appropriate randomization in data collection is one way to accomplish this.

Independent Groups Assumption. The two groups must be independent of each other.

Page 8: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-8

23.2 The Wilcoxon Rank-Sum/Mann-Whitney Statistic

Assumptions and Conditions

The hypotheses may seem kind of vague. But it’s a feature of the method that it doesn’t test properties of any population parameter. That’s what makes it a nonparametric method.

Page 9: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-9

23.3 Kruskal-Wallace Test

The Kruskal-Wallace test is a nonparametric method used in hypothesis testing.

To perform this test first rank all the data values together, assigning average ranks to tied values. Then sum up these ranks for each group and calculate H with the following formula where the Ti are the rank sums for each group, and N is the total number of values.

2123( 1)

( 1)i

i

TH N

N N n

Page 10: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-10

23.3 Kruskal-Wallace Test

The Kruskal-Wallace test uses the chi-square distribution denoted with degrees of freedom and significants level .

The test says to reject the null hypothesis “H0: all populations are identical,” if

21,k 1k

21,kH

Page 11: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-11

23.4 Paired Data: The Wilcoxon Signed-Rank Test

1) Find the difference between each set of paired data.2) Remove the tied data pairs (pairs with zero difference).3) Using the new count of cases, rank the absolute values of the

differences.4) Sum the ranks of the positive differences (T+) and the

negative differences (T-).5) Use the smaller of the T-values as the test statistic. Compare

this value with a table of critical values to determine if we can reject the null hypothesis that there is no difference between the two groups.

The Wilcoxon Signed-Rank Test is a nonparametric method suitable for paired data. To use the test follow these steps:

Page 12: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-12

23.4 Paired Data: The Wilcoxon Signed-Rank Test

a) A panel of consumers comparing the ratings of a new soda formula on a 5-point Likert scale to the ratings of a competitor's similar new formula on the same scale

b) Judging whether the height of the water, at high tide, at a marina increases more or less consistently as the phases of the moon change

Appropriate

Not Appropriate

Example:

For which of the following situations would a Wilcoxon Signed Rank Test be appropriate?

Page 13: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-13

23.5 *Friedman Test for a Randomized Block Design

1) Rank the data separately within each block.

2) Sum the ranks for each treatment and denote the sums Ti, where i is the index for each treatment.

3) Use the formula where b is the

number of blocks and k is the number of treatment to

determine the test statistic.

2123 ( 1)

( 1) iF T b kbk k

The Friedman Test is a nonparametric alternative for ANOVA and is essentially a generalization of the Wilcoxon Signed-Rank test for block designs. To use this test complete the following:

Page 14: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-14

23.5 *Friedman Test for a Randomized Block Design

The null hypothesis for a Friedman Test is H0: All the treatments are identical. With an alternative hypothesis of Ha: at least one of the treatments is different.

We reject the null hypothesis at the approximate significance level if:

We use chi-squared ( ) distribution for an approximate result. There are tables of exact critical values available for a small sample size, but this approximation works well for most cases.

2

1,kF 2

Page 15: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-15

23.6 Kendall’s Tau: Measuring Monotonicity

A consistent trend is called monotone. Kendall’s Tau ( ) measures monotonicity directly by recording whether the slope between two paired points is positive, negative, or zero. In a monotone plot all the paired points will be positive or all will be negative.

Tau is computed with the following formula and can take on values between and . nc is the number of points with a positive slope between them, nd is the number of points with a negative slope between them, and n is the total number of points.

1.0 1.0

12 ( 1)c dn n

n n

Page 16: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-16

23.7 Spearman’s Rho

Spearman’s Rho is a correlation coefficient that uses ranks to deal with violations of the Linearity Condition, or outliers and bends. When using this coefficient first rank both the x- and y-variable separately from lowest to highest. If a scatter plot of the original data shows a trend, ranking the data will show a similar trend if the original trend was linear. Spearman’s Rho must be between and . Because this is a correlation coefficient, we use the standard linear correlation coefficient formula with ranks to find rho ( ).

1.0 1.0

2 2

( )( )

( ) ( )

x x y y

x x y y

Page 17: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-17

23.7 Spearman’s Rho

Spearman’s Rho has advantages over the correlation coefficient r in that it can be used when only the ranks of the data are known.

Also, the Spearman’s Rho coefficient can be used to measure the consistency of a trend without insisting that the trend be linear. When ranking the data, linear trends remain linear and curved trends take on a linear form.

Data containing outliers does not affect the Spearman’s Rho, since the values used are ranks.

Page 18: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-18

23.7 Spearman’s Rho

a) A panel of teenage tasters and a panel of adult tasters comparing the sweetness of a diet drink (rated from 1 to 10)

b) Estimating the association between the value of used cars and their age on a lot where there is known to be some high-end classic cars

Not appropriate, this data set would not contain a trend.

Appropriate, this data would have a clear nonlinear trend with possible outliers.

Example:

For which of the following situations would Spearman’s Rho be appropriate?

Page 19: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-19

23.7 When Should You Use Nonparametric Methods?

• Nonparametric methods are particularly valuable when your data contain only information about order. • They are useful with quantitative data when the variables violate one or more of our assumptions and conditions. • Transferring quantitative values to ranks protects us from the influence of outliers, multi-modal distributions, skewed distributions, and nonlinear relationships. • Be careful using nonparametric methods when you don’t have to since they are less powerful than corresponding parametric methods. Also features such as outliers, multiple modes, skews, and nonlinear relationships are important features of the data, and should not be ignored.

Page 20: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-20

• Don’t forget to check independence. The assumption that the cases are independent is especially important when P-values and critical values are determined by probability calculations, based on the assumption that all orderings are equally likely.

• Don’t degrade your data unnecessarily. If you have quantitative data that satisfy the assumptions and conditions of statistics methods such as t-tests, correlation, regression, and ANOVA, you are generally better off using those methods rather than the corresponding nonparametric methods.

Page 21: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-21

What Have We Learned?

Recognize when nonparametric methods may be appropriate. • Data recorded as ranks without units can usually be best

analyzed with nonparametric methods. • Data with unusual distributions or for which we can’t

reasonably make the assumptions about the distribution, as required by parametric methods, call for distribution-free (nonparametric) methods.

• Situations in which the question being asked is best answered by a nonparametric method.

The Wilcoxon Rank-Sum Statistic, also called the Mann-Whitney statistic, tests whether two independent groups have the same or different typical ranks for some variable.

Page 22: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-22

What Have We Learned?

The Kruskal-Wallace Test compares three or more groups.

The Wilcoxon Signed-Rank Test is appropriate for paired data.

Kendall’s Tau measures the degree on monotonicity in the relationship between two variables.• It can be applied to two quantitative variables if the question of

interest is about monotonicity—and especially if we suspect, or know that the linearity assumption, required by regression, and Pearson correlation is not satisfied.

• It can be applied to rank data, where it is not appropriate to apply least squares methods at all.

Page 23: Copyright © 2012 Pearson Education. Chapter 23 Nonparametric Methods

Copyright © 2012 Pearson Education. 23-23

What Have We Learned?

Spearman’s Rho measures the correlation between the ranks of two variables.

• It can be used even when the relationship is not linear, or when outliers are present in either variable.

• It can be used when one or both variables consist of ranks.