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 oneof the non-parametric statistics that describe how different two samples are. Suppose

(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 y S(x,y) = {1/2, 1/2, if x=y 0, if a ')) + 0.5 * sumCouter(x, y, == ")) } n

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!