Non-Parametric Tests in SAS
Introduction
Non-parametric tests are statistical tests that do not assume a specific distribution for the data. Unlike parametric tests, which rely on certain assumptions about the population parameters (like normality), non-parametric tests are useful when these assumptions cannot be met. This makes them a valuable tool in statistical analysis, especially when dealing with ordinal data or non-normally distributed interval data.In this section, we will explore various non-parametric tests available in SAS, their applications, and how to implement them using SAS code.
When to Use Non-Parametric Tests
- The data do not meet the assumptions of normality. - The sample size is small. - The data are ordinal or categorical. - The data are measured on a non-continuous scale.Common Non-Parametric Tests in SAS
1. Wilcoxon Signed-Rank Test
The Wilcoxon Signed-Rank Test is used to compare two related samples or repeated measurements on a single sample to assess whether their population mean ranks differ. It is the non-parametric alternative to the paired t-test.Example Code:
`
sas
proc npar1way data=mydata wilcoxon;
class group;
var score;
run;
`
2. Mann-Whitney U Test
The Mann-Whitney U Test compares two independent samples to determine whether they come from the same distribution. It is the non-parametric equivalent of the independent samples t-test.Example Code:
`
sas
proc npar1way data=mydata wilcoxon;
class group;
var score;
run;
`
3. Kruskal-Wallis Test
The Kruskal-Wallis Test is used for comparing three or more independent samples. It is the non-parametric alternative to one-way ANOVA.Example Code:
`
sas
proc npar1way data=mydata kruskal;
class group;
var score;
run;
`
4. Friedman Test
The Friedman Test is a non-parametric alternative to repeated measures ANOVA. It is used when you have one or more independent variables and a dependent variable measured at three or more time points.Example Code:
`
sas
proc npar1way data=mydata friedman;
class time;
var score;
run;
`
Practical Example
Let's say we conducted a study to compare the effectiveness of three different diets on weight loss. We have weight loss data from three groups: - Group A (Diet 1) - Group B (Diet 2) - Group C (Diet 3)Given that the weight loss data is not normally distributed, we will use the Kruskal-Wallis Test to determine if there are significant differences in weight loss among the three diets.
Sample Code:
`
sas
data weight_loss;
input group $ weight_loss;
datalines;
A 5
A 7
A 6
B 3
B 4
B 5
C 8
C 9
C 7
;
run;proc npar1way data=weight_loss kruskal;
class group;
var weight_loss;
run;
`