1、1Learning ObjectivesvLearn advantages and disadvantages of nonparametric statistics.vNonparametric tests:Testing randomness of a single sample:Run testTesting differencevTwo independent samples:Mann-Whitney-Wilcoxon Rank Sum testTwo-sample z/t testvTwo dependent samples.Wilcoxon signed rank testPair
2、ed sample t testv2 independent samples.Kruskal-Wallis testOne-way ANOVAv2 samples with blocking:Friedman testRCBDCorrelation:Spearmans rank correlation coefficient2022/8/2Copyright by Jen-pei Liu,PhD2Introduction Assumption for t-test or correlation(regression)coefficients Normality Equal variance I
3、ndependence vNot all data satisfy these assumptions!3Parametric v.s.Nonparametric statisticsvParametric statistics mainly are based on assumptions about the populationEx.X has normal population for t-test,or ANOVA.Requires interval or ratio level data.vNonparametric statistics depend on fewer assump
4、tions about the population and parameters.“distribution-free”statistics.Most analysis are based on rank.Valid for ordinal data.4Advantages and Disadvantages of Nonparametric TechniquesvAdvantages There is no parametric alternativeNominal data or ordinal data are analyzedLess complicated computations
5、 for small sample sizeExact method.Not approximation.vDisadvantagesLess powerful if parametric tests are available.Not widely available and less well knowFor large samples,calculations can be tedious.2022/8/2Copyright by Jen-pei Liu,PhD5Wilcoxon Signed-rank TestExample:脊柱後側凸病患,其平均Pimax值是否小於110 cm H2
6、O Ho:110 vs.Ha:W1-/2,n or TSR 30)Test statistic:(1)/4(1)(21)/24SRTn nzn nn2022/8/2Copyright by Jen-pei Liu,PhD9Wilcoxon Signed-rank TestExample:X=pimax Rank of sign*rankXX-110abs(X-110)abs(X-110)sign abs(X-110)54.8-55.255.230062.0-48.048.020063.3-46.746.710044.2-65.865.840040.3-69.769.750036.3-73.77
7、3.360019.3-90.790.790024.6-85.485.480026.6-83.483.4700Sum02022/8/2Copyright by Jen-pei Liu,PhD10Wilcoxon Signed-rank TestN=930 Exact MethodTSR=0=0.05,T0.025,9=6 TSR=0 T0.025,9=6Reject H0 at the 0.05 level.2022/8/2Copyright by Jen-pei Liu,PhD11Quantiles of the Wilcoxon Signed Ranks Test Statistic2022
8、/8/2Copyright by Jen-pei Liu,PhD12Mann-Whitney-Wilcoxon Rank Sum TestvTwo independent random samplesvExample:Weight gain at one month by two baby formulas A:6.9,7.6,7.3,7.6,6.8,7.2,8.0,5.5,7.3 B:6.4,6.7,5.4,8.2,5.3,6.6,5.8,5.7 6.2,7.1 2022/8/2Copyright by Jen-pei Liu,PhD13Mann-Whitney-Wilcoxon Rank
9、Sum TestvMethodRank the observations in the combined sample from the smallest(1)to the largest(n1+n2)In case of ties,use the averaged rank Compute the sum of ranks for each sample 2022/8/2Copyright by Jen-pei Liu,PhD14Mann-Whitney-Wilcoxon Rank Sum Test A B WeightRankWeightRank 6.9116.477.616.56.797
10、.314.55.427.616.58.2196.8105.317.2136.688.0185.855.535.747.314.56.26 7.112sum117732022/8/2Copyright by Jen-pei Liu,PhD15Mann-Whitney-Wilcoxon Rank Sum TestExact Method for Small Samples(n1+n2 30)Null hypothesis:H0:The location of population distributions for 1 and 2 are identical.Alternative hypothe
11、sis:Ha:The location of the population distributions are shifted in either directions(a two-tailed test).2022/8/2Copyright by Jen-pei Liu,PhD16Mann-Whitney-Wilcoxon Rank Sum Test3.Test statistics:For a two-tailed test,use U,where T1 is the rank sums for samples 1.111n(n+1)U=T-22022/8/2Copyright by Je
12、n-pei Liu,PhD17Mann-Whitney-Wilcoxon Rank Sum Test4.Rejection rule:For the two-tailed test and a given value of significance,reject the null hypothesis of no difference ifU w1-/2,n1,n2 w1-/2,n1,n2=n1n2-w/2,n1,n2 2022/8/2Copyright by Jen-pei Liu,PhD18Mann-Whitney-Wilcoxon Rank Sum TestMethod for larg
13、er Samples(n1+n230)Test Statistics:121212/2/2U-(n n/2)Z=,n n(n+n+1)/12Reject the null hypothesis is Z z2022/8/2Copyright by Jen-pei Liu,PhD19Mann-Whitney-Wilcoxon Rank Sum TestExample:reject H0 that no difference exists between two baby formulas on weight gain12129,n10,nn19n 9(9+1)U=117-=7220.025,9,
14、100.975,9,10120.025,9,100.975,9,10Two-tailed test 0.05w=21;w=n n -w=(9)(10)-21=69.Since U=72 w=69,2022/8/2Copyright by Jen-pei Liu,PhD20Critical Values for the Wilcoxon/Mann-Whitney Test(U)2022/8/2Copyright by Jen-pei Liu,PhD21Kruskal-Wallis TestvK independent samplesvExample:body weights in gram of
15、 Wistar rats in a repeated dose toxicity study 2022/8/2Copyright by Jen-pei Liu,PhD22Kruskal-Wallis TestvData set:body weights in gram of Wistar rats in a repeated dose toxicity study vControl:295.1 277.9 299.4 280.6 285.7 299.2 279.7 277.4 299.2 287.8 292.0 318.8 280.8 292.9 305.2vLow dose:287.3 28
16、9.5 278.4 281.8 264.9 252.0 284.7 268.9 305.6 295.7 287.6 254.7 292.7 267.9 300.8vMiddle dose:247.5 281.1 284.5 295.0 285.9 273.7 244.1 272.7 262.1 278.8 298.3 298.5 293.5 259.6 275.3vHigh dose:263.8 255.6 267.2 259.6 238.2 240.4 255.6 255.5 242.5 296.6 246.0 282.7 254.0 280.6 268.2 2022/8/2Copyrigh
17、t by Jen-pei Liu,PhD2312.4 Kruskal-Wallis TestvMethods:Rank the combined sample from the smallest(1)to the largest(n1+n2+nt)In case of ties,use the averaged rankCompute the sums of ranks for each samples,Ri 2022/8/2Copyright by Jen-pei Liu,PhD2412.4 Kruskal-Wallis TestMethods:1.Null hypothesis:H0:Th
18、e locations of the distributions of all of the k2 populations are identical.2.Alternative hypothesis:Ha:The locations of at least two of the k frequency distributions differ2022/8/2Copyright by Jen-pei Liu,PhD2512.4 Kruskal-Wallis Test3.Test statistics:4.Rejection region:Reject H0 if with(k-1)degree
19、s of freedom21123(1)(1)kiiiRHnn nn2H 2022/8/2Copyright by Jen-pei Liu,PhD26Kruskal-Wallis TestControl:295.1(49)277.9(26)299.4(56)280.6(30.5)285.7(38)299.2(54.5)279.7(29)277.4(25)299.2(54.5)287.8(42)292.0(44)318.8(60)280.8(32)292.9(46)305.2(58);sum=644.5Low dose:287.3(40)289.5(43)278.4(27)281.8(34)26
20、4.9(17)252.0(7)284.7(37)268.9(21)305.6(59)295.7(50)287.6(41)254.7(9)292.7(45)267.9(19)300.8(57);sum=506.5vMiddle dose:247.5(6)281.1(33)284.5(36)295.0(48)285.9(39)273.7(23)244.1(4)272.7(22)262.1(15)278.8(28)298.3(52)298.5(53)293.5(47)259.6(13.5)275.3(24);sum=443.5vHigh dose:263.8(16)255.6(11.5)267.2(
21、18)259.6(13.5)238.2(1)240.4(2)255.6(11.5)255.5(10)242.5(3)296.6(51)246.0(5)282.7(35)254.0(8)280.6(30.5)268.2(20);sum=236.0 2022/8/2Copyright by Jen-pei Liu,PhD2712.4 Kruskal-Wallis TestExample:Reject H0 that weights are the same for all groups1234241222220.05,315,15,15,15,n4x1560123(1)(1)644.5506443
22、.523612 3(60 1)60(60 1)15151515 18.92667.81iiinnnnRHnn nn2022/8/2Copyright by Jen-pei Liu,PhD28Quantiles of the Kruskal-Wallis Test Statistic for Small Sample Sizes2022/8/2Copyright by Jen-pei Liu,PhD29統計歷史人物小傳Frank Wilcoxon(1892-1965)vPhD in organic chemistry from Cornell in 1924vResearch in fungic
23、ide and insecticide from 1924-1943Boyce Thompson Institute for Plant ResearchvAmerican Cyanamid from 1943-1957vMore than 70 papers in plant physiology 2022/8/2Copyright by Jen-pei Liu,PhD30統計歷史人物小傳Frank Wilcoxon(1892-1965)vApply statistical methods such as t test to plant pathology and discovered th
24、ey are inadequate.vHe developed the methods based on ranksvHe did not know whether the method is correct or not.vHe sent a manuscript of 4 pages to Biometrics in 1945 to let the referees tell him whether the method is correct or not.vThe rest is the history of an new era of nonparametric statistics.2022/8/2Copyright by Jen-pei Liu,PhD31SummaryvWilcoxon Signed-rank TestvMann-Whitney-Wilcoxon TestvKruskal-Wallis Test