fit_counts {countfitteR}R Documentation

Fit counts to distributions

Description

Fit counts to distributions

Usage

fit_counts(counts_list, separate = TRUE, model, level = 0.95, ...)

Arguments

counts_list

A list of count data. Each count should be in separate column, rows should represent values of that counts.

separate

logical. If TRUE, each count is separately fitted to the model. If FALSE, all counts are fitted to the same models having the count name as the independent variable.

model

single character: "pois", "nb", "zinb", "zip", "all". If "all", all possible model are fitted.

level

Confidence level, default is 0.95.

...

Dots parameters are ignored.

Value

The list of fitted models. Names are names of original counts, an underline and a name of model used. confint is a matrix with the number of rows equal to the number of parameters. Rownames are names of parameters. The columns contain respectively lower and upper confidence intervals.

Examples

df <- data.frame(poisson = rpois(25, 0.3), binomial = rbinom(25, 1, 0.8))
fit_counts(df, model = "pois") 

[Package countfitteR version 1.4 Index]