nonparametric statistics - home | calhoun...

33
NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were parametric tests. They generally required a normal distribution, equal variances and used parameters such as the mean, standard deviation, and the proportion. The processes were usually restricted to interval or ratio data. There were few tests for nonnormal or ordinal data. The restrictions were fairly tight and the statistical approaches might not give good results if the restrictions were not met. Not everything in nature, life or business nicely conforms to a normal distribution. Data is not restricted to interval and ratio types. To handle the nonnormal distributions and other data types, a different statistical approach is required, the nonparametric statistics. Nonparametric statistics do not have the restrictions that parametric statistics have. The requirement that data come from a normal distribution is gone. In fact, nonparametric statistics do not require that data come from any specific distribution. The techniques can also be used on nominal and ordinal data. If you are not sure about the population distribution, if variances are not equal, or you do not have interval or ratio data, you should use the nonparametric statistics applications. ADVANTAGES OF NONPARAMETRIC STATISTICS 1) There are fewer assumptions about the underlying population 2) You may use very small sample sizes, minimum sizes generally do not apply 3) You may test nominal or ordinal data 4) You will find the calculations by hand to be much simpler than the parametric statistics 5) You may perform tests using the median of the data DISADVANTAGES OF NONPARAMETRIC STATISTICS 1) The data tends to be used less efficiently – the raw data often is not used in the actual statistical calculations 2) The power (the ability to detect a false null hypothesis) is lower 3) There is often a greater dependence on statistical tables or more sophisticated software

Upload: vantu

Post on 10-Mar-2018

233 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

NONPARAMETRIC STATISTICS  In previous chapters, the inferential statistics tests were parametric tests.  They generally required a normal distribution, equal variances and used parameters such as the mean, standard deviation, and the proportion. The processes were usually restricted to interval or ratio data.  There were few tests for non‐normal or ordinal data. The restrictions were fairly tight and the statistical approaches might not give good results if the restrictions were not met.  Not everything in nature, life or business nicely conforms to a normal distribution.  Data is not restricted to interval and ratio types.  To handle the non‐normal distributions and other data types,  a different statistical approach is required, the nonparametric statistics.  Nonparametric statistics do not have the restrictions that parametric statistics have.  The requirement that data come from a normal distribution is gone.  In fact, nonparametric statistics do not require that data come from any specific distribution.  The techniques can also be used on nominal and ordinal data.  If you are not sure about the population distribution, if variances are not equal, or you do not have interval or ratio data, you should use the nonparametric statistics applications.  ADVANTAGES OF NONPARAMETRIC STATISTICS 

1) There are fewer assumptions about the underlying population 2) You may use very small sample sizes, minimum sizes generally do not apply 3) You may test nominal or ordinal data 4) You will find the calculations by hand to be much simpler than the parametric statistics 5) You may perform tests using the median of the data 

 DISADVANTAGES OF NONPARAMETRIC STATISTICS 

1) The data tends to be used less efficiently – the raw data often is not used in the actual statistical calculations 

2) The power (the ability to detect a false null hypothesis) is lower 3) There is often a greater dependence on statistical tables or more sophisticated software 

   

Page 2: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

THE WILCOXON FAMILY OF STATISTICAL TESTS  There are several statistical tests in the Wilcoxon family of tests:  the signed rank test for one sample, the signed rank test for comparing paired samples, and the rank sum test for comparing two independent samples.  The last test is often called the Mann‐Whitney‐Wilcoxon test.  These tests are the nonparametric equivalent to the parametric  t‐tests.  Extensions to the Wilcoxon tests are the nonparametric equivalents to the parametric Analysis of Variance.    THE SIGNED RANK TEST FOR ONE SAMPLE  The question being asked in the signed rank test for one sample is whether or not the data could have come from a population with the hypothesized median.  It requires the data be interval or ratio and assumes continuous data.  If you do not have interval or ratio data, you should use the sign test, to be addressed later.  This is the nonparametric equivalent to the parametric one‐sample t test.  The general hypotheses are as follow:  H0:  The data came from a population with the hypothesized median  (m₁ = m₂) H1:  The data did not come from a population with the hypothesized median (m₁ ≠ m₂)  As with parametric statistics, you may do one‐tailed tests to the left or to the right.  The examples in this document will all use the two‐tailed test, with α = 0.05 unless otherwise stated.  Procedure  

1)  Calculate the difference between the observed value and the hypothesized mean.  –  

2) Ignoring zeros, rank the absolute values of  from low to high, with the lowest value having rank 1.  If there is a tie, average the ranks the values would hold.  (If two data items would be in rank 2 and 3, then use the average rank of 2.5 for both values.) 

3) If the value of   is greater than the hypothesized median, put the rank of that item in the plus (+)  column, otherwise put the rank in the minus  (‐) column. 

4) Your calculated value, W, is the sum of the ranks in the plus column.   5) Compare your calculated W to the critical values in Table 2  .  If W is less than the lower value or 

greater than the upper value, reject the null hypothesis.  With a one‐tailed test, use the appropriate lower or higher value in the test. 

   

Page 3: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

If the number of observations for which   is nonzero is greater than 20, you may use the normal approximation.  The W distribution approaches a normal curve as n becomes larger.  The z‐test approximation for the test is  

1

41 2 124

 

 W is the sum of the R+ ranks and n is the number of observations where   ≠ 0  

EXAMPLE ONE  You are given the following sample data.  Is it likely the data came from a population whose  median = 4.9?  H0:  median = 4.9 H1:  median ≠ 4.9  Observed  d (= x‐4.9)   |d|  rank  R+  R‐  2.9    ‐2.0    2.0  7    7 2.7    ‐2.2    2.2  8    8 5.2     .3    .3  2  2 5.3     .4    .4  3.5  3.5 4.5    ‐.4    .4  3.5    3.5 3.2    ‐1.7    1.7  5    5 3.1    ‐1.8    1.8  6    6 4.8    ‐.1    .1  1  ___  1             5.5  30.5         W = ∑R+  =   5.5     As a check to ensure you used the proper number of rankings, you can sum the R+ and R‐ values.  Their sum should equal the sum of all of the rankings  n(n+1)/2.  In this problem, the sum of R+ and R‐ is 36, n = 8, and 8(9)/2 = 36.  Using Table 2  , with n = 8, we find the critical values are 4 and 32.  Since our calculated W = 5.5 is within the critical values, we would fail to reject the null hypothesis.  There is not enough statistical evidence to indicate the sample did not come from a population with a median = 4.9     

Page 4: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

EXAMPLE TWO  Given the following sample data, is it likely the sample came from a population whose median is 6?  H0:  median = 6 H1:  median ≠ 6      Observed  d(=x‐6)    |d|  rank  R+  R‐   5    ‐1    1  2    2   8     2    2  4.5  4.5   4    ‐2    2  4.5    4.5   6     0    0  ignore   7     1    1  2  2   9     3    3  6.5  6.5   3    ‐3    3  6.5    6.5   5    ‐1    1  2    2   6      0    0  ignore   ___        ___               13  15         W= R+ = 13  The sum of R+ and R‐  equals 28, n =7 (only the non‐zero differences are counted), and 7(8)/2 = 28. We have used the correct number of ranks.  Using Table 2, with n=7, we find the critical values of 3,25.  Since the calculated W = 13, within the range of the critical values, we fail to reject the null hypothesis.  There is not enough statistical evidence to indicate that the sample did not come from a population with a median = 6.  Note in both examples that the original values were used only to get differences and those differences were what we used to calculate our results.  The original values were not actually used in the test.  This is a characteristic of many of the nonparametric statistical applications.  Exercises  1.   Given the following sample data, could it have come from a population whose median = 5.67?  

Use α = 0.05  

5.703  5.750  5.705  5.594  5.725  5.611  5.616  5.600  5.779  5.684  2.  The following temperatures were observed on successive Mondays.  Could the median 

temperature for the observed period be 83?  α = .05      75  81  81  77  83  89  79  86  84 

Page 5: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

THE SIGNED RANK TEST FOR COMPARING TWO PAIRED SAMPLES  The purpose of this test is to determine if the medians of two paired samples are equal.  The test assumes interval or ratio, continuous data.  It works by testing the differences of the matched scores and is the equivalent of the parametric t test for paired samples.  The test is similar to the signed rank test for single samples; the difference is you are testing the difference of two matched scores, rather than the difference between a score and a median.  We are interested in the differences between paired observations,  .     The general hypotheses are  H0:  median of the population differences = 0 H1:   median of the population differences ≠ 0  As with parametric tests, you may do one‐tail tests to the left or to the right.  Procedure 

1) Calculate the differences between each pair of matched scores,   . 2) Ignoring zeros, rank the absolute values of  from low to high, with the lowest value having 

rank 1.  If there is a tie, average the ranks the values would hold.  (If two data items would be in rank 2 and 3, then use the average rank of 2.5 for both values.) 

3) If the value of   is greater than the hypothesized median, put the rank of that item in the R plus (R+)  column, otherwise put the rank in the minus column (R‐). 

4) The calculated value, W, is the sum of the ranks in the plus column.   5) Compare the calculated W to the critical values in Table 2.  If W is less than the lower value or 

greater than the upper value, reject the null hypothesis.  With a one‐tailed test, use the appropriate lower or higher value in the test. 

 If the number of observations for which   is nonzero is greater than 20, you may use the normal approximation.  The W distribution approaches a normal curve as n becomes larger.  The z‐test approximation for the test is  

1

41 2 124

 

 W is the sum of the R+ ranks and n is the number of observations where   ≠ 0    

Page 6: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

EXAMPLE ONE  Given the following sample data of matched pairs, is the median of the population differences = 0?   Use α = .10  H0:  the population median of the differences = 0 H1:   the population median of the differences ≠ 0  

  x  y  d  |d|  rank  R+  R‐   12.5  12.7  ‐.2  .2  2.5    2.5   11.2  11.2    0   (ignore)   14.4  15.6  ‐1.2  1.2  8    8   8.9  8.7  .2  .2  2.5  2.5   10.5  11.8  ‐1.3  1.3  9    9   12.3  12.2  .1  .1  1  1   11.8  11.3  .5  .5  5  5   12.4  13.4  ‐1.0  1.0  7    7   13.9  14.4  ‐.5  .5  5    5   8.8  8.3  .5  .5  5  5  __             13.5  31.5       W = ∑R+ = 13.5  

The sum of R+ and R‐ is 45; n = 9 (nonzero differences, remember), 9(10)/2 = 45. We have used the correct number of ranks.  Using Table 2, with n = 9 and α = .10, we find the critical values to be 9,36.  Since the calculated W = 13.5 is within the range of critical values, we fail to reject the null hypothesis.  There is not enough statistical evidence to indicate the median of the population differences is not zero.    

Page 7: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

EXAMPLE TWO  Given the following paired samples, can we say the median of the population differences is 0?  H0:  the population median of the differences = 0 H1:   the population median of the differences ≠ 0      x  y  d  |d|  rank  R+  R‐     4  6  ‐2  2  4    4     10  9  1  1  1.5  1.5     12  11  1  1  1.5  1.5     9  12  ‐3  3  6    6     2  4  ‐2  2  4    4     7  9  ‐2  2  4    4     16  10  6  6  7  7  __               10  18         W = ∑R+ = 10  The sum of R+ and R‐ is 28; n = 7, 7(8)/2 = 28.  We have used the proper number of rankings.  Using Table 2, with n = 7, the critical values are3,25.  The calculated W is within the range of critical values, so we fail to reject the null hypothesis.  There is not enough statistical evidence to indicate the median of the population differences is not zero.     Exercises  3.  Given the following paired samples, does the median difference = 0?  α = 0.05.  

X:  12.5  11.2  14.4  8.9  10.5  12.3  11.8  12.4  13.9  8.8 Y:  12.7  11.2  15.6  8.7  11.8  12.2  11.3  13.4  14.4  8.3 

  4.  Two students recorded their daily study time in preparing for a mid‐term exam.  At α = 0.05, is 

the median difference = 0?  

A:  25  30  15  20  30  18  22  45  30 B:  30  20  15  25  28  25  10  40  35 

   

Page 8: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

RANK SUM TEST FOR COMPARING TWO INDEPENDENT SAMPLES   This test compares the medians of two independent samples to determine if the samples could have come from populations with equal medians.  It is the nonparametric equivalent to the parametric pooled‐variance t test for independent samples.  The independent sample test works by ranking the  data as one big sample, then calculates the sum of the rankings for the smaller sample.  The test assumes at least ordinal data, with independent samples randomly selected.  It also  assumes the populations have approximately the same shape.  If you are not sure the data is interval or ratio, or cannot assume normal populations with equal variances, you should use the Wilcoxon test.  Sample sizes do not have to be equal.  We are interested in whether or not the populations from which the samples came have equal medians.  The general hypotheses are  H0:  median median  H1:  median median   As with parametric tests, you may do a one‐tail test to the left or to the right.  Procedure  

1)  Identify the smaller sample as sample one.  If the sample sizes are the same, you may select either sample to be sample one. 

2) Rank the combined data values as one large sample, keeping each sample’s ranks separate, from low to high, with the lowest value having rank 1.  If there is a tie, average the ranks the values would hold.  (If two data items would be in rank 2 and 3, then use the average rank of 2.5 for both values.) 

3) List the ranks from sample one under R1, the other sample under R2.    4) The test statistic, W is the sum of R1. 5) Compare the calculated W to the critical values in Table 3.  If W is less than the lower value or 

greater than the upper value, reject the null hypothesis.  With a one‐tailed test, use the appropriate lower or higher value in the test. 

 If both sample sizes are ≥ 10, you may use the normal approximation for W:  

12

112

 

 W is the sum of R1,   is the size of sample one,   is the size of sample two and   . 

Page 9: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

 EXAMPLE ONE 

 Given the following independent samples, could the samples have come from populations with the same median?  H0:  the population medians are equal H1:  the population medians are not equal  x1  rank1  x2  rank2  4  5.5  3  3      Rank the data values as though they were one large 6  8  7  9.5      sample.  List the ranks under each sample. 7  9.5  8  12 5  7  2  1 3  3  4  5.5      W = the sum of the smaller sample’s ranks (sample one) 8  12  3  3   __  8  12   45    46  Since the first sample, x1, has the smaller sample size, designate it as sample one and use its total in the statistical test.  Using Table 3, locate   across the top of the table and   down the left side.  Their intersection contains the critical value.  The critical values for this problem are 28,56.  Since the calculated W = 45 falls between the critical values, we cannot reject the null hypothesis.  There is not enough statistical evidence to indicate the population medians are not equal.    

Page 10: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

EXAMPLE TWO  Given the following data from two independent samples, is it likely the samples came from populations with the same median?  H0:  the population medians are equal H1:  the population medians are not equal  X1  Rank1  X2  Rank2 40  9  29  4.5      Rank the data values as though they were one large 34  8  31  6.5      sample.  Record the sample ranks separately.     53  12  52  11 28  3  29  4.5 41  10  20  1      W is the sum of the smaller sample’s ranks.     31  6.5   __  26  2   42    36  Since X1 is the smaller sample, designate it as sample one and use its total ranks in the test.  In Table 3, locate the two sample sizes and find the critical values are 20,45.  Since the calculated W = 42 is within the range of the critical values, we fail to reject the null hypothesis.  There is not enough statistical evidence to indicate the population medians are not equal.  Remember that if the sample sizes are the same, you may use either sample as Sample one.  In that case, the n’s are the same and you would locate their intersection as above.    Exercises  5.  Following are two random samples from two populations.  Could the populations have the same 

median?  Use α = 0.05.  

A.  47.5  43.2  40.7  46.8  43.2  49.0 B.  44.6  43.9  47.8  40.5  46.8  49.0  48.3  47.9 

 6.  Following are grades from two classes on a quiz, randomly selected.  Is the median the same for 

both classes?  Use α = 0.05.  

A.  75  81  76  82  85  98  78  83  70  90 B.  78  70  85  86  90  88 

 

Page 11: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

KRUSKAL‐WALLIS  TEST  The Kruskal‐Wallis test is an extension of the Wilcoxon tests and is used to compare more than two independent samples.  It is the nonparametric equivalent of the parametric fully randomized one‐way Analysis of Variance.  It makes no assumption about the shape of the distribution, nor does it require equal variances.  The data must be of at least ordinal type and the samples are assumed to be randomly selected.  The test ranks all of the scores as though they formed one large sample.  The ranks of the samples are then summed.  The sum is approximately chi‐square when each sample size is at least five.  If any sample size is less than five, special tables or a statistics software package is needed.  Sample sizes do not need to be equal.  We are interested in whether or not the samples came from populations whose medians are equal.  The general hypotheses are  H0:  The medians of the populations are equal     (or  ) H1:  At least one median differs  Procedure  

1) Rank the combined data values as one large sample, keeping each sample’s ranks separate, from low to high, with the lowest value having rank 1.  If there is a tie, average the ranks the values would hold.  (If two data items would be in rank 2 and 3, then use the average rank of 2.5 for both values.) 

2) Sum the ranks of each sample, forming ∑ , ∑ , ∑ , etc. 3) Calculate the test statistic, H, as follows: 

 

∑ ∑ ∑] – 3(n+1) 

 4) Using the chi‐square table, with k‐1 degrees of freedom, compare the calculated H with the 

critical value of χ².     

Page 12: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

EXAMPLE ONE  Given the following data from four samples, S1 – S4, is it likely the samples came from populations with the same median?  H0:  The medians are equal H1:  At least one median differs  

S1  R1  S2  R  S3  R3  S4  R4 10  5  9  2.5  12  9  15  16 12  9  11  7  13  11.5  16  18 13  11.5  14  13.5  17  19  9  2.5 15  16  12  9  10  5  8  1 18  20  15  16  14  13.5  20  21                22  22             10  5 Sum:  61.5    48    58    85.5   

1222 23

61.55

485

585

85.57

3 23 .5446 

 H is approximately χ², with 3 degrees of freedom.  With α = 0.05, the critical value of χ² = 7.815.  Since  H = 0.5446 < 7.815, we fail to reject the null hypothesis.  There is not enough statistical evidence to indicate the medians are not equal.    

Page 13: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

 EXAMPLE TWO  Given the following data from three samples, is it likely the samples came from populations with the equal medians?  H0:  The medians are equal H1:  At least one median differs  

S1  R1  S2  R2  S3  R3 18  11  17  8.5  20  15 14  3  15  5  12  1 15  5  20  15  16  7 20  15  13  2  18  11 19  13  17  8.5  15  5 21  17  18  11 Sum:  64    50    39 

  

1217 18

646

506

395

3 18 1.019 

 H is approximately χ², with 2 degrees of freedom.  With α = 0.05, the critical value of χ² = 5.991.  Since  H = 1.019 < 5.991, we fail to reject the null hypothesis.  There is not enough statistical evidence to indicate the medians are not equal.    

Page 14: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

EXAMPLE THREE  Given the following data from three samples, is it likely the samples came from populations with equal medians?  H0:  The medians are equal H1:  At least one median differs  

S1  R1  S2  R2  S3  R3 31.3  12  29.4  8  36.0  16 30.7  10  20.8  1  37.7  18 35.4  15  22.2  3  31.0  11 36.1  17  24.9  5  28.4  7 30.3  9  21.4  2  31.7  13 25.5  6      24.1  4 

            32.6  14 Sum:  69    19    83   

1218 19

696

195

837

3 19 7.929 

 H is approximately χ², with two degrees of freedom.  At α = 0.05, the critical value of χ² = 5.991. Since H = 7.929 > 5.991, we reject the null hypothesis.  It appears at least one median differs.  NOTE:  the test does not indicate which median(s) differ, only that at least one does differ.    

Page 15: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

Exercises  7.  Given the following data from three independent samples, is it likely they came from 

populations with the same median?  Use α = 0.05.  

Sample1  Sample2  Sample3     31.0    29.0    36.1     35.0    21.4    38.0     31.1    22.5    31.2     36.2    21.5    32.0     30.0    25.3    24.0     25.5        33.0  

8.  The following data is from four, randomly‐selected, independent populations.  Could the medians of the populations be equal?  Use α = 0.05. 

 S1  S2  S3  S4 10  12  14  14 21  18  10  20 15  22  24  17 22  19  16  22 19  23  8  9 13  16  12  11 

      11  23       

Page 16: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

FRIEDMAN TEST  The Friedman Test for the Randomized Block Design is an extension of the Wilcoxon signed rank test for paired samples.  It is the nonparametric equivalent of the parametric Randomized Block Design Analysis of Variance.  (The two‐way Analysis of Variance without replication.)  The Friedman test makes no assumptions about the shape of the distribution of the populations being tested.  It may be used for ordinal, interval, or ratio data types.  The test compares medians of treatment levels.  As in the Randomized Block Design Analysis of Variance, the subjects are first placed into homogenous groups, then subjects from each category are randomly assigned to the treatment level.   Each row represents one category; each column represents a treatment level.  There will be one value in each cell.  We are interested in comparing the medians of each treatment level to determine if the medians are statistically equal.  The general hypotheses are  H0:  The treatment had no effect H1:  The treatment had an effect  Procedure 

1) Rank the values in each row, low to high, with the lowest value having rank 1.  If there is a tie, average the ranks the values would hold.  (If two data items would be in rank 2 and 3, then use the average rank of 2.5 for both values.) 

2) Sum the ranks for each treatment level. 3) Calculate the test statistic as follows:  

121

3 1  

   Where b= number of blocks     t = number of treatment levels      = sum of the ranks for treatment level j 

 4) Using the χ² table, with t‐1 degrees of freedom, determine the critical value of χ² and compare 

the test statistic ( ) with the critical value.    

Page 17: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

EXAMPLE ONE  Given the following types of vehicles (block) and selected gas additives, is there any difference in median performance among the additives?  H0:  The additives had no effect (the medians are the same) H1:  At least one additive had an effect  (at least one median differs)      Vehicle    Add1    Add2    Add3       Compact  32    30    33     Sedan    28    25    27     SUV    24    23    26     Pickup    18    16    19     Van    20    22    21   Rank the values across each row.  If a tie, average the ranks involved.      Vehicle    Rank1    Rank2    Rank3     Compact  2    1    3     Sedan    3    1    2     SUV    2    1    3     Pickup    2    1    3     Van    1    3    2     Sum    10    7    13  

  10 7 13 3 5 4 3.6 

      is approximately χ², with 2 degrees of freedom.  At α = 0.05, the critical value of χ² = 5.991. 

Since   = 3.6 < 5.991, we fail to reject the null hypothesis.  There is not enough statistical evidence to indicate the medians are not equal.     

Page 18: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

EXAMPLE TWO  Given the following sample data with four blocks and four treatment levels, does the treatment have an effect on the median?  H0:  The medians are the same H1:  At least one median differs  Block    T1    T2    T3    T4 A    10    12    11    14 B    9    13    10    13 C    11    12    14    13 D    12    11    10    14  Rank the values across each row.  In case of ties, average the ranks involved.  Block    Rank1    Rank2    Rank3    Rank4 A    1    3    2    4 B    1    3.5    2    3.5 C    1    2    4    3 D    3    2    1    4 Sum:    6    10.5    9    14.5  

  6 10.5 9 14.5 3 4 5 5.625 

   is approximately χ², with 3 degrees of freedom.  At α = 0.05, the critical value of χ² = 7.815. 

Since   = 5.625 < 7.815, we fail to reject the null hypothesis.  There is not enough statistical evidence to indicate the medians are different.    

Page 19: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

Exercises  9.  Given the following results in comparing three treatments, can we conclude the treatments are 

equally effective?  Use α = 0.05.  

Block  T1  T2  T3 1  75  70  67 2  65  75  65 3  53  48  50 4  70  68  51 5  80  79  75 

   10.  Given the following salaries (in thousands) of teachers by discipline at several universities, can 

we say the median salaries are the same?  Use α = 0.05.  

School    Math    CompSci  Chem    History Old U    65    67    58    55 Ur U    60    58    56    50 My U    59    55    49    51 Good4 U  67    71    69    60 Who U    65    65    71    71 

   

Page 20: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

OTHER NONPARAMETRIC STATISTICAL TESTS  SIGN TEST  The sign test is similar to the Wilcoxon tests, except it is designed for ordinal data.  The sign test can be used to test the difference between a score and the hypothesized median or the difference of two scores in a paired sample test.  The first is a one‐sample test; the second is a paired (or matched‐)sample test.  The sign test is based on the binomial distribution.  If the actual median of the differences = 0, then the probability of s positive signs will be 0.5.  One‐Sample Sign Test  The question to be resolved is if the median difference between the sample values and the hypothesized median is 0.  The general hypotheses are  H0:  The median difference is zero     ( 0) H1:  The median difference is not zero    ( 0)  As with parametric tests, you may do one‐tail tests to the left or to the right.  For one‐tail tests, use the binomial probability (s ≥ T) for right‐tail and probability (s ≤ T) for a left‐tail test.  Procedure  

1)  Calculate the difference between the sample value and the hypothesized median.  Put a + or a – sign in the sign column, depending on whether the sample value is greater or less than the hypothesized median. 

2) Count the number of + and ‐ signs in the sign column.  Ignore all zero differences.  The total of the non‐zero signs is n.  The smaller of the total of the + or ‐ signs is T. 

3) Determine the p‐value from the binomial table , with p =0.5.     p‐value = Prob(s ≤ T) + Prob(s ≥ [n – T])   If p‐value < α, reject the null hypothesis.   OR (much easier) 

4) Use Table 4, Critical Values for the Sign Test.       

Page 21: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

EXAMPLE   Below are temperatures taken from a sample of patients in a clinic.  Is the median temperature 98.6?  Temp     Sign (Temp – 98.6) 98.5      ‐ 98.7      +    n = 5 98.2      ‐    T = 2 97.5      ‐ 99.1      + 98.6      0  Using the binomial table, with p = 0.5, the prob(s ≤ 2) = .0313 + .1562 + .3125 = .5000 The prob(s ≥ 3) = .5000.  The p‐value is the sum of the two tails, .5000 + .5000 = 1.0000  Since p‐value = 1.0, we fail to reject the null hypothesis.  There is not enough statistical evidence to indicate the median difference is not zero.  Using Table 4, locate n in the left column.  Using the column with your selected alpha and type of test (on‐ or two‐tail), determine the critical value.  An * means you cannot get a value in the critical region and will never reject.  The critical value is the number in the column.  This table is different, in that if the calculated T value is less than or equal to the critical value, you reject the null hypothesis.  For n = 5, α = 0.05, we find an *, therefore we fail to reject the null hypothesis.  NOTE:  For a two‐tailed test, with α = 0.05, if n is ≤ 5, you will never reject the null hypothesis.  With α = 0.01, you will not reject for n ≤ 7.     Paired Sample Sign Test  The question to be resolved is if the median difference between the paired scores = 0.  The general hypotheses are  H0:  The median difference in the scores is zero    ( 0) H1:  The median difference in the scores is not zero  ( 0)  As with parametric tests, you may do one‐tail tests to the left or to the right.  For one‐tail tests, use the binomial probability (s ≥ T) for right‐tail and probability (s ≤ T) for a left‐tail test.  

Page 22: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

Procedure 1) Calculate the difference between the paired scores:    2) If the difference is positive, put a + in the sign column; if negative, put a – in the sign column. 3) Count the number of + and ‐ signs in the sign column.  Ignore all zero differences.  The total of 

the non‐zero signs is n.  The smaller of the total of the + or ‐ signs is T. 4) Determine the p‐value from the binomial table , with p =0.5.   

  p‐value = Prob(s ≤ T) + Prob(s ≥ [n – T])   If p‐value < α, reject the null hypothesis.     OR Use Table 4, Critical Values for the Sign Test  

 EXAMPLE  Given the following results from several polls, is the median difference of opinion = 0?  H0:  The median difference equals zero.     ( 0) H1:  The median difference does not equal zero.   ( 0)  Pro  Con  Diff  Sign 20  20  0  0 19  18  1  +    n = 7 22  22  0  0    T = 3 24  25  ‐1  ‐ 17  16  1  +  16  20  ‐4  ‐ 20  18  2  + 14  12  2  + 15  17  ‐2  ‐ 18  18  0  0  Using the binomial table, with p = 0.5, prob(s ≤ 3) = .0078 + .0547 + .1641 + .2734 = .5000 The prob(s ≥4) = .2734 + .1641 + .0547 + .0078 = .5000 The p‐value = .5000 + .5000 = 1.0; therefore, we will fail to reject the null hypothesis.  There is not enough statistical evidence to indicate the median difference is not zero.  Using Table 4, with n = 7 and α = 0.05, the critical value is 0.  Since T = 3 > 0, we fail to reject the null hypothesis.   Remember, T must be ≤ critical value to reject a null hypothesis.  The sign test may also be used to test nominal data.  For example, we could test the number of male and female applicants accepted to a college to see if the proportion of genders is equal.  

Page 23: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

In all sign tests, if the number of non‐zero ≥ 10, the normal approximation to the binomial distribution may be used.  The test statistic is  

   . .. √

       

   Exercises  11.  The following sample data was randomly collected.  Could the median of the population it came from be 47?  Use α = 0.05.    50  47  65  70  25  38  41  52  54  48  46  75  12.  Selected workers were timed doing two different tasks.  Could the median difference be 0?  Use α = 0.05.  

Worker   Task1    Task2 A    25.0    24.2 B    17.0    20.6 C    21.7    18.0 D    23.5    20.6 E    37.7    42.0 F    31.2    36.2 G    15.0    22.1 H    37.2    41.1 I    17.6    25.8 

 13.  A random sample of widget failures was taken.  Could the median of widget failures be 27?   

Use α = 0.05.  

15  21  31  20  40  31  34  20       28  17  19  29  35  14.  Given the following paired and independent samples, can we say the median difference is 0?  Use α = 0.05.  

A. 10  12  11  21  12  17  18 B. 8  11  13  23  14  16  19 

  

Page 24: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

RUNS TEST FOR RANDOMNESS  The runs test for randomness evaluates a series of observations by analyzing the number of ‘runs’ it contains.  The analysis is to determine if the data is random.  A run is the consecutive appearance of one or more observations that are similar.  ‘Similar’ could be above/below the median, heads/tails, T/F, etc.  The runs test can test nominal data, as well as ordinal, interval, or ratio data.  The nominal data test is for data with two categories.  For ordinal or higher data, a median comparison is done.  Runs test for nominal data with two categories   This test will evaluate the randomness of a sequence of two observations, such as H/T, M/F, T/F, etc.  The general hypotheses are  H0:  The sequence is random H1:  The sequence is not random  Procedure 

 1) Determine the number of observations of each type,  and  . 2) Count the number of runs, T.  A run is a sequence of the same type of observation. 3) Calculate the test statistic as follows: 

 

         

  where  T = the number of  runs      = the number of observations of the first type       = the number of observations of the second type     n  = the total number of observations,            OR 

4) Use Table 5, Critical Values for Number of Runs T  

The normal approximation can be used if both   and   are ≥ 10.  If not, the table must be used.   

 Table 5, Critical Values for Number of Runs T contains the critical values for the number of runs, T.  Locate   on the left of the table and locate   at the top of the table.  Their intersection will contain the critical values, reading down.  If the total number of runs, T, is ≤ the lower value or ≥ the upper value, the null hypothesis of randomness is rejected. 

Page 25: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

EXAMPLE  While tossing a coin, an observer noted the following sequence of heads (H) and tails (T).  Was the sequence of heads and tails random?  H0:  The sequence is random H1:  The sequence is not random H  H  T  T  T  H  T  H  H  H  H  T  T  T  T  T  H  T  H  T  T  H  H  H  T  T  T  H  H  H  T  T  H  T    Count the number of H’s and T’s:        H = 16 ( )    T = 18 ( ) Count the number of runs (underlined), T:             T = 16  Using Table 5, the critical values for the number of runs are 11,25.  Since T = 16 is between the two critical values, we fail to reject the null hypothesis. It appears the sequence is random.  Since both   and    > 10, we can use the normal approximation:  

       =    =  .. = .678 < 1.96 

 Since z < 1.96, we fail to reject the null hypothesis.  There is not enough statistical evidence to indicate the sequence is not random.     Runs test for randomness of ordinal, interval, or ration data  This test is used to determine if a sequence of ordinal, interval, or ratio data is random.  It is done by comparing the values of the sample to the sample median.  A plus sign is used to indicate a value ≥ the median; a minus sign indicates a value < the median.    General Hypotheses:  H0:  The sequence is random H1:  The sequence is not random    

Page 26: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

Procedure    

1)  Determine the median of the values 2) Compare each sample value against the median.  If the value is ≥ the median, identify it with a + 

sign.  If the value is < the median, identify it with a – sign. 3) Count the number of + and – signs,   and  . 4) Count the number of runs, T 5) Determine the critical values by calculating z (as above), or using Table 5. 

  EXAMPLE  An observer interviewed persons entering a store.  Among the information collected was the age of the subject.  Given the sequence of ages observed, did the persons enter the store randomly, based on age?  H0:  The sequence is random H1:  The sequence is not random  24  18  16  28  15  15  16  18  22  25  20  15  8 30  16  17  18  22  21  22  23  31  28  The median of the above values is 20.  Identify each value with a + or ‐, depending of the comparison against the median:  +  ‐  ‐  +  ‐  ‐  ‐  ‐  +  +  +  ‐  ‐   +  ‐  ‐  ‐  +  +  +  +  +  +  Count the number of + ( ) and – ( ):    12,  11 Count the number of runs, T:      T = 9  Using table 5, the critical values are  7,18.  Since T = 9 is between the two critical values, we fail to reject the null hypotheses.  The sequence appears to be random.    NOTE:  A run may contain only one value, as in this example.  The first 24 constitutes a run of length 1.    

Page 27: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

Exercises  15.  An observer recorded the gender of students entering the building.  Was the sequence of 

genders random?  Use α = 0.05?  

M FF MMM FFFF MMM FF M F M F M F MMMM FFFFF MM    16.  An experiment was done tossing a coin and recording the results.  Was the sequence of heads and tails random?  Use α = 0.05.    HH TTT H T H T HHHH TTT HHHHH T H TT HHH T HHH TT HH T    17.  Following are closing values for a stock index over a sequence of periods.  Do the closing values appear to be random?  Use α = 0.05.  969  995  943  985  969  842  951  1036  1052  892  882  1015  1000 908  898  1000  1024  1071  1287  1287  1553  1956  981  1011  998  1200    18.  An observer in a mall asked patrons how long they had been in the mall (in minutes).  Does the amount of time appear to be random?  Use α = 0.05.  35  121  65  15  10  80  175  150  35  30  40  45  50 45  20  60  110  25  22  80  90  35  45  18  10  18       

Page 28: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

SPEARMAN’S RANK CORRELATION TEST  Spearman’s rank correlation is used to determine correlation between ranks of the data in matched pairs.  Rank correlation does not require normal distributions, but does require the data be randomly selected.  We analyze pairs of data that are ranks or that can be converted to ranks.  General Hypotheses  H0:  There is no correlation between the variables H1:  There is a correlation between the variables  Procedures  

1) If the two samples are not ranks, convert each sample separately, with the lowest value having rank 1. 

2) If there are no ties of ranks within each sample, you can calculate Spearman’s r (identified as   to distinguish it from Pearson’s r, correlation of interval or ratio data). 

3) Calculate the difference of each pair of ranks by subtracting the first rank from the second rank. 4) Square the result, giving  .  Sum the squared values, giving ∑ . 5) Use the exact formula for Spearman’s rank correlation:  

1 ∑  

 6) If there are ties in the ranks of either sample, you can calculate Spearman’s r by the formula for 

Pearson’s r: 

   ∑ ∑ ∑

∑ ∑ ∑ ∑ 

7) If n ≤ 30, use table 6 to find the critical value.     If n > 30, find the critical value using the following formula:  

√   , where z is the value corresponding to the significance level 

 (for example, 1.96 for α = 0.05)  

8) If the absolute value of your calculated test statistic is greater than the table value, reject the null hypothesis. 

   

Page 29: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

EXAMPLE ONE  A company gives a ranks new employees on a projected performance test.  After one year, the employees are ranked on their actual performance.  Is there a correlation between the test and the performance ratings?  H0:  There is no correlation between the performance test and the performance rating H1:  There is a correlation between the performance test and the performance rating    Employee  Test Rank  Performance Rank  Diff  Diffsq A    2      3    ‐1  1 B    1      2    ‐1  1 C    4      1     3  9 D    3      4    ‐1  1 E    5      6    ‐1  1 F    6      5    1  1             Sum:    14  

16 ∑

11

6 146 35

184

270.6889 

 From Table 6, with n = 6 and α= 0.05, the critical value of Spearman’s r = .886.  With the calculated value of .6998, we fail to reject the null hypothesis.  There is not enough statistical evidence to indicate there is a correlation between the test and performance rankings.    

Page 30: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

EXAMPLE TWO  A teacher gives a pretest when students begin a seminar on Nonparametric statistics.  After the seminar ends, he gives a posttest.  Is there any correlation between the students’ ranking on the pretest and the posttest?  H0:  There is no correlation between the pretest rankings and the posttest rankings H1:  There is a correlation between the pretest rankings and the posttest rankings  Student   Pretest    Rank    Posttest  Rank    Diff  Diffsq A    65    2    72    5    ‐3  9 B    71    5    73    6    ‐1  1 C    75    7    70    3      4  16 D    60    1    68    1      0  0 E    72    6    80    7    ‐1  1 F    69    4    69    2      2  4 G    68    3    71    4    ‐1  1 H    80    8    90    8      0  0                   Sum:    32  

  1 ∑ 1 1  =.619 

 From Table 6,  with n = 8 and α = 0.05, the critical value of Spearman’s r = .738.  Since the calculated value is .619, we fail to reject the null hypothesis.  There is not enough statistical evidence to indicate a correlation between the pretest and posttest ranks.    

Page 31: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

 EXAMPLE THREE  Faced with results from Example Two, the professor created two new assessments.  In the next seminar, he used the new pretest and posttest with the following results.  Is there a correlation between the new pretest and posttest rankings?  Student   Pretest    Rank1    Posttest  Rank2 A    70    3    72    3 B    68    1.5    69    1 C    68    1.5    70    2 D    71    4    73    4 E    73    6    75    6 F    72    5    74    5 G    75    7    82    8 H    80    8    76    7  In this sample, we note there is a tie in the rankings on the pretest.  We will use the formula for Pearson’s r to calculate Spearman’s r.  Using only the ranks, we use the following data:  

Rank1  Rank1Sq  Rank2  Rank2Sq  Rank1*Rank2 3  9    3  9      9 1.5  2.25    1  1      1.5 1.5  2.25    2  4      3 4  16    4  16      16 6  36    6  36      36 5  25    5  25      25 7  49    8  64      56 8  64    7  49      56 

Sum:    36  203.5    36  204      202.5  

∑ ∑ ∑

∑ ∑ ∑ ∑

8 202.5 36 203.58 203.5 36 8 204 36

.97 

 From Table 6, with n = 8 and α = 0.05, the critical value of Spearman’s r = .738.  Since the calculated value = .97, we reject the null hypotheses.  It appears there is a correlation between the pretest and the posttest ranks.    

Page 32: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

In this example, what if we calculate Spearman’s r by using the differences of the ranks?    Rank1    Rank2    Diff  Diffsq   3    3      0  0   1.5    1     .5  .25   1.5    2    ‐.5  .25   4    4      0  0   6    6      0  0   7    8     ‐1  1   8    7      1  1         Sum:    2.5  

  1 ∑ 1 . 1 .97 

 Since we calculated the same test value, we come to the same conclusion to reject the null hypothesis.  As a general rule, this will hold and you can avoid the more tedious calculations for Pearson’s r.      Exercises  19.  An accounting firm assessed two different methods of preparing returns.  Is there any 

correlation between the amount of time required to complete the returns?  Use Spearman’s r with  α = 0.05. 

 Return    MethodA    MethodB 

    A    62      65     B    75      75     C    51      50     D    60      60     E    65      70     F    70      62 

G    63      64     H    85      90     I    45      40    

Page 33: NONPARAMETRIC STATISTICS - Home | Calhoun ...webnt.calhoun.edu/distance/internet/Business/eco231...NONPARAMETRIC STATISTICS In previous chapters, the inferential statistics tests were

20.  A professor gives a pretest as a predictor of course averages for his students.  Below are scores on the pretest and course averages for selected students.  Is there any correlation between the students’ ranks on their pretest and their course average?  Use α = 0.05.  

Student   Pretest    Average A    12    80 B    14    88 C    15    81 D    16    85 E    13    83 F    17    92 G    18    90 H    19    95 

 21.  Below are rankings employees received when they were hired and one year later.  Is there any correlation between the two sets of rankings?  Use α = 0.05.  

Employee  NewHire    OneYear 1    2      3 2    1      7 3    4      5 4    3      2 5    5      4 6    8      6 7    6      8 8    7      1