Statistical Analysis for Education and Psychology Researchers

(Jeff_L) #1

The data step begins in the first line where the internal SAS data set is designated a. On
the second line two variables are specified, ‘group’ and ‘response’, the double trailing at
sign, @@, indicates that each input line contains several observations, for example, the
first observation belongs to group 1 and has a value of 30, the second observation also
belongs to group 1 and has a value of 51. Data values are input after the cards statement,
note the semicolon on a separate line by itself (the programme will fail if the semicolon is
not on a line of its own). The CLASS statement identifies the variable that classifies the
observations into two groups, here it is the variable group. The VAR statement identifies
the response or outcome variable to use for the group comparison, here the variable is
called response. This section of SAS code produces the output shown in Figure 7.4.
NPAR1WAYPROCEDURE
Wilcoxon Scores (Rank Sums) for Variable RESPONSE
Classified by Variable GROUP
GROUP N Sum of scores Expected under H0 Std Dev under H0 Mean score
1 10 116.0 115.0 15.1443273 11.6000000
2 12 137.0 138.0 15.1443273 11.4166667
Average Scores were used for Ties
Wilcoxon 2-Sample Test (Normal Approximation)
(with Continuity Correction of .5)
S=116.000 Z= 0.033016 Prob>|Z|=0.9737
T-Test. approx. Significance=0.9740
Kruskal-Wallis Test (Chi-Square Approximation)
CHISQ=0.00436 DF=1 Prob>CHISQ=0.9474


Figure 7.4: Output for Wilcoxon M-W


test using PROC NPAR1WAY


Interpretation of Computer Output

The heading summarizes the name of the test performed, Wilcoxon Scores (Rank Sums)
test, the response variable analyzed, and the CLASS variable used to define the groups
for the analysis. In this example, the class variable is called GROUP, and the levels of
GROUP are 1 (lower school) and 2 (upper school). The number of observations in each
group are indicated by N and the sum of the rank scores for each group is printed. The
rank sum that belongs to the smaller N, here 116, is the test statistic SR and this is printed
separately on the following line. The expected Wilcoxon rank sums (under the null
hypothesis) are printed along with their associated standard errors labelled ‘Std Dev
under H0’. Should the sample sizes for the two groups be equal then the expected values
of SR would also be equal. The average ranks sum for each group is also output. This
gives a useful indication of which group has the largest proportion of higher ranking
scores. In this example both groups are similar.
The test statistic, the evaluated normal approximation, Z, and associated probability,
Prob>|Z| labelled in the output S and not SR, are all output on the same line. In this
example a p-value of 0.9737 is printed, this is a two-tailed value, twice the probability
associated with a Z-score of 0.0330 (nearest tabled value for one-tailed is 0.4880). As the
two-tailed p-value is larger than the 5 per cent significance level, 0.9737>0.05, we can


Inferences involving rank data 225
Free download pdf