Researchers conducted an experiment to compare the effects of two stimulants. Thirteen randomly selected subjects received the first stimulant, and six randomly selected subjects received the second stimulant. The reaction times (in minutes) were measured while the subjects were under the influence of the stimulants.
The following SAS statements create the data set React
, which contains the observed reaction times for each stimulant. The variable Stim
represents Stimulant 1 or 2. The variable Time
contains the reaction times observed for subjects under the stimulant.
data React; input Stim Time @@; datalines; 1 1.94 1 1.94 1 2.92 1 2.92 1 2.92 1 2.92 1 3.27 1 3.27 1 3.27 1 3.27 1 3.70 1 3.70 1 3.74 2 3.27 2 3.27 2 3.27 2 3.70 2 3.70 2 3.74 ;
The following statements request a Wilcoxon test of the null hypothesis that there is no difference between the effects of
the two stimulants. Stim
is the CLASS variable, and Time
is the analysis variable. The WILCOXON option requests an analysis of Wilcoxon scores. The CORRECT=NO option removes the
continuity correction from the computation of the standardized z test statistic. The WILCOXON option in the EXACT statement requests exact p-values for the Wilcoxon test. Because the sample size is small, the large-sample normal approximation might not be adequate,
and it is appropriate to compute the exact test. These statements produce the results shown in Output 71.3.1.
proc npar1way wilcoxon correct=no data=React; class Stim; var Time; exact wilcoxon; run;
Output 71.3.1 displays the results of the Wilcoxon two-sample test. The Wilcoxon statistic equals 79.50. Since this value is greater than 60.0, the expected value under the null hypothesis, PROC NPAR1WAY displays the right-sided p-values. The normal approximation for the Wilcoxon two-sample test yields a one-sided p-value of 0.0382 and a two-sided p-value of 0.0764. For the exact Wilcoxon test, the one-sided p-value is 0.0527, and the two-sided p-value is 0.1054.