Coder Social home page Coder Social logo

zir's Introduction

ZIR (Zero-Inflated Rank Test)

Introduction

When the underlying distribution of data is unknown, usually we use nonparametric test to test the difference between groups. For example, Wilcoxon rank sum test (Mann-Whitney U test) is often used for two group comparison, and Kruskal Wallis test is used for multiple group comparison. However, sometimes the data may contain many zeroes and the traditional rank based test, such as Wilcoxon rank sum test and Kruskal Wallis test have low power due to the ties in the data.

Here we developed a R package called ZIR (Zero-Inflated Rank Test), which has more power than the traditional rank based test when the data contain many zeroes, and have similar power as the traditional rank based test when the data don't have too many zeros.

Installation

You can install our ZIR package from Github

install.packages("devtools")
devtools::install_github("chvlyl/ZIR")
library(ZIR)

Basic Usage

Modified Wilcoxon rank sum test (ZIW) for zero-inflated data

x <- c(rep(0,5),rlnorm(20, meanlog = 0, sdlog = 1))
y <- c(rep(0,10),rlnorm(20, meanlog = 2, sdlog = 1))
ziw(x, y, perm = FALSE)

If you want to use permutations to generate pvalues, you can set perm to TRUE

ziw(x, y, perm = TRUE)

Modified Kruskal Wallis test (ZIKW) for zero-inflated data

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)

If you want to use permutations to generate pvalues, you can set perm to TRUE

zikw(x, perm = TRUE)

Citation

Wanjie Wang, Eric Z. Chen and Hongzhe Li (2015). Rank-based tests for compositional distributions with a clump of zeros. Submitted.

zir's People

Contributors

chvlyl avatar sophia0713 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.