Let’s use the mpg data file and create a new categorical variable according to exist variable drv. The new drv_front variable is defined as 1 if drv = ‘f’ or 0 if not equal ‘f’. We wish to test whether the highway mpg (hwy) is the same for front-wheel drive car and other car (drv_front).
data mpg; set mpg; if drv = 'f' then drv_front = 1; else drv_front = 0; run;
proc npar1way data = mpg wilcoxon; class drv_front; var hwy; run;
The results suggest that there is a statistically significant difference between the underlying distributions of the highway mpg of front-wheel drive car and the mpg scores of other type cars (p < .0001).