* This is a SAS data step to input the data; data wilcoxon_rs_eg; input group $ cycles; cards; new 7651 new 8337 new 6989 new 9568 old 9477 old 13581 ; run; /* Proc npar1way is a SAS procedure to run various distribution-free analyses. Here we use it to do the Wilcoxon rank sum test. Note that in contrast to what I have in the class notes, SAS always (1) takes population 1 to be the population corresponding to the smaller sample, and (2) always takes the test statistic to be the sum of the ranks corresponding to population 1. So here the value w*=10 (sum of ranks for pop 1) and the p-value is P(W>w*) */ proc npar1way data=wilcoxon_rs_eg wilcoxon; class group; var cycles; exact wilcoxon; run; /* To get the confidence interval and point estimate, we run it again. Note that the confidence level was found from the table: .134=1-.866 (SAS apparently can't figure it out by itself!) */ proc npar1way data=wilcoxon_rs_eg wilcoxon hl alpha=.134; class group; var cycles; exact wilcoxon hl / alpha=.134; run;