Presentation is loading. Please wait.

Presentation is loading. Please wait.

Wilcoxon Rank-Sum Test

Similar presentations


Presentation on theme: "Wilcoxon Rank-Sum Test"— Presentation transcript:

1 Wilcoxon Rank-Sum Test
If X1, X2, … Xn is a sample of size n from a population, then the rank of Xi , R(Xi), is given by R(Xi) = number of Xjs ≤ Xi for each i. Compute midranks if there are tied values (i.e., average the ranks - later…). The Wilcoxon statistic is based on the sum of the ranks of the data in one of the two groups… Here's the process: pool the m observations from group1 with the n observations from group2 (total of m+n) and order them all from smallest to largest. assign ranks (or midranks) to the ordered data; smallest=rank1, next smallest=rank 2, etc. Let W = sum of the ranks of the observations from group1 (or group2) determine the p-value associated with your value of W and decide whether to reject the null hypothesis of no difference in the two population distributions if there are no ties, the p-value can be computed by looking at the actual distribution of all the permutations of the m+n ranks; or by looking at many samples of permutations of ranks; or by looking in Table A3 of the Appendix of our book Let's go over Example on page 38…hypothesis is that there is no difference in distributions of dry weights of herbicide treated and untreated plants.

2 dm output 'clear'; dm log 'clear'; options ls=80; data ex2_4_2;
The alternative is that the untreated plants will have a larger distribution of weights, so we'll use an upper-tailed test. Table A3 has critical values (both upper and lower) for a=.05, .025 and .01 when m,n range from 4 to 10… more extensive tables are available in the library and R and SAS will both give exact (and approximate) p-values for the Rank-Sum test. Look at the R code for doing the Wilcoxon test in the R#3 document … Let's look at the SAS solution to this… dm output 'clear'; dm log 'clear'; options ls=80; data ex2_4_2; input group $ weight datalines; u .55 u .67 u .63 u .79 u .81 u .85 u .68 t .65 t .59 t .44 t .60 t .47 t .58 t .66 t .52 t .51 ; proc rank data=ex2_4_2 out=rankwts ; var weight; ranks rwt; run; proc sort data=rankwts; by group; run; proc print data=rankwts; by group; sumby group; run; proc npar1way wilcoxon ; exact; class group; var weight; run; quit;


Download ppt "Wilcoxon Rank-Sum Test"

Similar presentations


Ads by Google