Rank Sum Test (RSTest)

  Introduction: In statistics, the Mann-Whitney U test (also called the Wilcoxon rank-sum test), is a non-parametric test for assessing whether two samples of observations come from the same distribution.
The null hypothesis is that the two samples are drawn from a single population, and therefore that their
probability distributions are equal. It requires the two samples to be independent, and the observations to be
ordinal (In this classification, the numbers assigned to represent the rank order (1st, 2nd, 3rd etc.) of the
entities measured. The numbers are called ordinals. The variables are called ordinal variables or rank variables).
 
 Formula  formula%20rank%20sum  formula%20rank%20sum
 
  Procedure:
   To preform the rank sum test, rank the combined samples L3. Then compute the sum of the ranks for sample one, L1. If the sample sizes are unequal, then find L1 equal the sum of the ranks for the smaller sample. Then compute L2 = n1(n1 + n2 + 1) - L1. Sufficiently small values of L cause rejection of the null hypothesis that the sample means are equal.
  Note: This program is in TI-BASIC and can be entered into the calculator by the calculator keyboard. Do not enter the outline, line numbers or comments, they are for reference only. The example programs below are for testing the program. If you get the values listed, the program was entered correctly. If not, check the listing and correct it. The program has been checked and tested.
  Note: -> is the [STO->] on the calculator keyboard.
  Note: click on the underline text in Outline to go to that line number
 
  Outline:
Line 1. Clear Screen
Line 2. Instructions
Line 7 - 10. Lbl D: Data Input
Line 14 Input List 1
Line 16 Input List 2
Line 18 - 19. size L1, L2 & L3
Line 21. combine L1 & L2 into L3
Line 22. select smaller list
Line 33. sort L3
Line 34. number list 1 thru End (N)
Line 56. elements have equal values
Line 64. average rank value of equal elements
Line 37. formula Std Dev
Line 41. formula mean
Line 44. formula z score
Line 38 - 50. Display routine
  Examples
  Reference
  Reference Links
 
 

prgmRSTEST

Line Command or Statement Comments
   1.  ClrHome Clear Screen
   2.  Disp "SELECT LIST OR", Instructions
     "DATA TO BEGIN -",         |
     "USE COMMAS BTWN",         |
     "NUMBERS IN LIST",         |
     "ENTER n1, n2, R",         |
     "FOR DATA End Instructions
   3.  Pause 
   4.  ClrHome 
   5.  Float 
   6.  Menu("RANK SUM","LIST",L,"DATA",D 
   7.  Lbl D Data Input
   8.  Input "n1=",L L = sample size group A
   9.  Input "n2=",O O = sample size group B
 10.  Input "R=,R R = Rank sum
 11.  L+O->N N = total sample size
 12.  Goto X 
 13.  Lbl L 
 14.  Input "L1=",Str1 L1
 15.  expr("{"+Str1->L1 
 16.  Input "L2=",Str2 L2
 17.  expr("{"+Str2->L2 
 18.  dim(L1)->L : dim(L2)->O L = sample size L1; O = sample size L2
 19.  L+O->N N = total sample size (sample size L3)
 20.  L+1->A : N->B  
 21.  augment(L1, L2->L3 L3 = combined data
 22. If L ≤ O:Then select smaller length list
 23.  Disp "L1 USED" 
 24.  1 -> A: L -> B 
 25.  Else 
 26.  Disp "L2 USED" 
 27.  End 
 28.  N->dim( L4) 
 29.  Fill(0, L4 
 30.  For(I,A,B) 
 31.  1-L4(I) 
 32.  End 
 33.  SortA(L3, L4 sort L3
 34.  seq(X,X,1,N)->L5 sequence 1 thru N (or total sample size)
 35.  Goto S Sort Rank
 36.  Lbl R 
 37.  sum(L4L5)->R: √(LO(N+1)/12)->S formula std dev = √(n1n2(N + 1)/12)
 38.  Lbl X Display
 39.  min(L,O)->A 
 40.  Disp "SUM OF RANKS R=",R 
 41.  A(N+1)/2->M : Disp "MEAN R=",M formula mean = N (N + 1)/2
 42.  Disp "STD DEV R=",S 
 43.  Pause 
 44.  Disp "Z SCORE R",(R-M)/S formula z score
 45.  R-A(A+1)/2->U 
 46.  Disp "TEST STAT "MEAN U=",M 
 47.  LO/2->M : Disp "MEAN U=",M 
 48.  Pause 
 49.  Disp "STD DEV U=",S 
 50.  Disp "Z SCORE U=",(U-M)/S 
 51.  Goto E End routine
 52.  Lbl S 
 53.  1->I 
 54.  While I< N  N = n1 + n2 or size L3
 55.  I+1->Jincrement by 1
 56.  If L3 (I) = L3(I+1) elements have equal value
 57.  Then 
 58.  I ->J 
 59.  Lbl A : J+1->J 
 60.  If J< N : Goto B 
 61. If L3 (J) ≠ L3(I) elements not equal
 62.  Goto B : Goto A 
 63.  Lbl B 
 64.  (L5 (I) + L5 (J-1))/2 average value of rank
 65.  For (X,I,J-1) : Ans -> L5 (K) : End 
 66.  End 
 67.  J ->I 
 68.  End 
 69.  Goto R 
 70.  Lbl E Clear Screen
 71.  DelVar L3 : DelVar L1 Clear variables
 72.  DelVar L2 : DelVar L4 : DelVar L5 
 
Example:
Group A = 12, 12, 11, 8, 7, 6, 6
Rank A = 10, 10, 7.5, 4, 3, 1.5, 1.5
sum Group A Ranks = 37.5
 
Group B = 24, 24, 16, 15, 14, 12, 11, 10, 9
Rank B = 15.5, 15.5, 14, 13, 12, 10, 7.5, 6, 5
sum Group B Ranks = 98.5
 
Reference:
Commands or Statements:
  augment( listA, listB)   Returns a list, which is list B appended to the end of list A
  ClrHome   clears home screen
  dim(   returns the dimension (number of elements) of list
  Disp   displays text or value specified
  End   identifies end of For(, If-Then-Else, Repeat, or While loop
  expr(   converts string to an expression
  Fix   sets fixed-decimal mode for number of decimal places
  Float   sets floating decimal mode. Displays decimal with no trailing zeros
  For( variable,begin,end[increment])    Executes commands through End, incrementing variable from begin by increment until End.
  Goto   goes to label specified. Goto requires a line label be implemented as a destination
  If; Then; Else   Executes commands from Then to Else If condition true: or from Else to End if condition false
  Input   prompts for value to store to variable. Requires user input through keypad.
  Lbl   creates a label of one or two characters
  Menu   generates a menu of up to seven items
  min( valueA, valueB)   Returns smaller of value A and Value B
  output( row, column)   displays text or value beginning at specified row and column
  round( value [,# decimals])   returns a number rounded to # decimals (=<9)
  seq( expression, variable, begin, end[, increment])   Returns list created by evaluating expression with regard to variable, from begin to end by increment
  SortA( listname)   Sorts elements of listname in ascending (count up) order
  Str# (# is number)   String: A sequence of characters is called a string
  sum(   returns the sum of elements in list
  While condition   Executes commands while condition is true until end
 
Reference:
Information or Links:
Mann-Whitney U Test (online test)
http://elegans.swmed.edu/~leon/stats/utest.html
STATISTICAL PROGRAMS - These programs may be downloaded to your PC and will run under Microsoft Windows
http://www.tulane.edu/~dunlap/psylib.html
Easy-to-use online statistics tools (Wilcoxon rank-sum test)
http://datamill.info/wilcoxon.0.html
Statistics on the TI-83 and TI-83 Plus
Statistics
Statistics Handbook for the TI-83
Statistics Handbook
List Operations for Paired t Test on the TI-83/84
Paired t Test
 
FREE TUTORIALS © Cadet Career Counseling all rights reserved