Design-based versions of k-sample rank tests. The built-in tests are all for location hypotheses, but the user could specify others.

1 2 | ```
svyranktest(formula, design,
test = c("wilcoxon", "vanderWaerden", "median","KruskalWallis"), ...)
``` |

`formula` |
Model formula |

`design` |
A survey design object |

`test` |
Which rank test to use: Wilcoxon, van der Waerden's normal-scores
test, Mood's test for the median, or a function |

`...` |
for future expansion |

Object of class `htest`

Lumley, T., & Scott, A. J. (2013). Two-sample rank tests under complex sampling. BIOMETRIKA, 100 (4), 831-842.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ```
data(api)
dclus1<-svydesign(id=~dnum, weights=~pw, fpc=~fpc, data=apiclus1)
svyranktest(ell~comp.imp, dclus1)
svyranktest(ell~comp.imp, dclus1, test="median")
svyranktest(ell~stype, dclus1)
svyranktest(ell~stype, dclus1, test="median")
## upper quartile
svyranktest(ell~comp.imp, dclus1, test=function(r,N) as.numeric(r>0.75*N))
quantiletest<-function(p){
rval<-function(r,N) as.numeric(r>(N*p))
attr(rval,"name")<-paste(p,"quantile")
rval
}
svyranktest(ell~comp.imp, dclus1, test=quantiletest(0.5))
svyranktest(ell~comp.imp, dclus1, test=quantiletest(0.75))
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.