Description Usage Arguments Value Examples
View source: R/goodnessOfFit.R
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
1 | goodnessOfFit(count, distribution, plot = F)
|
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 |
a data frame with the pvalue of the goodness of fit and whether the fit is converged
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.