* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ . * File: nonpar.SPS . * Date: 2-April-2001 . * Author: Bruce Weaver, weaverb@mcmaster.ca . * Notes: Nonparametric tests using SPSS . * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ . * Display syntax commands in the Output Viewer . SET Printback=On Length=59 Width=80. * [1] The sign test example . DATA LIST LIST /bar1 (f5.0) bar2 (f5.0). BEGIN DATA. 20 40 18 25 24 38 14 27 5 31 26 21 15 32 29 38 15 25 9 18 25 32 31 28 35 33 12 29 END DATA. * Analyze-->Nonparametric-->2 Related Samples, check Sign Test box . NPAR TEST /SIGN= bar1 WITH bar2 (PAIRED) /MISSING ANALYSIS. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ . * [2] Wilcoxon signed ranks test on the same data . * Analyze-->Nonparametric Tests-->2 related samples, check Wilcoxon . NPAR TEST /WILCOXON=bar1 WITH bar2 (PAIRED) /MISSING ANALYSIS. * T = smaller of (sum or positive ranks) and (sum of negative ranks) = 6 . * Note that SPSS reports the large-sample z-test version of the test rather than the exact version . * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ . * [3] Both tests can be done with a single command . * Analyze-->Nonparametric Tests-->2 related samples, check both Sign test and Wilcoxon text . NPAR TEST /SIGN= bar1 WITH bar2 (PAIRED) /WILCOXON=bar1 WITH bar2 (PAIRED) /MISSING ANALYSIS. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ . * [4] Mann-Whitney U test example . DATA LIST LIST /group (f5.0) score (f5.0). BEGIN DATA. 1 12 1 17 1 9 1 21 2 8 2 18 2 26 2 15 2 23 END DATA. * Show structure of data file . list all. val lab group 1 '1- Group E' 2 '2- Group C'. * Analyze-->Nonparametric Tests-->2 independent samples, check Mann-Whitney U . NPAR TESTS /M-W= score BY group(1 2) /MISSING ANALYSIS. * Finished. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .