Skip to contents

Package overview

underdisp underdisp-package
underdisp: Diagnostics and Models for Underdispersed Count Data

Screening and diagnostics

ud_screen()
Screen a count outcome for underdispersion
compare_dispersion()
Compare count-model dispersion across the model family
dispersion_test()
Regression-adjusted test of equidispersion
dispersion_profile() plot(<dispersion_profile>)
Dispersion profile: variance-to-mean ratio against the fitted mean
zi_test()
Boundary-corrected test for zero-inflation (CPB vs ZI-CPB)
rootogram()
Hanging rootogram for a fitted count model
pit_hist()
Non-randomized PIT histogram for a fitted count model

Estimators

One formula interface, one class per model, one set of methods.

cpb()
Fit a Continuous Parameter Binomial (CPB) regression
gec()
Generalized event count (Katz-family) regression
count_reg()
Matched count regressions: Poisson, negative binomial, COM-Poisson, generalized Poisson, gamma-count, double Poisson

High-dimensional fixed effects

cpb_fe()
CPB regression with high-dimensional unit fixed effects
gec_fe()
GEC (Katz-family) regression with high-dimensional unit fixed effects

Hurdle models

hurdle_cpb()
Hurdle continuous parameter binomial regression
hurdle_gec()
Hurdle GEC (Katz-family) regression
hurdle_count()
Hurdle count regression for the matched count families

Zero-inflated models

zi_cpb()
Zero-inflated continuous parameter binomial regression
zi_gec()
Zero-inflated GEC (Katz-family) regression
zi_count()
Zero-inflated count regression for the matched count families

Inference and summaries

summary(<cpb>)
Summarize a CPB fit
confint(<cpb>)
Confidence intervals for a CPB fit
confint(<gec>) confint(<cpb_fe>) confint(<count_reg>) confint(<zi_count>) confint(<hurdle_cpb>) confint(<hurdle_gec>) confint(<hurdle_count>) confint(<zi_cpb>) confint(<zi_gec>)
Confidence intervals for every model class
alpha_confint()
Profile-likelihood interval for the dispersion parameter alpha
calibrate_alpha()
Calibrate the interval for the CPB dispersion parameter
vcov(<cpb_fe>)
Bootstrap covariance for a fixed-effects CPB fit
fitted(<cpb_fe>) fitted(<hurdle_cpb>) fitted(<hurdle_gec>) fitted(<hurdle_count>) fitted(<zi_cpb>) fitted(<zi_gec>) fitted(<zi_count>)
Fitted means for the two-part and fixed-effects classes

Predictions

predict(<cpb>)
Predictions from a CPB fit
predict(<cpb_fe>)
Predictions from a fixed-effects CPB fit
predict(<gec>)
Predictions from a generalized event count fit
predict(<count_reg>)
Predictions from a matched count-family fit
predict(<hurdle_cpb>)
Predict from a hurdle-CPB fit
predict(<hurdle_gec>)
Predict from a hurdle-GEC fit
predict(<hurdle_count>)
Predict from a hurdle Poisson/NB fit
predict(<zi_cpb>)
Predict from a zi_cpb fit
predict(<zi_gec>)
Predict from a zi_gec fit
predict(<zi_count>)
Predict from a zero-inflated Poisson/NB fit

Quantities of interest

first_difference()
First difference for a CPB fit
first_difference(<gec>) first_difference(<gec_fe>) first_difference(<cpb_fe>) first_difference(<hurdle_gec>) first_difference(<zi_gec>) first_difference(<count_reg>) first_difference(<hurdle_count>) first_difference(<zi_count>)
First differences for the matched count families
first_difference(<hurdle_cpb>) first_difference(<zi_cpb>)
Extensive/intensive first-difference decomposition for a hurdle- or ZI-CPB
implied_ceiling()
Implied ceiling with a profile-likelihood interval
irr()
Incidence rate ratios for a CPB fit
irr(<count_reg>) irr(<gec>) irr(<gec_fe>) irr(<cpb_fe>) irr(<hurdle_gec>) irr(<zi_gec>) irr(<hurdle_count>) irr(<zi_count>)
Rate and odds ratios for the matched count families

Model comparison and scoring

compare_models()
Compare fitted underdispersed-count models
score()
Proper scoring rules for a fitted count model
cv_score()
Cross-validated proper scores for a count model

Panel tools

mundlak()
Mundlak (correlated random effects) device

Simulation and distribution functions

simulate(<cpb>) simulate(<cpb_fe>) simulate(<gec>) simulate(<count_reg>) simulate(<hurdle_cpb>) simulate(<hurdle_gec>) simulate(<hurdle_count>) simulate(<zi_cpb>) simulate(<zi_gec>) simulate(<zi_count>)
Simulate responses from a fitted underdisp model
dcpb() pcpb() qcpb()
Continuous parameter binomial distribution functions
rcpb()
Simulate from the continuous parameter binomial
rhurdle_cpb()
Simulate from the hurdle continuous parameter binomial
rzicpb()
Simulate from the zero-inflated continuous parameter binomial
dgec() pgec() qgec() rgec()
Generalized event count (Katz) distribution functions
dcompois() pcompois() qcompois() rcompois()
Conway–Maxwell–Poisson distribution functions
dgammacount() pgammacount() qgammacount() rgammacount()
Gamma-count distribution functions
ddoublepois() pdoublepois() qdoublepois() rdoublepois()
Double Poisson distribution functions
dgenpois() pgenpois() qgenpois() rgenpois()
Generalized Poisson distribution functions

broom methods

Data

peacekeeping
UN peacekeeping contributions, state-years