Displaying 1 result from an estimated 1 matches for "ordtest".
2011 Oct 06
1
Wilcox Test / Mann Whitney U Test
...I can get the same W value. Am I calculating
the test statistic incorrectly?
Thanks, sample code below
Sam Stewart
#Ordinal example
dropouts = c(rep(0,25),rep(3,10),rep(2,9),rep(1,13),rep(4,6))
remain = c(rep(0,31),rep(3,2),rep(2,6),rep(1,21),rep(4,3))
tab2 = rbind(table(dropouts),table(remain))
ordTest = wilcox.test(x=dropouts,y=remain,correct=FALSE,exact=FALSE)
cumsum(colSums(tab2))
W = max(c(sum(rank(cbind(dropouts,remain))[1:length(dropouts)]),sum(rank(cbind(dropouts,remain))[-(1:length(dropouts))])))
n1 = length(dropouts)
n2 = length(remain)
testStat = (S-n1*(n1+n2+1)/2)/(sqrt(n1*n2*(n1+n2+1)...