Question: (a) Write an R function which uses `for` loops instead of `outer` to calculate the MW statistic. The Mann Whitney statistic is one of the



(a) Write an R function which uses `for` loops instead of `outer` to calculate the MW statistic.
The Mann Whitney statistic is one of the non-parametric statistics that describe how different two samples are. Suppose sx_i, i=1,...,ns and $Y_j, j=1,...,m$ are two observations from two populations. The Mann-Whitney statistic is computed as $$ U = \sum_{i=1}^n \sum_{j=1}^m S(x_i, Y-j) $$ where m U=SS(X,Y) i=1 j=1 5(x,y) = \begin{cases} 1, & \text{ if } x >y W 1/2, & \text{ if } x = y 0,& \text{ if } x
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
