Chap 13
Chap 13
178
Chapter 13
180
Comparing Distributions
To test the hypothesis that two or more groups of observations have identical distributions, use the NPAR1WAY procedure. The procedure calculates the KolmogorovSmirnov statistic, an asymptotic Kolmogorov-Smirnov statistic, and the Cramr-von
Mises statistic. In addition, for data with only two groups of observations, the procedure calculates the two-sample Kolmogorov statistic and the Kuiper statistic. To
obtain these tests, use the EDF option in the PROC NPAR1WAY statement. For
details, see Chapter 47, The NPAR1WAY Procedure.
One-Sample Tests
Base SAS software provides two one-sample tests in the UNIVARIATE procedure:
a sign test and the Wilcoxon signed rank test. Both tests are designed for situations
where you want to make an inference about the location (median) of a population.
For example, suppose you want to test if the median resting pulse rate of marathon
runners differs from a specified value.
By default, both of these tests examine the hypothesis that the median of the population from which the sample is drawn is equal to a specified value, which is zero by
default. The Wilcoxon signed rank test requires that the distribution be symmetric;
the sign test does not require this assumption. These tests can also be used for the
case of two related samples; see the section Comparing Two Independent Samples
for more information.
The two tests are automatically provided by the UNIVARIATE procedure. For details, formulas, and examples, see the chapter on the UNIVARIATE procedure in the
SAS Procedures Guide.
Two-Sample Tests
This section describes tests appropriate for two independent samples (for example,
two groups of subjects given different treatments) and for two related samples (for
example, before-and-after measurements on a single group of subjects). Related samples are also referred to as paired samples or matched pairs.
181
the Mantel-Haenszel statistic in the list of tests for no association. This is labeled as Mantel Haenszel Chi-square and PROC FREQ displays the statistic,
the degrees of freedom, and the p-value.
the CMH statistic 2 in the section on Cochran-Mantel-Haenszel statistics.
PROC FREQ displays the statistic, the degrees of freedom, and the p-value.
To obtain this statistic, specify the CMH2 option in the TABLES statement.
182
The first two tests are available in the UNIVARIATE procedure, and the last test is
available in the FREQ procedure. When you perform these tests, your data should
consist of pairs of measurements for a random sample from a single population. For
example, suppose your data consist of SAT scores for students before and after attending a course on how to prepare for the SAT. The pairs of measurements are the
scores before and after the course, and the students should be a random sample of
students who attended the course. Your goal in analysis is to decide if the median
change in scores is significantly different from zero.
183
184
Obtaining Ranks
The primary procedure for obtaining ranks is the RANK procedure in base SAS
software. Note that the PRINQUAL and TRANSREG procedures also provide rank
transformations. With all three of these procedures, you can create an output data set
and use it as input to another SAS/STAT procedure or to the IML procedure. See the
SAS Procedures Guide for information on the RANK procedure, and see the chapters
in this book for information on the PRINQUAL and TRANSREG procedures.
In addition, you can specify SCORES=RANK in the TABLES statement in the FREQ
procedure. PROC FREQ then uses ranks to perform the analyses requested and generates nonparametric analyses.
For more discussion of using the rank transform, see Iman and Conover (1979),
Conover and Iman (1981), Hora and Conover (1984), Iman, Hora, and Conover
(1984), Hora and Iman (1988), and Iman (1988).
References
185
References
Bross, I.D.J. (1958), How to Use Ridit Analysis, Biometrics, 14, 1838.
Conover, W.J. (1980), Practical Nonparametric Statistics, Second Edition, New
York: John Wiley & Sons, Inc.
Conover, W.J. and Iman, R.L. (1981), Rank Transformations as a Bridge between Parametric and Nonparametric Statistics, The American Statistician, 35,
124129.
Gibbons, J.D. and Chakraborti, S. (1992), Nonparametric Statistical Inference, Third
Edition, New York: Marcel Dekker, Inc.
Hettmansperger, T.P. (1984), Statistical Inference Based on Ranks, New York: John
Wiley & Sons, Inc.
Hollander, M. and Wolfe, D.A. (1973), Nonparametric Statistical Methods, New
York: John Wiley & Sons, Inc.
Hora, S.C. and Conover, W.J. (1984), The F Statistic in the Two-Way Layout with
Rank-Score Transformed Data, Journal of the American Statistical Association,
79, 668673.
Hora, S.C. and Iman, R.L. (1988), Asymptotic Relative Efficiencies of the RankTransformation Procedure in Randomized Complete Block Designs, Journal of
the American Statistical Association, 83, 462470.
Iman, R.L. and Conover, W.J. (1979), The Use of the Rank Transform in Regression, Technometrics, 21, 499509.
Iman, R.L., Hora, S.C., and Conover, W.J. (1984), Comparison of Asymptotically
Distribution-Free Procedures for the Analysis of Complete Blocks, Journal of
the American Statistical Association, 79, 674685.
186
The correct bibliographic citation for this manual is as follows: SAS Institute Inc.,
SAS/STAT Users Guide, Version 8, Cary, NC: SAS Institute Inc., 1999.