Chapter 19 Nonparametric Statistics
Nonparametric Statistics This chapter deals with statistical techniques that deal with ordinal data. Ordinal data is the result of a rating system such as Excellent, good, fair, and poor W can record the responses using any numbering system as long as the order is maintained. For example, Excellent = 4 Good = 3 Fair = 2 Poor = 1
Ordinal Data… or Excellent = 85 Good = 40 Fair = 25 Poor = 10 Both numbering systems are valid.
Ordinal Data… The difference between interval and ordinal data is that with interval data the differences are meaningful and consistent. With ordinal data the differences between values has no meaning. For example, what is the difference between Excellent and Good. Is it 4-3 = 1 ? or 85-40 = 45 ? The answer is neither. All we can say about the difference between Excellent and Good is that Excellent is ranked higher. We cannot interpret the magnitude of the difference.
Nonparametric Statistics When the data are ordinal, the mean is not an appropriate measure of central location. Instead, we will test characteristics of populations without referring to specific parameters, hence the term nonparametric. Although nonparametric methods are designed to test ordinal data, they have another area of application. The statistical tests described in Sections 13.1 and 13.3 and in Chapter 14 require that the populations be normally distributed.
Nonparametric Statistics If the data are extremely nonnormal, the t-tests and F-test are invalid. Nonparametric techniques can be used instead. For this reason, nonparametric procedures are often (perhaps more accurately) called distribution-free statistics.
Nonparametric Statistics In such circumstances we will treat the interval data as if they were ordinal. For this reason, even when the data are interval and the mean is the appropriate measure of location, we will choose instead to test population locations.
Population Locations These two populations have the same location… population 1 population 2
Population Locations The location of pop’n 1 is to the left of the location of pop’n 2… The location of pop’n 1 is to the right of the location of pop’n 2… population 1 population 2 population 2 population 1
Problem Objectives When the problem objective is to compare two populations the null hypothesis will state: H0: The two population locations are the same. The alternative hypothesis can take on any one of the following three forms: u H1: The location of population 1 is different from the location of population 2 v H1: The location of population 1 is to the right of the location of population 2 w H1: The location of population 1 is to the left of the location of population 2
The Alternative Hypotheses u H1: The location of population 1 is different from the location of population 2 Used when we want to know whether there is sufficient evidence to infer that there is a difference between the two populations.
The Alternative Hypotheses v H1: The location of population 1 is to the right of the location of population 2 • Used when we want to know whether we can conclude that the random variable in population 1 is larger in general than the random variable in population 2, and, not surprisingly…
The Alternative Hypotheses w H1: The location of population 1 is to the left of the location of population 2 • Used when we want to know whether we can conclude that the random variable in population 1 is smaller in general than the random variable in population 2. NOTE: all of our hypotheses are phrased in terms of “1 then 2”. This is for consistency. Rather than state: H1: The location of population 2 is to the left of the location of population 2, we would want to phrase this as: H1: The location of population 1 is to the right of the location of population 2
Wilcoxon Rank Sum Test We’ll use the Wilcoxon Rank Sum Test for problems where: — Problem objective is to compare two populations, — The data are ordinal or interval (where the normality requirement is unsatisfied) — The samples are independent.
Example 19.1 From these samples: u: 22, 23, 20 v: 18, 27, 26 Can we conclude (at 5% significance level) that the location of population 1 is to the left (i.e. “smaller”) that the location of population 2? That is, we want to test: H0: The two population locations are the same. H1: The location of population 1 is to the left of the location of population 2. We can test this, we just need a test statistic…
Test Statistic Step #1… rank the observations from smallest to largest, assign a rank number, and add up the “rank sum”… *in the case of “ties” we average the ranks of the tied observations. We arbitrarily select T1 as the test statistic and label it “T”
Sampling Distribution of the Test Statistic A small value of T indicates most of the smaller observations are in sample 1 which was drawn from population 1 — but how small is “small”? Is 9 “small” enough? We have our test statistic, T=9. We need to compare it to some critical value of “T” to know if we’re in the rejection region for H0 (or not). So, what then, does the sampling distribution of “ranks” look like?
Sampling Distribution of the Test Statistic We can build up the sampling distribution of the test statistic in much the same way we we built histograms for the outcomes of rolls of 2 and 3 dice… j Enumerate all possible combinations of ranks k Calculate ranks sums for the combinations l The probability of any rank sum is the number of occurrences divided by the total number of combinations…
Sampling Distribution of the Test Statistic • Enumerate & k Calculate & l Probabilities… 1 combination 3 combinations Total of 20 combinations
Sampling Distribution of the Test Statistic 5% X P(T≤6) = 1/20 = .05 Thus our critical value of T is 6 Since T=9 < TCritical=6, we cannot reject H0…
Example 19.1… INTERPRET We cannot reject the null hypothesis, that is, there is not enough evidence to conclude that the location of population 1 is located to the left of population 2 (at 5% significance).
Critical Values: Wilcoxon Rank Sum Test Sample sizes less than 10 are unrealistic. For sample sizes larger than 10, the test statistic is approximately normally distributed with: Mean: Hence: Standard Deviation: ni=size of sample i, i=1,2
Example 19.2 A pharmaceutical company is planning to introduce a new painkiller. In a preliminary experiment to determine its effectiveness, 30 people were randomly selected, of whom 15 were given the new painkiller and 15 were given aspirin. All 30 were told to use the drug when headaches or other minor pains occurred and to indicate which of the following statements most accurately represented the effectiveness of the drug they took. 5 = The drug was extremely effective. 4 = The drug was quite effective. 3 = The drug was somewhat effective. 2 = The drug was slightly effective. 1 = The drug was not at all effective.
Example 19.2 The responses are listed here (and stored in Xm19-02) using the codes. Can we conclude at the 5% significance level that the new painkiller is perceived to be more effective? New painkiller: 3, 5, 4, 3, 2, 5, 1, 4, 5, 3, 3, 5, 5, 5, 4 Aspirin: 4, 1, 3, 2, 4, 1, 3, 4, 2, 2, 2, 4, 3, 4, 5
Example 19.2 IDENTIFY The problem objective is to compare two populations. The data are ordinal and the samples are independent. The appropriate technique is the Wilcoxon rank sum test. Its important to note here that “5” is a “good” score, so if the drug is effective, we’d likely see its location “greater than” the location of aspirin users, hence: H1: The location of population 1 is to the right of the location of population 2, and so: H0: The two population locations are the same.
Example 19.2 COMPUTE (though not shown here) The rank sum for the new painkiller is T1=276.5, and the rank sum for aspirin: T2=188.5 Set T= T1=276.5, and begin calculating…
Example 19.2 COMPUTE The p-value of the test is: p-value = P(Z > 1.83) = .5 - .4664 = .0336 (or Z=1.83 > Zα = Z.05 =1.645), hence: “There is sufficient evidence to infer that the new painkiller is perceived to be more effective than aspirin”
Example 19.2 COMPUTE We can use the Wilcoxon Rank Sum Test in the Data Analysis Plus set of tools to come to the same conclusion. Click Add-Ins, Data Analysis Plus, Wilcoxon Rank Sum Test.
Example 19.2 COMPUTE p-value
Example 19.2 INTERPRET There is enough evidence to infer that the new painkiller is more effective than aspirin.
Required Conditions The Wilcoxon rank sum test actually tests to determine whether the population distributions are identical. This means that it tests not only for identical locations, but for identical spreads (variances) and shapes (distributions) as well. The rejection of the null hypothesis may be due instead to a difference in distribution shapes and/or spreads. To avoid this problem, we will require that the two probability distributions be identical except with respect to location.
Identifying Factors Factors that identify the Wilcoxon Rank Sum…
Tests for Matched Pairs Experiments We will now look at two nonparametric techniques (Sign Test and Wilcoxon Signed Rank Sum Test) that test hypotheses in problems with the following characteristics: — We want to compare two populations, — The data are either ordinal or interval (nonnormal), — and the samples are matched pairs. As before, we’ll compute matched pair differences and work from there…
The Sign Test We can use the Sign Test when we’re dealing with two populations of ordinal data in a matched pairs experiment. For each matched pair, take the differences and count up the number of positive differences and negative differences. If population locations are the same (say), we’d expect the number of positives and negatives to net out to zero. If we have more positives than negatives (or vice versa) what can we learn? Again, how many is enough to make a difference?
Sign Test We can think of the sign test in terms of a binomial experiment, getting a positive sign is like flipping heads on a coin. We use this notion along with previously developed statistics to come up with our standardized test statistic (assuming the null hypothesis is true): Our null hypothesis: H0: the two population locations are the same is equivalent to: H0: p = .5 (i.e. equal proportions of +’s & –’s) n≥10
Sign Test Hypotheses Since our null hypothesis is: H0: the two population locations are the same (i.e. p = .5) Our research hypothesis must be: H1: the two population locations are different which is the same as: H1: p ≠ .5
Example 19.3 In an experiment to determine which of two cars is perceived to have the more comfortable ride, 25 people rode (separately) in the back seat of an expensive European model and also in the back seat of a North American midsize car. Each of the 25 people was asked to rate the ride on the following 5-point scale. 1 = Ride is very uncomfortable. 2 = Ride is quite uncomfortable. 3 = Ride is neither uncomfortable nor comfortable. 4 = Ride is quite comfortable. 5 = Ride is very comfortable. The results are stored in Xm19-03. Do these data allow us to conclude at the 5% significance level that the European car is perceived to be more comfortable than the North American car?
Example 19.3 IDENTIFY The problem objective is to compare two populations. The data are ordinal and the experimental design is matched pairs. Thus the correct technique is the sign test. Because we want to whether there is enough evidence to infer that the European car is perceived to have a smoother ride than the North American car the hypotheses are H0 :The two population locations are the same. H1 : The location of population 1 (European car rating) is to the right of the location of population 2 (North American car rating)
Example 19.3 COMPUTE Again, we can leverage Excel to reduce the amount of work that we have to do.Click Add-Ins, Data Analysis Plus, Sign Test.
Example 19.3 COMPUTE p-value
Example 19.3 INTERPRET There is enough evidence to infer that the European car is perceived to have a smoother ride than the North American car the hypotheses are
Checking the Required Conditions The sign test requires: The populations be similar in shape and spread: The sample size exceeds 10 (n=23).
Wilcoxon Signed Rank Sum Test We’ll use Wilcoxon Signed Rank Sum test when we want to compare two populations of interval (but not normally distributed) date in a matched pairs type experiment. j Compute paired differences, discard zeros. k Rank absolute values of differences smallest (1) to largest (n), averaging ranks of tied observations. l Sum the ranks of positive differences (T+) and of negative differences (T–). m Use T=T+ as our test statistic…
Wilcoxon Signed Rank Sum Test Now we have a test statistic, but what to compare it against? For large sample sizes, i.e. n > 30, T is approximately normally distributed, so we have:
Example 19.4 Traffic congestion on roads and highways costs industry billions of dollars annually as workers struggle to get to and from work. Several suggestions have been made about how to improve this situation, one of which is called flextime, which involves allowing workers to determine their own schedules (provided they work a full shift). Such workers will likely choose an arrival and departure time to avoid rush-hour traffic.
Example 19.4 In a preliminary experiment designed to investigate such a program the general manager of a large company wanted to compare the times it took workers to travel from their homes to work at 8:00 A.M. with travel time under the flextime program. A random sample of 32 workers was selected. The employees recorded the time (in minutes) it took to arrive at work at 8:00 A.M. on Wednesday of one week. The following week, the same employees arrived at work at times of their own choosing. The travel time on Wednesday of that week was recorded.
Example 19.4 These results are listed in the Xm19-04. Can we conclude at the 5% significance level that travel times under the flextime program are different from travel times to arrive at work at 8:00 A.M.?
Example 19.4 IDENTIFY The problem objective is to compare two populations. The data are interval and the samples are matched. If the matched pairs differences are normally distributed the correct method is the t-test of µD. Here is the histogram of the differences. .
Example 19.4 IDENTIFY A histogram of the paired differences reveals a non-normal distribution, hence we must use a non-parametric technique.
Example 19.4 IDENTIFY The appropriate technique is the Wilcoxon signed rank sum test. Because we want to know whether the population locations differ we have H0: The two population locations are the same. H1: The two population locations are different This is a two-tail test.