
TWO SAMPLE LINEAR RANK SUM TESTName:
Two sample linear rank sum tests are then based on the statistic
with \( n \) denoting the combined sample size and \( R_i \)) denoting the rank of the ith observation. The variable tag is an indicator variable that has the value 1 for the observations from the smaller sample size and the value 0 for the observations from the larger sample size (if n1 = n2, tag will be set to 1 for the sample that the first observation comes from). The \( a(R_i) \) is a score function based on the ranks. The supported score functions are described in a Note section below. The following test statistic is based on asymptotic normality
where
\( \begin{array}{lcl} SD_{0}(S) & = & \mbox{the standard deviation of } S \mbox{ under the null hypothesis} \\ & = & \frac{n1 n2}{n(n1)} \sum_{i=1}^{n} {(a(R_{i})  \bar{a})^{2}} \end{array} \) \( \begin{array}{lcl} \bar{a} & = & \mbox{the average score} \\ & = & \frac{\sum_{i=1}^{n}{a(R_i)}} {n} \end{array} \) Note that n1 denotes the sample size for the smaller sample, not necessarily the sample size of Y1. Tied ranks use the average rank of the tied values.
<y1> <y2> <SUBSET/EXCEPT/FOR qualification> where <y1> is the first response variable; <y2> is the second response variable; and where the <SUBSET/EXCEPT/FOR qualification> is optional. If LOWER TAILED is specified, a lower tailed test is performed. If UPPER TAILED is specified, an upper tailed test is performed. If neither LOWER TAILED or UPPER TAILED is specified, a twotailed test is performed.
<y1> ... <yk> <SUBSET/EXCEPT/FOR qualification> where <y1> ... <yk> is a list of two or more response variables; and where the <SUBSET/EXCEPT/FOR qualification> is optional. This syntax performs all the twoway two sample linear rank sum tests for the listed variables. This syntax supports the TO syntax. If LOWER TAILED is specified, a lower tailed test is performed. If UPPER TAILED is specified, an upper tailed test is performed. If neither LOWER TAILED or UPPER TAILED is specified, a twotailed test is performed.
TWO SAMPLE LINEAR RANK SUM TEST Y1 Y2 Y3 TWO SAMPLE LINEAR RANK SUM TEST Y1 TO Y6 TWO SAMPLE LINEAR RANK SUM TEST Y1 Y2 SUBSET Y2 > 0 LOWER TAILED TWO SAMPLE LINEAR RANK SUM TEST Y1 Y2 UPPER TAILED TWO SAMPLE LINEAR RANK SUM TEST Y1 Y2
where <case> is one of the following
LET STATCDF = TWO SAMPLE LINEAR RANK SUM TEST CDF Y1 Y2 LET PVALUE = TWO SAMPLE LINEAR RANK SUM TEST PVALUE Y1 Y2 LET PVALUE = TWO SAMPLE LINEAR RANK SUM LOWER TAIL TEST PVALUE Y1 Y2 LET PVALUE = TWO SAMPLE LINEAR RANK SUM UPPER TAIL TEST PVALUE Y1 Y2 In addition to the above LET commands, builtin statistics are supported for 30+ different commands (enter HELP STATISTICS for details).
. Step 1: Read the data . skip 25 read shoemake.dat y1 y2 skip 0 let y x = stack y1 y2 . . Step 2: Generate the statistics . set linear rank sum test score van der waerden let statval = linear rank sum test y1 y2 let statcdf = linear rank sum test cdf y1 y2 let pvalue = linear rank sum test pvalue y1 y2 let pvallt = linear rank sum test lower tail pvalue y1 y2 let pvalut = linear rank sum test upper tail pvalue y1 y2 let statval = round(statval,2) let statcdf = round(statcdf,2) let pvalue = round(pvalue,2) let pvallt = round(pvallt,2) let pvalut = round(pvalut,2) . print "Van Der Waerden Scores:" print "Test Statistic: ^statval" print "Test Statistic CDF: ^statcdf" print "Test Statistic PValue: ^pvalue" print "Test Statistic Lower Tailed PValue: ^pvallt" print "Test Statistic Upper Tailed PValue: ^pvalut" . two sample linear rank sum test y1 y2 van der waerden test y x . set linear rank sum test score wilcox two sample linear rank sum test y1 y2 t test y1 y2 . set linear rank sum test score klotz two sample linear rank sum test y1 y2 klotz test y1 y2The following output is generated Van Der Waerden Scores: Test Statistic: 1.56 Test Statistic CDF: 0.94 Test Statistic PValue: 0.12 Test Statistic Lower Tailed PValue: 0.94 Test Statistic Upper Tailed PValue: 0.06 Two Sample TwoSided Linear Rank Sum Test (Van Der Waerden Scores) First Response Variable: Y1 Second Response Variable: Y2 H0: Location1 = Location2 Ha: Location1 not equal Location2 Summary Statistics: Number of Observations for Sample 1: 10 Mean for Sample 1: 6.02100 Median for Sample 1: 5.53000 Standard Deviation for Sample 1: 1.58184 Number of Observations for Sample 2: 10 Mean for Sample 2: 5.01900 Median for Sample 2: 5.03500 Standard Deviation for Sample 2: 1.10440 Test (Normal Approximation): Test Statistic Value: 1.56365 Score Value: 3.11351 Expected Value of Test Statistic: 0.00786 Standard Deviation of Test Statistic: 1.98615 CDF Value: 0.94105 PValue (2tailed test): 0.11790 PValue (lowertailed test): 0.94105 PValue (uppertailed test): 0.05895 TwoTailed Test: Normal Approximation  Lower Upper Null Significance Test Critical Critical Hypothesis Level Statistic Value (<) Value (>) Conclusion  80.0% 1.56365 1.28155 1.28155 REJECT 90.0% 1.56365 1.64485 1.64485 ACCEPT 95.0% 1.56365 1.95996 1.95996 ACCEPT 99.0% 1.56365 2.57583 2.57583 ACCEPT THE FORTRAN COMMON CHARACTER VARIABLE LINERANK HAS JUST BEEN SET TO WILC Two Sample TwoSided Linear Rank Sum Test (Wilcoxon Scores First Response Variable: Y1 Second Response Variable: Y2 H0: Location1 = Location2 Ha: Location1 not equal Location2 Summary Statistics: Number of Observations for Sample 1: 10 Mean for Sample 1: 6.02100 Median for Sample 1: 5.53000 Standard Deviation for Sample 1: 1.58184 Number of Observations for Sample 2: 10 Mean for Sample 2: 5.01900 Median for Sample 2: 5.03500 Standard Deviation for Sample 2: 1.10440 Test (Normal Approximation): Test Statistic Value: 1.47628 Score Value: 124.50000 Expected Value of Test Statistic: 105.00000 Standard Deviation of Test Statistic: 13.20885 CDF Value: 0.93007 PValue (2tailed test): 0.13987 PValue (lowertailed test): 0.93007 PValue (uppertailed test): 0.06993 TwoTailed Test: Normal Approximation  Lower Upper Null Significance Test Critical Critical Hypothesis Level Statistic Value (<) Value (>) Conclusion  80.0% 1.47628 1.28155 1.28155 REJECT 90.0% 1.47628 1.64485 1.64485 ACCEPT 95.0% 1.47628 1.95996 1.95996 ACCEPT 99.0% 1.47628 2.57583 2.57583 ACCEPT THE FORTRAN COMMON CHARACTER VARIABLE LINERANK HAS JUST BEEN SET TO KLOT Two Sample TwoSided Linear Rank Sum Test (Klotz Scores) First Response Variable: Y1 Second Response Variable: Y2 H0: Scale1 = Scale2 Ha: Scale1 not equal Scale2 Summary Statistics: Number of Observations for Sample 1: 10 Mean for Sample 1: 6.02100 Median for Sample 1: 5.53000 Standard Deviation for Sample 1: 1.58184 Number of Observations for Sample 2: 10 Mean for Sample 2: 5.01900 Median for Sample 2: 5.03500 Standard Deviation for Sample 2: 1.10440 Test (Normal Approximation): Test Statistic Value: 0.26908 Score Value: 8.01749 Expected Value of Test Statistic: 7.49513 Standard Deviation of Test Statistic: 1.94130 CDF Value: 0.60606 PValue (2tailed test): 0.78787 PValue (lowertailed test): 0.60606 PValue (uppertailed test): 0.39394 TwoTailed Test: Normal Approximation  Lower Upper Null Significance Test Critical Critical Hypothesis Level Statistic Value (<) Value (>) Conclusion  80.0% 0.26908 1.28155 1.28155 ACCEPT 90.0% 0.26908 1.64485 1.64485 ACCEPT 95.0% 0.26908 1.95996 1.95996 ACCEPT 99.0% 0.26908 2.57583 2.57583 ACCEPT  
Date created: 08/03/2023 Last updated: 08/03/2023 Please email comments on this WWW page to alan.heckert@nist.gov. 