Count Regression Models Based on the Bell Distribution

Bell regression models for count data with overdispersion. The implemented models account for ordinary and zero-inflated regression models under both frequentist and Bayesian approaches. Theoretical details regarding the models implemented in the package can be found in Castellares et al. (2018) and Lemonte et al. (2020) .


bellreg

R buildstatus CRAN_Status_Badge Downloads TotalDownloads R-CMD-check

The goal of bellreg is to provide a set of functions to fit regression models for count data with overdispersion using the Bell distribution. The implemented models account for ordinary and zero-inflated regression models under both frequentist and Bayesian approaches. Theoretical details regarding the models implemented in the package can be found in Castellares et al. (2018) doi:10.1016/j.apm.2017.12.014 and Lemonte et al. (2020) doi:10.1080/02664763.2019.1636940.

Installation

You can install the development version of bellreg from GitHub with:

# install.packages("devtools")
devtools::install_github("fndemarqui/bellreg")

Example

library(bellreg)

data(faults)

# ML approach:
mle <- bellreg(nf ~ lroll, data = faults, approach = "mle", init = 0)
summary(mle)
#> Call:
#> bellreg(formula = nf ~ lroll, data = faults, approach = "mle", 
#>     init = 0)
#> 
#> Coefficients:
#>               Estimate     StdErr z.value   p.value    
#> (Intercept) 0.98524220 0.33219474  2.9659  0.003018 ** 
#> lroll       0.00190934 0.00049004  3.8963 9.766e-05 ***
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> 
#> logLik = -88.96139   AIC = 181.9228

# Bayesian approach:
bayes <- bellreg(nf ~ lroll, data = faults, approach = "bayes", refresh = FALSE)
summary(bayes)
#> 
#> bellreg(formula = nf ~ lroll, data = faults, approach = "bayes", 
#>     refresh = FALSE)
#> 
#>              mean se_mean    sd  2.5%   25%   50%   75% 97.5%    n_eff  Rhat
#> (Intercept) 0.984   0.007 0.334 0.331 0.758 0.978 1.213 1.627 2222.313 1.001
#> lroll       0.002   0.000 0.000 0.001 0.002 0.002 0.002 0.003 2478.992 1.001
#> 
#> Inference for Stan model: bellreg.
#> 4 chains, each with iter=2000; warmup=1000; thin=1; 
#> post-warmup draws per chain=1000, total post-warmup draws=4000.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("bellreg")

0.0.2.2 by Fabio Demarqui, 2 years ago


https://github.com/fndemarqui/bellreg, https://fndemarqui.github.io/bellreg/


Report a bug at https://github.com/fndemarqui/bellreg/issues


Browse source code at https://github.com/cran/bellreg


Authors: Fabio Demarqui [aut, cre, cph] , Marcos Prates [ctb] , Fredy Caceres [ctb] , Andrew Johnson [ctb]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports dplyr, extraDistr, Formula, magic, MASS, methods, numbers, LambertW, loo, purrr, Rcpp, Rdpack, rstan, rstantools

Suggests knitr, rmarkdown, testthat

Linking to BH, Rcpp, RcppEigen, rstan, StanHeaders

System requirements: GNU make


Imported by rsurv.


See at CRAN