Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: stats
See also: wilgenfun sort rank

Quantlet: wilcoxon2
Description: performs the two-sample Wilcoxon test

Usage: (wilc,pval2as)=wilcoxon2(s1,s2)
Input:
s1 (m x 1) vector containing first sample
s2 (n x 1) vector containing second sample
Output:
wilc Wilcoxon (rank sum) test statistic
pval2as asymptotic p-value

Note:

Example:
library("xplore")
library("stats")
x=wilcoxon2(12|100,2|5|6|18)

Result:
[ 1,] "*---------------------------------------*"
[ 2,] "|       Wilcoxon Two-Sample Test        |"
[ 3,] "*---------------------------------------*"
[ 4,] "                                         "
[ 5,] "Rank-Sum Test Statistic      =      10.0 "
[ 6,] "                                         "
[ 7,] "Exp. Value of Rank-Sum Stat. =       7.0 "
[ 8,] "Minimum for Rank-Sum Stat.   =       3.0 "
[ 9,] "Maximum for Rank-Sum Stat.   =      11.0 "
[10,] "                                         "
[11,] "Sample size of first sample  =       2   "
[12,] "Sample size of second sample =       4   "
[13,] "                                         "
[14,] "Test of hypotheses                       "
[15,] "                                         "
[16,] "H0: mu1 <= mu2                           "
[17,] "H1: mu1  > mu2, exact p-value =  0.1333  "
[18,] "                asymp p-value =  0.0824  "
[19,] "                                         "
[20,] "H0: mu1 == mu2                           "
[21,] "H1: mu1 <> mu2, exact p-value =  0.2667  "
[22,] "                asymp p-value =  0.1649  "
[23,] "                                         "
[24,] "-----------------------------------------"
Example:
library("xplore")
library("robtech")
randomize(0)
x=wilcoxon2(normal(10,1),normal(20,1))

Result:
[ 1,] "*---------------------------------------*"
[ 2,] "|       Wilcoxon Two-Sample Test        |"
[ 3,] "*---------------------------------------*"
[ 4,] "                                         "
[ 5,] "Rank-Sum Test Statistic      =     153.0 "
[ 6,] "                                         "
[ 7,] "Exp. Value of Rank-Sum Stat. =     155.0 "
[ 8,] "Minimum for Rank-Sum Stat.   =      55.0 "
[ 9,] "Maximum for Rank-Sum Stat.   =     255.0 "
[10,] "                                         "
[11,] "Sample size of first sample  =      10   "
[12,] "Sample size of second sample =      20   "
[13,] "                                         "
[14,] "Test of hypotheses                       "
[15,] "                                         "
[16,] "H0: mu1 >= mu2                           "
[17,] "H1: mu1 <  mu2, exact p-value =  0.4742  "
[18,] "                asymp p-value =  0.4649  "
[19,] "                                         "
[20,] "H0: mu1 == mu2                           "
[21,] "H1: mu1 <> mu2, exact p-value =  0.9483  "
[22,] "                asymp p-value =  0.9299  "
[23,] "                                         "
[24,] "-----------------------------------------"



Author: Z. Hlavka, 20010613 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006