home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / MCAD254.ZIP / STAT / WILCOXON.MCD < prev   
Encoding:
Text File  |  1988-11-14  |  2.0 KB  |  81 lines

  1. .MCD 20000 0
  2. .CMD PLOTFORMAT logs=0,0 subdivs=1,1 size=5,15 type=l
  3. .CMD FORMAT  rd=d ct=10 im=i et=3 zt=15 pr=3 mass length time charge
  4. .CMD SET ORIGIN 0
  5. .CMD SET TOL 0.001000
  6. .CMD MARGIN 0
  7. .CMD LINELENGTH 78
  8. .CMD SET PRNCOLWIDTH 8
  9. .CMD SET PRNPRECISION 4
  10. .TXT 0 42 1 39 
  11. a1,38,48,37
  12. Copyright (c) 1988 by MathSoft, Inc.
  13. .TXT 2 -20 1 32 
  14. a1,31,78,30
  15. THE WILCOXON SIGNED-RANK TEST
  16. .TXT 2 -22 5 81 
  17. a5,80,78,347
  18. The Wilcoxon signed rank test uses a sample drawn from a symmetric population 
  19. to test the hypothesis that the population median is 0.  As an illustration, 
  20. this model tests the hypothesis that two samples of size 40 are drawn from 
  21. populations with equal medians.  First read the two samples into an array X 
  22. and form a vector of differences A:
  23. .EQN 6 1 1 21 
  24. X:READPRN(WDATA)
  25. .EQN 0 24 2 18 
  26. A:X{52}-X{52}
  27. .EQN 0 21 1 14 
  28. n:rows(A)
  29. .EQN 0 17 1 16 
  30. i:0;n-1
  31. .TXT 3 -63 1 75 
  32. a1,74,78,73
  33. Now rank the absolute values of the numbers in A; first check for zeros:
  34. .EQN 2 0 2 16 
  35. {55}(A≈0){49}=?
  36. .EQN 0 19 2 12 
  37. D:(|A){49}
  38. .EQN 1 20 1 34 
  39. f(a,b):.5*((a<b)+(a≤b))
  40. .EQN 1 -39 3 21 
  41. R[i:.5+{55}f(D,D[i){49}
  42. .TXT 1 32 1 45 
  43. a1,44,51,43
  44. Now sum the ranks with the original signs.
  45. .EQN 2 -3 2 31 
  46. W:{55}(R*((A>0)-(A<0))){49}
  47. .TXT 1 -29 1 29 
  48. a1,28,78,27
  49. The Wilcoxon statistic is:
  50. .EQN 0 63 1 9 
  51. W=?
  52. .TXT 2 -63 1 15 
  53. a1,14,78,13
  54. [Ctrl][PgDn]
  55. .TXT 2 1 2 81 
  56. a2,80,78,150
  57. For samples of size n, n > 10, from a symmetric population with median 0, the 
  58. statistic W is approximately normal with mean 0 and standard deviation
  59. .EQN 3 21 4 27 
  60. σ:\((n*(n+1)*(2*n+1))/6)
  61. .TXT 5 -21 3 79 
  62. a3,78,76,194
  63. To test at the α significance level, calculate z, the upper α/2 point for 
  64. the normal distribution.  Reject the hypothesis of equal population medians 
  65. if W/σ is less than -z or greater than z.
  66. .TXT 4 0 1 12 
  67. a1,11,77,10
  68. Choose α:
  69. .EQN 0 13 1 10 
  70. α:.05
  71. .EQN 2 -13 1 14 
  72. TOL~.00001
  73. .EQN 0 27 1 8 
  74. x:1
  75. .EQN 1 36 3 9 
  76. W/σ=?
  77. .EQN 1 -63 1 34 
  78. z:root(1-cnorm(x)-.5*α,x)
  79. .EQN 0 48 1 9 
  80. z=?
  81.