Description Usage Arguments Value References Examples
Modified Kruskal Wallis test (ZIKW) for zero-inflated data
1 |
x |
a numeric vector of data values with groups defined by the group parameter, or a list of numeric data vectors with each vector in the list as one group. |
group |
a vector giving the groups for the corresponding elements of x. Ignored if x is a list. |
perm |
use permutations to calculate the pvalue |
perm.n |
number of permutations used for pvalue calculation |
modified Kruskal Wallis test statistic and pvalue
Wanjie Wang, Eric Z. Chen and Hongzhe Li (2015). Rank-based tests for compositional distributions with a clump of zeros. Submitted.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## x is a list
x <- list(group1 = c(rep(0,5),rlnorm(20, meanlog = 0, sdlog = 1)),
group2=c(rep(0,10),rlnorm(20, meanlog = 1, sdlog = 1)),
group3=c(rep(0,15),rlnorm(20, meanlog = 2, sdlog = 1)))
zikw(x, perm = FALSE)
## x is a vector
x <- c(c(rep(0,5),rlnorm(20, meanlog = 0, sdlog = 1)),
c(rep(0,10),rlnorm(20, meanlog = 1, sdlog = 1)),
c(rep(0,15),rlnorm(20, meanlog = 2, sdlog = 1)))
group <- c(rep('group1',25),rep('group2',30),rep('group3',35))
zikw(x, group, perm = FALSE)
## use permutations to calculate the pvalue
## Not run: zikw(x, group, perm = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.