goodnessOfFit: goodness of fit for a count vector

Description Usage Arguments Value Examples

View source: R/goodnessOfFit.R

Description

The distribution can be Poisson, negetive binomial or zero inflated negative binomial (ZINB). For Poisson, glm is used for the fitting For NB, glm.nb is used for the fitting. For ZINB, a NB is first fitted and then zeroinfl is used for fitting

Usage

1

Arguments

count

a count vector

distribution

"poisson" for Poisson distribution, "nb" for the negative binomial distribution, "zinb" for the zero inflated negative binomial distribution

plot

If TRUE, plot the empirical and theoretical density and cumulative distribution function using package fitdistrplus

Value

a data frame with the pvalue of the goodness of fit and whether the fit is converged

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
gene1 = rnbinom(500, size = 0.1, mu = 1)
print(goodnessOfFit(gene1, "poisson"))
print(goodnessOfFit(gene1, "nb"))
print(goodnessOfFit(gene1, "zinb"))

gene2 = rpois(500, lambda = 1)
print(goodnessOfFit(gene2, "poisson"))
print(goodnessOfFit(gene2, "nb"))
print(goodnessOfFit(gene2, "zinb"))

## End(Not run)

chenlab-sj/nbid documentation built on Nov. 4, 2019, 8:50 a.m.