Week 1: Introduction to some nonparametric and computer intensive (re-sampling) approaches: the sign test, Wilcoxon tests and multi-sample extensions, Spearman s rank correlation; the Bootstrap. (ch14 &15) [pp188-05] Non-parametric (Distribution-free) approaches p188 CN The standard classical approaches to statistical analysis we have discussed assume 1) data behave like SRS s from normal distributions ) constant variance when there are more than one population involved If there are violations of these assumptions we can try either of the following: 1) use a transformation to bring the data into line with our assumptions ) use a less restrictive procedure, which does not impose any particular parametric model upon the data (i.e. non-parametric or distribution-free methods) 1
We will discuss the following non-parametric procedures Design independent samples (CRD) Paired samples More than independent samples (CRD) More than blocked samples (RBD) Parametric Test Non-parametric Test Pooled t-test Wilcoxon s Rank Sum Test t-test on Sign test or differences Wilcoxon s (paired t-test) Signed Rank One-way ANOVA F-test Two-way ANOVA F-test Test Kruskal Wallace Test Friedman Test MINITAB commands: Stats > Nonparametrics
Wilcoxon Rank Sum test (also known as Mann-Whitney test) p188 CN Example p 188 CN We take a SRS of 6 students who are Botany majors, and another SRS of 5 students who are Psychology majors and find that their final course grades are: Botany majors Psychology majors C+ B B- C A- D- D+ B+ A+ C+ B+ Is there evidence of a difference in achievement levels between the two types of students? 3
Sol: Botany Rank Psychology Rank C+ 4.5 B 7 B- 6 C 3 A- 10 D- 1 D+ B+ 8.5 A+ 11 C+ 4.5 B+ 8.5 Rank Sum 4 = T1 4 = T H0: the two populations are identical H1: populations differ in location Test statistic T = sum of the ranks of the smaller of the two independent samples (or for either if n1 = n) In our example T = 4 From Wilcoxon s rank sum test table, p-value > 0.05 x = 0.10 and so no evidence of a difference at the 10% level. 4
MINITAB output Mann-Whitney Test and CI: Psy_ranks, Bot_ranks N Median Psy_ranks 5 4.500 Bot_ranks 6 7.50 Point estimate for ETA1-ETA is -.000 96.4 Percent CI for ETA1-ETA is (-7.500,.497) W = 4.0 Test of ETA1 = ETA vs ETA1 not = ETA is significant at 0.3153 The test is significant at 0.3131 (adjusted for ties) Note n i ( n 1 + n + 1) µ T = and i nn 1 ( n 1 + n + 1) σ = i = 1, and for Ti 1 large sample sizes the distribution of T1 is approximately normal and so the normal tables can be used to find approximate p-values. 5
Kruskal-Wallace Test p191 CN Example p191 Sample 1 3 Sol: 9 1 5 10 4 7 11 1 H0: The 3 distributions are identical H1: Not all the distributions are the same Sample 1 3 9(6) 1(9) () 5(4) 10(7) 4(3) 7(5) 11(8) 1(1) T i 15 4 6 6
Kruskal-Wallace Statistic 1 T H = i 3( N + 1) where T N( N + 1) n i s are i the rank sums, N = total sample size Reject if H > χ t 1, α In our example 1 15 4 6 H = + + 3(9 + 1) = 7. 9(9 + 1) 3 3 3 χ = 5.99 31,0.05 and so reject H0. MINITAB output Kruskal-Wallis Test: score versus group Kruskal-Wallis Test on score Ave group N Median Rank Z 1 3 7.000 5.0 0.00 3 11.000 8.0.3 3 3.000.0 -.3 Overall 9 5.0 H = 7.0 DF = P = 0.07 * NOTE * One or more small samples 7
Example p19 CN Paired data p19 CN Suppose we want to compare two newly marketed wines, RioSamba (RS) and CubaSalsa (CS). We have 10 tasters, each taster tastes each wine. They rate both wines on a 0-10 scale, with 10 being the best, yielding: Taster 1 3 4 5 6 7 8 9 10 RS 10 8 10 9 7 8 10 8 8 6 CS 8 8 7 5 6 8 4 5 3 7 Test the null hypothesis of equivalence of the wines. 8
Sign Test Taster 1 3 4 5 6 7 8 9 10 RS 10 8 10 9 7 8 10 8 8 6 CS 8 8 7 5 6 8 4 5 3 7 Diff + 0 +3 +4 +1 0 +6 +3 +5-1 Test statistic (X) is the number of positive differences (or negative differences). The smaller is a bit easier to work with. X~ Bin (8, 0.5) In this example, the number negative differences = 1 p value= P( X 1) = (0.0039 + 0.0313) = 0.07 - This test is quite wasteful of information as it throws away the magnitudes of the differences and only retains the signs. 9
Wilcoxon s signed rank test p 193 CN Taster 1 3 4 5 6 7 8 9 10 RS 10 8 10 9 7 8 10 8 8 6 CS 8 8 7 5 6 8 4 5 3 7 Diff + 0 +3 +4 +1 0 +6 +3 +5-1 Rank 3 4.5 6 1.5 8 4.5 7 1.5 Let T+ = sum of ranks corresponding to the differences that were positive = 34.5 T- = sum of ranks corresponding to the differences that were negative = 1.5 For non-directional tests (i.e. two-sided tests) use the test statistic T =smaller of T+ or T- and the tables for the Wilcoxon s signed rank test gives PT ( 3) 0.05 and so p-value 0.05. If the alternative is one-sided: H1: RS has higher ratings than CS then T- which is 3 has p-value less than 0.05/ = 0.05 and so we reject H0. 10
Note: if n 5, under H0, T+ (or T-) has approximately a normal distribution with µ = nn ( + 1) nn ( + 1)(n + 1) and σ =. 4 4 Eg in this example with n=8 (this is not greater than 5) and T- =1.5 Z = -.31 and from standard normal tables, p-value = x 0.01 = 0.0 11
Friedman Test for a RBD p194 CN H0: The distributions for the k treatments within each block are identical H1: at least two distributions differ in location Example p194 CN Treatment 1 3 Block 1 9 1 Block 5 10 4 Block 3 7 11 1 Sol Treatment 1 3 Block 1 9() 1(3) (1) Block 5() 10(3) 4(1) Block 3 7() 11(3) 1(1) Rank sum 6 9 3 1
Test statistic: 1 F = Tt 3 b( t + 1) bt( t + 1) Reject H0 if F > χ t 1, α In our example F = 1 3 3(3+ 1) = 6 (36 81 9) + + 3 3(3+ 1) 31,0.05 χ = 5.99 and so we reject H0. Note: There are tables exact critical values available which are recommended for small sample sizes (like this example) Results for: Eg_Friedman'Test.MTW Friedman Test: Response versus Treatment blocked by Block S = 6.00 DF = P = 0.050 Sum of Treatment N Est Median Ranks 1 3 7.000 6.0 3 11.000 9.0 3 3 1.000 3.0 Grand median = 6.333 13
r S = 1 Rank correlation p 195 6 d i nn ( 1) Two students were asked to rate 8 textbooks for a course on a scale 0-0. The data are shown below: Row Textbook Student1 Student 1 A 4 4 B 10 6 3 C 18 0 4 D 0 14 5 E 1 16 6 F 8 7 G 5 11 8 H 9 7 Calculate the rank correlation between the two ratings and test whether there is a linear correlation between the two ratings. 14
Sol: Data Display Row Textbook Student1 Student rk1 rk d d 1 A 4 4 1 1 1 B 10 6 5 3 9 3 C 18 0 7 8-1 1 4 D 0 14 8 6 4 5 E 1 16 6 7-1 1 6 F 8 1 4-3 9 7 G 5 11 3 5-4 8 H 9 7 4 3 1 1 Descriptive Statistics: d Variable Sum d 30.00 r S =0.643 Test H 0 : ρ S = 0 H 1 : ρ S 0 t = r S n 1 r S =.057~ t n = t with 6 df 15