fitModels | R Documentation |
A wrapper function that fits the specified models for each taxon of the count data and computes the mean difference (MD) and zero probability difference (ZPD) between estimated and observed values.
fitModels(
object,
assay_name = "counts",
models = c("NB", "ZINB", "DM", "ZIG", "HURDLE"),
scale_HURDLE = c("default", "median"),
verbose = TRUE
)
object |
a phyloseq object, a TreeSummarizedExperiment object, or a matrix of counts. |
assay_name |
the name of the assay to extract from the
TreeSummarizedExperiment object (default |
models |
character vector which assumes the values |
scale_HURDLE |
character vector, either |
verbose |
an optional logical value. If |
list of data.frame
objects for each model. The first two
columns contain the properly transformed observed values for mean and zero
proportion, while the third and the fourth columns contain the estimated
values for the mean and the zero rate respectively.
fitNB
, fitZINB
, fitDM
,
fitZIG
, and fitHURDLE
for the model estimations,
prepareObserved
for raw counts preparation, and
meanDifferences
for the Mean Difference (MD) and Zero
Probability Difference (ZPD) computations.
# Generate some random counts
counts <- matrix(rnbinom(n = 600, size = 3, prob = 0.5),
nrow = 100, ncol = 6)
# Estimate the counts assuming several distributions
GOF <- fitModels(
object = counts, models = c(
"NB", "ZINB",
"DM", "ZIG", "HURDLE"
), scale_HURDLE = c("median", "default")
)
head(GOF)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.