Example 1.: Postsurgical treatment The new postsurgical treatment is compared with the standard one. Data in the table are the recovery times in days: J*Q for the patients with the new treatment, Yj those for control. Used test: Kolmogorov-Smirnov. i Zi Ri Vi | _ vi - ... - Vi Xi 1 19 1 0 0.5 2 22 4 1 0.0 3 25 6 1 -0.5 4 26 7 0 0.0 5 28 8 1 -0.5 6 29 9 0 0.0 7 34 12 0 0.5 8 37 14 0 1.0 9 38 15 0 1.5 YJ 10 20 2 1 1.0 11 21 3 1 0.5 12 24 5 0 1.0 13 30 10 1 0.5 14 32 11 0 1.0 15 36 13 0 1.5 16 40 16 1 1.0 17 48 17 1 0.5 18 54 18 1 0.0 Example 1: Continuation Dmn = — • maxi^jv {^-Vi- ... -Vij = 3 By Table 29: PHQ{nD^n < 4) = 0.9271 PHo(nD+n < 5) = 0.9832 =* PHo(nD+n > 5) = 0.0629 PHo(nD+n > 6) = 0.0168. Notation: Af = m + n We do not reject the hypothesis H0. Example 2. Psychological counseling In a test of the effect of psychological counseling, 80 boys are divided at random into a control group of 40 to whom only the normal counseling facilities are available, and a treatment group of 40 who receive a special counseling. At the end of the study, an assessment is made of each boy who is then classified as having a good (1), fairly good (2), fairly poor (3), or poor (4) adjustment, with the following results: (1) (2) (3) (4) Total Treatment Control 5 7 7 9 16 15 12 9 40 40 Sum 12 16 31 21 80 H0 : no significance effect of special counseling Hi : results are better after special counseling Used test: Wilcoxon test with midranks • • • 5^40 70 Yí's midrank 7 n,- ..,y7 6.5 9 YS,.. •,VÍ6 20.5 15 Y17,.. •,*31 44 9 Y32,•• • J V40 70 m = n = 40, N = m + n = 80 40 Wfr= Y, [midrank of JQ] = 1720 EWft = = 1620 var W% = mn(N + 1) 12 ran ~T Í2 (d 3 = 10800 - 945.2 = 9854.8 (var W^)1/2 = 99.27 W*-EW* 100 N N — = 1.007 (var W^)1/2 99.27 < 0_1(O.95) = 1.64 Hypothesis is not rejected. The test indicates no significant effect of the special counseling on the prevention of the juvenile delinquency. Example 3: Effectiveness of a new medicament against headaches 15 patients got two bottles with pills, denoted A and B. They should always one pill when they suffered from headaches, alternating A and B (only the doctor knew which bottle contained the new medicament and which contained the standard one). 10 among 15 patients reported in favor of the new medicament. Is this result significant, can we claim that the new medicament is significantly better? Hypothesis Hi : There is no difference in the effects of two medicaments. Used test: the sign test 515 = the number of positive records among 15. Under Hi : Si5 has the binomial distribution 6(15, ^). PHl(S15 > 10) = £ ( ^ ) (|)15 = 0.1509 ^(#15 > 11) = 0.0592 ^(#15 > 12) = 0.0176. 10 positive records is not yet significant for rejecting the hypothesis. 11 positive records would be on the border of significance on the level 0.05. Example 4: Effect of thiamin on learning 74 children were divided in 37 matched pairs. One child in each pair was receiving B\. The table below gives the gain in IQ during the 6 weeks of experiment for 12 of the pairs. Used test: One-sample Wilcoxon test (with m id ranks) N wh = E Rt WN = H si9n Zi-Rt w N = hwt + ^-N(N + l) N~ 2 N " 4 i?f,... ,R~^ are the ranks of |Zi|,..., \ZN\. Under Hi (symmetry), the sign Z^ and R^~ are independent. This enables to calculate EWjy, Ew£ and var Wh : EW+ = 0 => EW^ = ^N(N + 1) 1 4 var W% = —N(N + 1)(27V + 1). Modification of Wilcoxon in the presence of nulls and ties: Assume that among \Zi\,..., \ZN\ are do nulls and from the remaining are e values different: d\ equal to the smallest d2 equal to the 2nd smallest • • • de equal to the largest, ^0 H~ d\ + ... + de = N. We omit zeros and calculate the midranks B4 for remaining \Zi . Wn = Y,i:Zi>oŘi is the modified Wilcoxon statistic. Corrected parameters of WN with respect to nulls and ties: EWN = ^N(N + 1) - ^d0(d0 + 1) var WN = —N(N + 1)(27V + 1) -^-d0(d0 + l)(2d0 + 1) - ^ É dM -1) (WN-EWN I as iV —^ co, where 0 is the standard normal distribution function. treated control i Yi Xi ^i — Yi — Xi sign Zi • Ri 1 14 8 6 8.0 2 18 26 -8 -10.0 3 2 -7 9 11.0 4 4 -1 5 6.5 5 -5 2 -7 -9.0 6 14 9 5 6.5 7 -3 0 -3 -4.0 8 -1 -4 3 4.0 9 1 13 -12 -12.0 10 6 3 3 4.0 11 3 3 0 0.0 12 3 4 -1 -2.0 wN= Yl Ri = 40 i:Zi>0 dg = I? di = 3, (I2 = 2 EWN = 39 - - = 38.5 2 var W^ = 161.75 Wjy - EWN (var Wtv)1/2 = 0.12 < 1.64 = 0_±(O.95) 40-38.5 ____ ____ __i 12.72 Hypothesis Hi is not rejected. The data do not confirm the effect of thiamin on learning. Example 5: IQ scores at four universities The table gives the IQ scores of 100 stage 1 students at each of four New Zealand universities: Auckland, Wellington, Canterbury and Otago. IQ 1 2 3 4 5 6 7 8 9 10 11 A 1 2 9 13 16 16 14 13 9 5 2 100 W 1 2 9 9 12 15 18 14 9 6 5 100 C 3 5 7 13 15 14 12 12 9 6 4 100 O 2 3 7 13 17 15 11 14 8 5 5 100 di 7 12 32 48 60 60 55 53 35 22 16 400 Hypothesis H0: There is not significance difference between the universities Used test: Kruskal=Wallis test with m id ranks N = 400, e = 11 different values, m = ri2 = us = ri4 = 100. i 7.8) = 0.0503 Because K* = 1.909 < 7.8, we do not reject the hypothesis. The data did not indicate a significant difference between the universities. Example 6: Effectiveness of hypnosis In a study of hypnosis, the emotions of fear (1), happiness (2), depression (3) and calmness (4) were requested (in random order) from each of eight subjects during the hypnosis. The following table gives the resulting measurements of skin potentials in millivolts. Hypothesis H2 : No significant difference between the four emotions. Used test: Friedman test for observations divided in blocks 1 2 3 4 5 6 7 8 23.1 57.6 10.5 23.6 11.9 54.6 21.0 20.3 22.7 53.2 9.7 19.6 13.8 47.1 21.0 20.3 22.5 53.7 10.8 21.1 13.7 39.2 13.7 16.3 22.6 53.1 8.3 21.6 13.3 37.0 14.8 14.8 Rij R2j R3j RAj R5j R6j R7j R8j Rj 4 4 3 4 1 4 4 3 27/8 3 2 2 1 4 3 3 4 22/8 1 3 4 2 3 2 1 2 18/8 2 1 1 3 2 1 2 1 13/8 p = 4 treatments, N = 8 blocks (8 patients) 7? • — iv^ 7? • Q n — 96 127V p — V p(p+ 1) 7^i L 27 + 20 13 j 8 2 5^2" R.j- + 22 8 8 = 7.72 1 ^2 2CP+1) -I)2 + (t 5^2 Table M: Ph2(Qn > 7.5) = 0.052 ?h2(Qn > 7.65) = 0.049 Because QN = 7.72 > 7.65, we reject the hypothesis. The data indicate a significant difference in the skin potentials. Example 7: Comparison of effects of four medicaments The following table presents the total number of coughs per days of seven patients, under three medicaments: heroin, 5 mg (1) dextromethorphan, 10 mg (2) codeine, 10 mg (3) placebo (4). The subscripts are the ranks for each patient Determine whether there is a significant difference between the four treatments. 1 2 3 4 5 6 7 R.j (1) 251 126 49 45 233 291 1385 2.43 (2) 207 180 123 85 232 208 1204 2.29 (3) 167 104 63 147 233 158 1611 2.0 (4) 301 120 186 100 250 183 1913 3.29 N = 7, p = 4 QN = 3.86 < 7.63 = the 95% critical value. We do not reject hypothesis of no significant difference between the treatments. However, let us still consider the difference between the codeine and placebo. In this case the Friedman test reduces to the sign test: 6 among 7 differences between the values for codeine and placebo are positive. For the binomial random variable B = 6(7, |) we have P(B = 7) = 0.0078, P(B = 6) = 0.0547, P(B > 6) = 0.0625 P(B = 7) + *yP(B = 6) = 0.05 for 7 = 0.77 « 0.8. Because our value 6 is on the border of significance 0.05, we should make the randomization, which leads to the conclusion that we should reject the hypothesis, that there is no difference between the codeine and placebo, with probability 0.8, and do not reject with probability 0.2. Example 8: Test of independence of performance in language and arithmetics From a group of 98 students enrolled for a statistics course, 9 are selected at random and given a simple arithmetic tests and an artificial language test. Using the Spearman test, we should test for independence of both performances. The following table gives the scores Li in language and Ai in arithmetics of the tested students. The Ri are the ranks with respect to the language scores and Si the ranks with respect to the arithmetics scores. i Li Ri Ai Si (Si — Ri) 1 50 6 38 8 4 2 23 2 28 6 16 3 28 3 14 1 4 4 34 4 26 4 0 5 14 1 18 2 1 6 54 9 40 9 0 7 46 5 23 3 4 8 52 7 30 7 0 9 53 8 27 5 9 E = 38 n Table 12: n = 9, a = 0.05 Ptf3( 0.05 a = 0.01 Ptf3( 0.01. Because 29. Example 9: Crying babies and their IQ Sperman correlation coefficient with midranks: We have observations Xi, ..., Xjy Yl, ..., YN and assume there are e\ different values among the Xi, among them d\ equal to the smallest, d^ equal to the 2nd smallest, etc., dei equal to the largest. Similarly, there are e^ different values among the Yi, among them /i equal to the smallest, f^ equal to the 2nd smallest, etc., fe2 equal to the largest. Let R\,..., R^ be the midranks of the Xi and SJ,..., Spj be the midranks of the Yi: The modified Spearman statistic is N Efl- 5** = 1761.5. (vai-tf, S**)1/2 = 384.4 Q. O 00 3 O i£2. co' o fD 00 o Ol ^1 Ol << • "O -l^ o KJ r+ V fD 1 CO 1 co" • O o> -h -1^ 5" II Q. a> 1 "O 1 3 1 Q. 1- 3 o • O co a> CJl K) K) K) M M M M M M M M M M K) M O CO 00 ^1 o> CJl -^ 00 K) M O CO 00 ^1 o> CJl -^ 00 K) M — K) K) M M M M M M M K) K) M M M M K) M K) M M M K) M CT> ^1 o> CO 00 CO K) o> M 00 CJl CJl 00 ^1 ^1 -^ 00 CO CJl ^1 O M M M M M M M M M M M M M M M M M M M M CJl CJl -^ 00 00 K) K) M M M M M M O o O O O O o CO CO ^ ^1 CJl M 00 K) -^ O CO 00 -^ 00 K) K) CO CO 00 o> 00 00 o -^ O M K) M M M M M M K) M M M ^1 M CO o> -^ M -^ M o> ^1 CO -^ -^ M CO K) K) CO -^ -^ CO o> CJl O o CJl O CJl O O CJl CJl CJl O o CJl o O O CJl O o o O K) K) K) M M M M M M M M M M K) M O CO 00 ^1 o> CJl -^ 00 K) O O 00 00 ^1 o> -^ -^ 00 K) M eP3 «*•* O O O o o O o o O O O CJl CJl CJl CJl O O CJl CJl o O o K) CJl 00 CJl K) CJl -1^ -1^ o CO O M 1__1 o M o> O o> K) K) K) l__i K) o K) 1 ■. o K) o> -ŕ> CO CO K) CJl K) o> K) M M K) 1 K) M K) CJl K) CT> K) K) K) K) K) CJl CJl K) CJl Ä «*•* CJl CJl CJl CJl CJl CJl CJl CJl ro Example 10: Pollution of Lake Michigan The data give the number of "odor periods" observed in each year of the period 1950-64. Hypothesis H : No change of pollution with the time Alternative: There was an upward trend in the pollution with the time In the table, J*Q is the year with the rank Ri = i, Yi is the pollution, and S* is the midrank of J. a • L ^^~ -L • • • • • J. \J • i Xi Yi st (S* - i)1 1 50 10 1 0 2 51 20 10 64 3 52 17 6.5 12.25 4 53 16 5 1 5 54 12 2 9 6 55 15 4 4 7 56 13 3 16 8 57 18 8 0 9 58 17 6.5 6.25 10 59 19 9 1 11 60 21 11 0 12 61 23 12.5 0.25 13 62 23 12.5 0.25 14 63 28 14.5 0.25 15 64 28 14.5 0.25 Test criterion N s*= £(s?-o2 which has the same distribution as the Spearman criterion under independence. Hence, if there are no ties, then under H3, ^* N3-N E