W-W Subcommand (NPAR TESTS command)
NPAR TESTS W-W=varlist BY variable(value1,value2)
W-W
(alias WALD-WOLFOWITZ
) tests whether the distribution
of a variable is the same in two independent samples. A runs test
is performed with group membership as the criterion. The output includes
a Frequency table, showing the total number of valid cases for each
variable that is specified before BY
and the number of valid cases in each group. The output also includes
a Test Statistics table, showing the number of runs, Z, and one-tailed probability of Z. If ties are present, the minimum and
maximum number of possible runs, their Z statistics, and one-tailed probabilities are displayed.
Syntax
- The minimum specification is a single test variable,
the keyword
BY
, a grouping variable, and two values in parentheses. - Cases with the first value form one group, and cases with the second value form the other group. The order in which values are specified is unimportant.
Operations
- Cases are combined from both groups and ranked from
lowest to highest, and a runs test is performed, using group membership
as the criterion. For ties involving cases from both groups, both
the minimum and maximum number of possible runs are calculated. Test
statistics are calculated for each variable that is specified before
BY
. - For a sample size of 30 or less, the exact one-tailed probability is calculated. For a sample size that is greater than 30, the normal approximation is used.
- Cases with values other than values that are specified for the grouping variable are excluded.
Example
NPAR TESTS W-W=V1 BY V3(0,1).
- This example ranks cases from lowest to highest based on their values for V1, and a runs test is performed. Cases with value 0 for V3 form one group, and cases with value 1 form the other group.