;
%macro kw;
%let alpha= 0.1; * ENTER
ALPHA LEVEL ON THIS LINE ;
****;
* DO NOT EDIT THE PROGRAM
BEYOND THIS LINE **;
proc datasets;
delete comps;
run;
*****;
kruskal-wallis test ;
*****;
proc nparlway data=a wilcoxon;
class group;
var response;
title 'Kruskal-Wallis test –
worked example';
run;
*;
- post hoc pairwise comparisons
*;
*;
rank the data ;
proc rank data=a out=b;
var response;
ranks rankresp;
run;
find the mean rank for each
group and number in each group
;
proc sort data=b; by group;
proc means data=b noprint;
by group;
var rankresp;
output out=rank mean=meanrank
n=num;
find total number of
subjects ;
data numsub;
set a end=eof;
if eof then do;
totnum=n;
output;
end;
find the total number of
groups ;
%global totgp;
Appendix 376