pairwise.bzinb: Pairwise underlying correlation based on bivariate...

View source: R/base.R

pairwise.bzinbR Documentation

Pairwise underlying correlation based on bivariate zero-inflated negative binomial (BZINB) model

Description

For each pair of rows in the data, underlying corelation (ρ) is calculated based on bivariate zero-inflated negative binomial (BZINB) model.

Usage

pairwise.bzinb(
  data,
  nonzero.prop = TRUE,
  fullParam = FALSE,
  showFlag = FALSE,
  nsample = NULL,
  ...
)

Arguments

data

a matrix with nonnegative integers. rows represent the feature (or gene), and columns represent the sample. If not integers, rounded to the nearest integers.

nonzero.prop

logical. If TRUE, proportion of nonzero for each of the pair is returned.

fullParam

logical. If TRUE, estimates of all parameters are returned.

showFlag

logical. If TRUE, for each pair, the estimates are printed out.

nsample

positive integer. If provided, nsample random pairs will only be considered for correlation. A non-integer will be rounded to the nearest integer.

...

Other arguments passed on to bzinb function.

Value

a table of pairwise underlying correlation (ρ) and related statistics.

  • 1 row number of the first vector of the pair

  • 2 row number of the second vector of the pair

  • pair row numbers of the pair

  • rho underlying correlation estimate

  • se.rho standard error of the underlying correlation estimate

  • nonzero.1, nonzero.2 non-zero proportion of the first and the second vector. Returned if nonzero.prop is TRUE.

  • nonzero.min pairwise minimum of non-zero proportions Returned if nonzero.prop is TRUE.

  • a0, a1, ..., p4 parameter estimates

  • se.a0, se.a1, ..., se.p4 standard error of the parameter estimates

  • logLik log-likelihood of the maximum likelihood estimates

Author(s)

Hunyong Cho, Chuwen Liu, Jinyoung Park, and Di Wu

References

Cho, H., Liu, C., Preisser, J., and Wu, D. (In preparation), "A bivariate zero-inflated negative binomial model for identifying underlying dependence"

Examples

# generating four random vectors
set.seed(7)
data1 <- rbzinb(n = 20, a0 = 0.5, a1 = 1, a2 = 1, 
                b1 = 1, b2 = 1, p1 = 0.5, p2 = 0.2, 
                p3 = 0.2, p4 = 0.1)
set.seed(14)
data2 <- rbzinb(n = 20, a0 = 0.5, a1 = 1, a2 = 1, 
                b1 = 2, b2 = 2, p1 = 0.5, p2 = 0.2, 
                p3 = 0.2, p4 = 0.1)
data3 <- t(cbind(data1, data2))

# calculating all pairwise underlying correlations
## Not run: pairwise.bzinb(data3, showFlag = TRUE)


bzinb documentation built on Oct. 30, 2022, 1:05 a.m.