zibellreg {bellreg} | R Documentation |
ZiBell regression model
Description
Fits the Bell regression model to overdispersed count data.
Usage
zibellreg(
formula,
data,
approach = c("mle", "bayes"),
hessian = TRUE,
link1 = c("logit", "probit", "cloglog", "cauchy"),
link2 = c("log", "sqrt", "identity"),
hyperpars = list(mu_psi = 0, sigma_psi = 10, mu_beta = 0, sigma_beta = 10),
...
)
Arguments
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". |
link1 |
assumed link function for degenerate distribution (logit, probit, cloglog, cauchy); default is logit. |
link2 |
assumed link function for count distribution (log, sqrt or identiy); default is log. |
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_psi = 0, sigma_psi = 10, mu_beta = 0, sigma_beta = 10). |
... |
further arguments passed to either |
Value
zibellreg returns an object of class "zibellreg" containing the fitted model.
Examples
# ML approach:
data(cells)
mle <- zibellreg(cells ~ smoker+gender|smoker+gender, data = cells, approach = "mle")
summary(mle)
# Bayesian approach:
bayes <- zibellreg(cells ~ 1|smoker+gender, data = cells, approach = "bayes", refresh = FALSE)
summary(bayes)