/* Wilcoxon Test */

filename t01 url 'http://hedwig.mgh.harvard.edu/biostatistics/sites/default/files/public/education/tmp_sample_data.csv';

proc import file=t01 out=t01 dbms=csv replace;
run;

proc npar1way data=t01 wilcoxon;
class gender;
var bmi;
run;


/********************************** ANNOTATED RESULTS **********************************/

                                  

                             The NPAR1WAY Procedure


                  Wilcoxon Scores (Rank Sums) for Variable bmi
                         Classified by Variable gender

                           Sum of      Expected       Std Dev          Mean
     gender       N        Scores      Under H0      Under H0         Score
     ----------------------------------------------------------------------
     0           16        471.50         488.0     59.802840     29.468750
     1           44       1358.50        1342.0     59.802840     30.875000

                       Average scores were used for ties.

                            Wilcoxon Two-Sample Test

                         Statistic             471.5000

                         Normal Approximation
                         Z                      -0.2675
                         One-Sided Pr <  Z       0.3945
                         Two-Sided Pr > |Z|      0.7890

                         t Approximation
                         One-Sided Pr <  Z       0.3950
                         Two-Sided Pr > |Z|      0.7900

                   Z includes a continuity correction of 0.5.

                              Kruskal-Wallis Test

                         Chi-Square              0.0761
                         DF                           1
                         Pr > Chi-Square         0.7826