bellreg {bellreg} | R Documentation |
Fits the Bell regression model to overdispersed count data.
bellreg(
formula,
data,
approach = c("mle", "bayes"),
hessian = TRUE,
hyperpars = list(mu_beta = 0, sigma_beta = 10),
...
)
formula |
an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted. |
data |
an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which ypbp is called. |
approach |
approach to be used to fit the model (mle: maximum likelihood; bayes: Bayesian approach). |
hessian |
hessian logical; If TRUE (default), the hessian matrix is returned when approach="mle". |
hyperpars |
a list containing the hyperparameters associated with the prior distribution of the regression coefficients; if not specified then default choice is hyperpars = c(mu_beta = 0, sigma_beta = 10). |
... |
further arguments passed to either 'rstan::optimizing' or 'rstan::sampling'. |
bellreg returns an object of class "bellreg" containing the fitted model.
# ML approach:
mle <- bellreg(nf ~ lroll, data = faults, approach = "mle")
summary(mle)
# Bayesian approach:
bayes <- bellreg(nf ~ lroll, data = faults, approach = "bayes")
summary(bayes)