| Title: | Fractional Binomial Regression Model |
|---|---|
| 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. |
| Authors: | Jeonghwa Lee [aut, cre, cph]
|
| Maintainer: | Jeonghwa Lee <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.5.0 |
| Built: | 2026-05-20 06:07:09 UTC |
| Source: | https://github.com/cran/fbglm |
Fit a fractional binomial regression model via maximum likelihood.
fbglm(y, x)fbglm(y, x)
y |
A response vector. |
x |
A data frame with covariates. |
Fractional binomial distribution can be considered as zero-inflated, over-dispersed binomial model, and it has three parameters
in addition to the number of trials .
We use a specific parametrization such that , and
regress these parameters with logit link on the covariates, while letting as the maximum of the response y.
A list of log-likelihood, estimated coefficients, and maximum likelihood estimation results.
Breece, C. and Lee, J. (2024) Fractional binomial regression model for count data with excess zeros.https://arxiv.org/html/2410.08488v1
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 )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 )
Compare zero-inflated regression models via Vuong closeness test.
test(y, x, model1, model2)test(y, x, model1, model2)
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". |
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.
One-sided p-value will be returned.
Vuong, Quang H. (1989). Likelihood Ratio Tests for Model Selection and non-nested Hypotheses. Econometrica. 57 (2): 307–333.
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" )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" )
Fit extended zero-inflated negative binomial regression model via maximum likelihood.
ZINB2(y, x)ZINB2(y, x)
y |
A response vector. |
x |
A data frame with covariates. |
The model regresses all the parameters– zero-inflation component (with logit link), and both the mean
and dispersion parameter (with log link)– on covariates.
A list of log-likelihood, estimated coefficients, and maximum likelihood estimation results.
Breece, C. and Lee, J. (2024) Fractional binomial regression model for count data with excess zeros.https://arxiv.org/html/2410.08488v1
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 )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 )