Skip to contents

Package

glmOJ-package glmOJ
glmOJ: Toolkit for Count Regression Modeling

Data Summarization

Explore count response variables numerically and graphically before fitting a model.

summarizeCountData()
Summarize count data

Model Fitting

Individual model fitters. Each returns exponentiated coefficients with 95% Wald confidence intervals, randomized quantile residuals, a Pearson dispersion ratio, and a two-panel diagnostic plot.

Poisson

poissonGLM()
Fit a Poisson regression model

Negative Binomial

negbinGLM()
Fit a negative binomial regression model

Zero-Inflated Poisson

zeroinflPoissonGLM()
Fit a zero-inflated Poisson regression model

Zero-Inflated Negative Binomial

zeroinflNegbinGLM()
Fit a zero-inflated negative binomial regression model

Quasi-Poisson

quasiPoissonGLM()
Fit a quasi-Poisson regression model

Tweedie

tweedieGLM()
Fit a Tweedie regression model

Zero-Inflated Tweedie

zeroinflTweedieGLM()
Fit a zero-inflated Tweedie regression model

Model Selection

Fit all four model families and select the best by a user-chosen criterion (decide: "BIC" (default), "AIC", "LogLik", or "McFadden"), with plain-language diagnostics to guide interpretation.

countGLM()
Fit and compare count regression models

Generic Methods

S3 generics for all model classes. predict() and fitted() delegate to the underlying backend. coef() returns a named numeric vector of exponentiated coefficients. coef_table() returns the full table with 95% Wald CIs, p-values, and significance stars. For countGLM objects all methods automatically use the selected best model.

predict(<countGLMfit>) predict(<zeroinflGLMfit>) predict(<countGLM>)
Predict from a count regression model
fitted(<countGLMfit>) fitted(<countGLM>)
Extract fitted values from a count regression model
coef(<countGLMfit>) coef(<zeroinflGLMfit>) coef(<countGLM>)
Extract model coefficients
coef_table()
Coefficient table with confidence intervals and p-values

Interpretation

Natural-language interpretation of model coefficients and interactions.

interpret_coef()
Interpret a model coefficient in natural language
untangle_interaction()
Untangle a two-way interaction in a fitted model

Datasets

Real and simulated datasets bundled with the package for use in examples and the vignette.

Greenberg26.dat
County-level environmental enforcement penalties (Greenberg 2026)
Dahir25.dat
Census-tract street-camera and crime data (Dahir 2025)
ZITweedie.dat
Simulated zero-inflated Tweedie count data