Title: | Fractional Binomial Regression Model |
Version: | 1.5.0 |
Description: | Fit a fractional binomial regression model and extended zero-inflated negative binomial regression model to count data with excess zeros using maximum likelihood estimation. Compare zero-inflated regression models via Vuong closeness test. |
License: | MIT + file LICENSE |
Imports: | bbmle, frbinom, pscl, agridat |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
Suggests: | knitr, rmarkdown |
NeedsCompilation: | no |
Packaged: | 2024-10-22 22:46:06 UTC; leeje |
Author: | Jeonghwa Lee |
Maintainer: | Jeonghwa Lee <leejb@uncw.edu> |
Repository: | CRAN |
Date/Publication: | 2024-10-25 08:00:02 UTC |
Extended zero-inflated negative binomial regression
Description
Fit extended zero-inflated negative binomial regression model via maximum likelihood.
Usage
ZINB2(y, x)
Arguments
y |
A response vector. |
x |
A data frame with covariates. |
Details
The model regresses all the parameters– zero-inflation component \pi
(with logit link), and both the mean \mu
and dispersion parameter \theta
(with log link)– on covariates.
Value
A list of log-likelihood, estimated coefficients, and maximum likelihood estimation results.
References
Breece, C. and Lee, J. (2024) Fractional binomial regression model for count data with excess zeros.https://arxiv.org/html/2410.08488v1
Examples
library(agridat)
library(bbmle)
sample<-sample(270, 30)
my_y<-ridout.appleshoots$roots[sample]
my_x<-data.frame(pho=ridout.appleshoots$pho[sample])
ZINB2(y=my_y, x=my_x )
Fractional binomial regression model
Description
Fit a fractional binomial regression model via maximum likelihood.
Usage
fbglm(y, x)
Arguments
y |
A response vector. |
x |
A data frame with covariates. |
Details
Fractional binomial distribution can be considered as zero-inflated, over-dispersed binomial model, and it has three parameters
(p,H,c)
in addition to the number of trials n
.
We use a specific parametrization such that p,H,c \in (0,1)
, and
regress these parameters with logit link on the covariates, while letting n
as the maximum of the response y
.
Value
A list of log-likelihood, estimated coefficients, and maximum likelihood estimation results.
References
Breece, C. and Lee, J. (2024) Fractional binomial regression model for count data with excess zeros.https://arxiv.org/html/2410.08488v1
Examples
library(agridat)
library(bbmle)
sample<-sample(270, 30)
my_y<-ridout.appleshoots$roots[sample]
my_x<-data.frame(pho=ridout.appleshoots$pho[sample])
fbglm(y=my_y, x=my_x )
Vuong closeness test for zero-inflated models
Description
Compare zero-inflated regression models via Vuong closeness test.
Usage
test(y, x, model1, model2)
Arguments
y |
A response vector. |
x |
A data frame with covariates. |
model1 |
A character; one of "ZINB", "ZIP", "ZINB2", and "fbglm". |
model2 |
A character; one of "ZINB", "ZIP", "ZINB2", and "fbglm". |
Details
Perform one-tailed Vuong closeness test with the null hypothesis that the two models are equally close to the true data generating process, against the alternative that one model 1 is closer than model 2.
Choose model1
and model2
from zero-inflated negative binomial regression ("ZINB"), extended zero-inflated negative
binomial regression ("ZINB2"), zero-inflated Poisson regression ("ZIP"), and fractional binomial regression ("fbglm").
For "ZINB2" and "fbglm", see "fbglm::ZINB2" and "fbglm::fbglm" for details.
In "ZIP" and "ZINB", all the covariates are used as regressors in both the count and zero-inflation component.
Value
One-sided p-value will be returned.
References
Vuong, Quang H. (1989). Likelihood Ratio Tests for Model Selection and non-nested Hypotheses. Econometrica. 57 (2): 307–333.
Examples
library(agridat)
library(bbmle)
sample<-sample(270, 30)
my_y<-ridout.appleshoots$roots[sample]
my_x<-data.frame(pho=ridout.appleshoots$pho[sample])
test( y=my_y, x=my_x , "fbglm", "ZINB2" )