Example 47.1: TwoSample Location Tests and EDF Statistics
Fiftynine female patients with rheumatoid arthritis who participated in a
clinical trial were assigned to two groups, active and placebo. The response
status (excellent=5, good=4, moderate=3, fair=2, poor=1) of each patient
was recorded.
The following SAS statements create the data set Arthritis, which contains
the observed status values for all the patients. The variable Treatment denotes
the treatment received by a patient, and the variable Response contains the response
status of the patient. The variable Freq contains the frequency of the
observation, which is the number of patients with the Treatment and
Response combination.
data Arthritis;
input Treatment $ Response Freq @@;
datalines;
Active 5 5 Active 4 11 Active 3 5 Active 2 1 Active 1 5
Placebo 5 2 Placebo 4 4 Placebo 3 7 Placebo 2 7 Placebo 1 12
;
PROC NPAR1WAY tests the null hypothesis that there is no
difference in the patient response status against an alternative hypothesis
that the patient response status differs in the two treatment groups. The
WILCOXON option requests the Wilcoxon test for difference in location,
and the MEDIAN option requests the median test for difference in
location. The EDF option requests empirical distribution function
statistics. The variable Treatment is the CLASS variable, and the VAR
statement specifies that the variable Response is the response variable.
proc npar1way wilcoxon median edf data=Arthritis;
class Treatment;
var Response;
freq Freq;
run;
Output 47.1.1: Wilcoxon TwoSample Test
Wilcoxon Scores (Rank Sums) for Variable Response Classified by Variable Treatment 
Treatment 
N 
Sum of Scores 
Expected Under H0 
Std Dev Under H0 
Mean Score 
Active 
27 
999.0 
810.0 
63.972744 
37.000000 
Placebo 
32 
771.0 
960.0 
63.972744 
24.093750 
Average scores were used for ties. 
Wilcoxon TwoSample Test 
Statistic 
999.0000 


Normal Approximation 

Z 
2.9466 
OneSided Pr > Z 
0.0016 
TwoSided Pr > Z 
0.0032 


t Approximation 

OneSided Pr > Z 
0.0023 
TwoSided Pr > Z 
0.0046 
Z includes a continuity correction of 0.5. 
KruskalWallis Test 
ChiSquare 
8.7284 
DF 
1 
Pr > ChiSquare 
0.0031 

Output 47.1.1 shows the results of the Wilcoxon analysis.
The Wilcoxon twosample test statistic equals 999.0, which is
the sum of the Wilcoxon scores for the smaller sample (Active).
This sum is greater than 810.0, its expected value under the null
hypothesis of no difference between the two samples Active and
Placebo. The onesided pvalue is 0.0016, which shows that the
patient response for the Active treatment is significantly more
than for the Placebo group.
Output 47.1.2: Median TwoSample Test
Median Scores (Number of Points Above Median) for Variable Response Classified by Variable Treatment 
Treatment 
N 
Sum of Scores 
Expected Under H0 
Std Dev Under H0 
Mean Score 
Active 
27 
18.916667 
13.271186 
1.728195 
0.700617 
Placebo 
32 
10.083333 
15.728814 
1.728195 
0.315104 
Average scores were used for ties. 
Median TwoSample Test 
Statistic 
18.9167 
Z 
3.2667 
OneSided Pr > Z 
0.0005 
TwoSided Pr > Z 
0.0011 
Median OneWay Analysis 
ChiSquare 
10.6713 
DF 
1 
Pr > ChiSquare 
0.0011 

Output 47.1.2 shows the results of the median twosample test.
The statistic equals 18.9167, with a onesided pvalue of 0.0005.
This shows that the response for the Active treatment is significantly
more than for the Placebo group.
Output 47.1.3: Empirical Distribution Function Statistics
KolmogorovSmirnov Test for Variable Response Classified by Variable Treatment 
Treatment 
N 
EDF at Maximum 
Deviation from Mean at Maximum 
Active 
27 
0.407407 
1.141653 
Placebo 
32 
0.812500 
1.048675 
Total 
59 
0.627119 

Maximum Deviation Occurred at Observation 3 
Value of Response at Maximum = 3.0 
KolmogorovSmirnov TwoSample Test (Asymptotic) 
KS 
0.201818 
D 
0.405093 
KSa 
1.550191 
Pr > KSa 
0.0164 
Cramervon Mises Test for Variable Response Classified by Variable Treatment 
Treatment 
N 
Summed Deviation from Mean 
Active 
27 
0.526596 
Placebo 
32 
0.444316 
Cramervon Mises Statistics (Asymptotic) 
CM 
0.016456 
CMa 
0.970912 
Kuiper Test for Variable Response Classified by Variable Treatment 
Treatment 
N 
Deviation from Mean 
Active 
27 
0.000000 
Placebo 
32 
0.405093 
Kuiper TwoSample Test (Asymptotic) 
K 
0.405093 
Ka 
1.550191 
Pr > Ka 
0.1409 

Output 47.1.3 shows empirical distribution function statistics comparing
these two samples. The asymptotic pvalue for the KolmogorovSmirnov
test is 0.0164. This indicates rejection of the null hypothesis that
the distributions are identical for the two groups.
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.