Understanding Deeply · 10 · Entirely fictional data

Two different stories can end in zero.

Count visits to an invented library during one month. Some people are away for the whole month and cannot visit. Others could visit—but might make zero, one or many visits. A zero-inflated negative binomial model gives these two stories a mathematical form.

Try a recipe:

Split the population, then count

Always-zero component

Cannot visit this month. Every count is 0.

Negative binomial component

Could visit. Counts can be 0, 1, 2, 3…

Expected numbers out of 100 people; fractions are normal for expectations.

Now draw 100 fictional people

Each tile is one person’s visit count. Click a tile to inspect it. A new draw samples a fresh fictional set of people and counts.

The sample fluctuates around the recipe’s expectations. Moving a slider reuses the same random numbers, making its effect easier to track.

The mathematical bridgeTrace the current recipe into zeros, means, variance and the two regression parts.
Is this the same as a hurdle model?Two different explanations can describe the same observed counts.

In a hurdle model, the count step starts at 1

A hurdle model first models zero versus any positive count. Its positive-count distribution is zero-truncated: it cannot produce another zero. ZINB instead mixes an always-zero state with a negative binomial distribution that can itself produce zero.

This shows why the count histogram cannot tell you with certainty what happened to an individual zero. With covariates, restrictions in the regression equations can distinguish model families; the study’s mechanism and predictive checks still matter.

Translate the long name

Zero-inflated

Add a separate source of zeros to the zeros already possible in the count distribution.

Negative binomial

A distribution for 0, 1, 2… that allows more variability than Poisson. “Negative” does not mean negative counts.

Regression

Let characteristics predict the count mean and the probability of the always-zero state. Combine both for overall predictions.

From a playground to an analysisWhat to check before choosing or interpreting ZINB.
  1. Define the count and observation window. A true zero means complete observation with no event. Missing records are not zeros. Unequal exposure may need a log-time offset and a justified rate model.
  2. Investigate why counts vary and why zeros occur. Covariates, short follow-up, clustering and heterogeneity may explain the pattern. “More zeros than Poisson” does not automatically mean “more zeros than negative binomial.”
  3. Specify both equations. Choose defensible predictors for the count and zero components. In real data the latent state is usually unknown; all observations contribute to fitting the mixture likelihood.
  4. Check estimation and predictive performance. Inspect convergence, uncertainty, observed versus predicted zero frequencies and the positive tail. Compare appropriate simpler models, using criteria such as AIC on the same outcome and sample, and validation where feasible. A better fit does not prove a literal always-zero subgroup.
  5. Report the answer to the question you actually asked. Distinguish count-component mean ratios, always-zero odds ratios, probability of any event and overall expected counts. Show uncertainty and account for repeated or clustered observations when relevant.

This page supplies parameters and draws fictional counts. It does not estimate coefficients, select a winning model, calculate confidence intervals or diagnose a real data set. The “cannot visit” state is known inside the simulator only; assigning such a state in an actual study requires substantive justification.