Tutorials › Generalized Linear Mixed Models (GLMM) › Separate Predictors for Zero Inflation and Count Rates

Overdispersion and Zero Inflation · Tutorial 543 of 698

Separate Predictors for Zero Inflation and Count Rates

You will construct separate zero-inflation and count-rate predictors, use logit and log links, and see how the two components combine to give count probabilities.

Advanced 12 min read

What You'll Learn

  • Define the structural-zero probability and Poisson count mean as separate model components.
  • Construct a logit predictor for structural zeros and a log predictor for the count rate.
  • Use different covariates in the two predictors without confusing their roles.
  • Incorporate exposure as a fixed offset when counts scale proportionally with observation time.
  • Calculate the probability of an observed zero from both mixture components.
  • Recognize model assumptions and signs that a zero-inflated Poisson specification may be inadequate.

Why Use Separate Predictors?

A zero-inflated count model represents two distinct processes: an observation may belong to a group that can produce only zeros, or it may belong to a count-generating group whose counts follow a Poisson distribution. These processes need not have the same predictors. For example, one set of conditions may affect whether an event is possible at all, while another set affects how often it occurs when possible.

The model therefore has two linear predictors: one for the probability of a structural zero and one for the Poisson mean. Constructing them separately makes the model’s assumptions explicit and allows different covariates, while still yielding a single probability distribution for each observed count.

Definition: For observation \(i\), let \(\pi_i\) be the probability of membership in the structural-zero group, and let \(\lambda_i>0\) be the Poisson mean in the count-generating group. Write \(Z_i=1\) for structural-zero membership and \(Z_i=0\) for count-generating membership. Then \(P(Z_i=1)=\pi_i\), \(Y_i=0\) when \(Z_i=1\), and \(Y_i\mid Z_i=0\sim\operatorname{Poisson}(\lambda_i)\). Consequently, \(P(Y_i=0)=\pi_i+(1-\pi_i)e^{-\lambda_i}\), while for an integer \(y_i>0\), \(P(Y_i=y_i)=(1-\pi_i)e^{-\lambda_i}\lambda_i^{y_i}/y_i!\).

Two Linear Predictors and Their Links

Let \(x_i\) be a vector of covariates used to model structural-zero membership, and let \(w_i\) be a vector of covariates used to model the Poisson count mean. The vectors may overlap, but they do not have to. Use coefficient vectors \(\gamma\) and \(\beta\), respectively.

$$ \operatorname{logit}(\pi_i)=\log\left(\frac{\pi_i}{1-\pi_i}\right)=x_i^\mathsf{T}\gamma, \qquad \log(\lambda_i)=w_i^\mathsf{T}\beta+o_i $$

The logit link maps any real-valued linear predictor to a probability strictly between zero and one: \(\pi_i=\exp(x_i^\mathsf{T}\gamma)/[1+\exp(x_i^\mathsf{T}\gamma)]\). The log link maps a real-valued predictor to a positive count mean: \(\lambda_i=\exp(w_i^\mathsf{T}\beta+o_i)\). These links guarantee that the fitted quantities lie in their required ranges. A probit link is another possible choice for \(\pi_i\), but logit is a common default.

The term \(o_i\) is an offset when exposure is included. If the expected count is proportional to exposure \(t_i\), measured in a consistent unit, use \(o_i=\log(t_i/t_0)\), where \(t_0\) is the reference exposure. Its coefficient is fixed at one rather than estimated. The resulting \(\lambda_i\) is the expected count over observation \(i\)'s exposure, not a rate per reference exposure.

These equations specify fixed-effect predictors. For clustered or repeated observations, dependence may require random effects; the equations here do not, by themselves, account for such dependence. The usual conditional-independence assumption for this specification is that observations are independent given their covariates and model parameters.

Model assumptions: The response is a nonnegative integer count. Conditional on belonging to the count-generating group and on the predictors, its distribution is Poisson with mean \(\lambda_i\), so its conditional variance is also \(\lambda_i\). Structural-zero members produce zero with probability one. The covariates, links, and exposure offset are specified appropriately; in particular, an exposure offset assumes proportional scaling of the Poisson mean with exposure. These are modeling assumptions, not conclusions established merely by observing many zeros.

How the Two Components Produce the Observed Distribution

The mixture definition gives the probability of every possible observed count. If \(y_i=0\), either the observation is structural zero, or it belongs to the Poisson group and that Poisson draw happens to be zero. If \(y_i>0\), structural-zero membership is impossible, so the observation must come from the Poisson group.

$$ P(Y_i=y_i)= \begin{cases} \pi_i+(1-\pi_i)e^{-\lambda_i}, & y_i=0,\\[4pt] (1-\pi_i)e^{-\lambda_i}\dfrac{\lambda_i^{y_i}}{y_i!}, & y_i>0. \end{cases} $$

This also yields the likelihood for independent observations: multiply these probabilities across \(i\). Taking logarithms converts the product to a sum, with a different contribution for zero and positive observations. In particular, a zero contributes \(\log[\pi_i+(1-\pi_i)e^{-\lambda_i}]\), whereas a positive count contributes \(\log(1-\pi_i)-\lambda_i+y_i\log(\lambda_i)-\log(y_i!)\). The same observation’s covariates can enter both predictors, but each component retains its own coefficient vector.

Worked Model Construction

Worked Example: Evaluating Both Predictors for One Profile

Suppose a hypothetical model uses a binary covariate \(x_i\) in the structural-zero predictor and the same covariate in the count predictor:

$$ \operatorname{logit}(\pi_i)=-1+0.5x_i, \qquad \log(\lambda_i)=\log(2)+0.4x_i. $$

For an observation with \(x_i=1\), the zero-component linear predictor is \(-1+0.5=-0.5\). Therefore,

$$ \pi_i=\frac{e^{-0.5}}{1+e^{-0.5}} =\frac{0.6065}{1.6065} \approx 0.3775. $$

The count-component predictor is \(\log(2)+0.4\), so \(\lambda_i=2e^{0.4}\approx 2.984\) expected counts in the observation’s exposure period. The probability of observing zero is the mixture probability:

$$ P(Y_i=0)=0.3775+(1-0.3775)e^{-2.984} \approx 0.3775+(0.6225)(0.0506) \approx 0.4090. $$

Thus the fitted probability of a zero is about \(0.4090\), comprising structural-zero probability \(0.3775\) plus sampling-zero probability from the count group. The probability of a positive count is \(1-0.4090=0.5910\). The covariate appears in both predictors here, but with separate coefficients.

Worked Example: Adding an Exposure Offset

Consider a hypothetical count model with a 10-day reference exposure. Let \(A_i\) be a binary covariate, and specify

$$ \operatorname{logit}(\pi_i)=-1+0.2A_i, \qquad \log(\lambda_i)=\log(1.6)+0.3A_i+\log(t_i/10), $$

where \(t_i\) is the observation duration in days. For \(A_i=1\) and \(t_i=20\), the underlying expected count at the 10-day reference exposure is \(1.6e^{0.3}\approx 2.160\) counts per 10 days. The 20-day exposure doubles that mean:

$$ \lambda_i =\exp\left[\log(1.6)+0.3+\log(20/10)\right] =1.6e^{0.3}\times 2 \approx 4.320. $$

So the underlying rate is approximately \(2.160\) counts per 10 days, and the exposure-adjusted Poisson mean is approximately \(4.320\) counts over 20 days. These are different quantities; the exposure-adjusted mean is not a rate per 10 days. Separately, the structural-zero predictor is \(-1+0.2=-0.8\), giving \(\pi_i=e^{-0.8}/(1+e^{-0.8})\approx0.3100\). The model combines this probability with the 20-day Poisson mean to obtain the observed-count distribution.

Worked Example: Using Different Covariates in the Two Components

Suppose a hypothetical setting uses habitat \(h_i\) to model structural-zero membership and dose \(d_i\) to model the count mean:

$$ \operatorname{logit}(\pi_i)=-1+0.7h_i, \qquad \log(\lambda_i)=\log(1.2)+0.5d_i. $$

For a profile with \(h_i=1\) and \(d_i=2\), the structural-zero predictor is \(-1+0.7=-0.3\), giving \(\pi_i=e^{-0.3}/(1+e^{-0.3})\approx0.4256\). The count predictor is \(\log(1.2)+1\), so \(\lambda_i=1.2e^1\approx3.262\).

The fitted zero probability is therefore

$$ P(Y_i=0)=0.4256+(1-0.4256)e^{-3.262} \approx0.4256+(0.5744)(0.0383) \approx0.4476. $$

This construction uses habitat only in the zero-inflation component and dose only in the count component. It does not require every predictor to be shared across components, nor does it require the two coefficient vectors to have the same values.

Building and Checking a Specification

A practical construction proceeds by deciding what each component is intended to represent, then writing its predictor and link explicitly. Keeping the definitions visible helps prevent a common convention error: \(\pi_i\) here means the probability of structural-zero membership, not the probability of belonging to the count-generating group.

1
Define the zero process.
Specify which covariates \(x_i\) are used for structural-zero probability, then choose a probability link such as logit.
2
Define the count process.
Specify the covariates \(w_i\) for the Poisson mean and use a link such as log. Add a log-exposure offset only when proportional exposure scaling is appropriate.
3
Combine the components.
Use the mixture probability for zeros and the count-component probability multiplied by \(1-\pi_i\) for positive counts.
4
Check the fitted distribution.
Compare observed and fitted counts, especially the zero frequency and the positive-count distribution, and assess whether the assumed conditional Poisson variation is adequate.

Useful diagnostics include comparing the observed number of zeros with the total number expected under the fitted model, inspecting fitted and observed frequencies across count values, and checking residual patterns against important covariates and exposure. A model that predicts the total zero count well can still fit positive counts poorly. Conversely, an apparent surplus of zeros does not prove that a structural-zero mechanism exists: omitted heterogeneity or an unsuitable count distribution can also produce mismatch.

The zero-inflated Poisson model differs from an ordinary Poisson model because it adds a structural-zero component rather than requiring every zero to arise from a Poisson draw. A negative binomial model is a common alternative when extra-Poisson variation is the main concern; it represents dispersion rather than a separate always-zero group. A hurdle model is another alternative, modeling zero occurrence separately from a positive, zero-truncated count distribution. These alternatives encode different assumptions and should not be treated as interchangeable.

A further practical limitation is that different combinations of \(\pi_i\) and \(\lambda_i\) can sometimes produce similar observed count patterns, particularly with sparse data or few positive counts. Fitted probabilities and model stability should therefore be checked rather than assuming that two predictors are automatically estimable just because they were specified. When observations are clustered, a fixed-effect specification also does not remove within-cluster dependence; that requires an appropriate dependence model.

Common Mistakes

  • Confusing the two probabilities. In this convention \(\pi_i\) is structural-zero probability; the probability of entering the Poisson group is \(1-\pi_i\).
  • Using a linear predictor directly as a probability or mean. Apply the inverse-logit to the zero predictor and the exponential to the count predictor.
  • Calling an exposure-adjusted mean a rate. With the offset included, \(\lambda_i\) is the mean count over the full exposure \(t_i\); state the reference rate and the adjusted mean separately.
  • Assuming every observed zero is structural. A Poisson draw can also be zero, so the fitted zero probability includes both components.
  • Forcing identical covariates into both components without justification. The predictors can overlap, but each should reflect the process it is intended to model.
  • Treating excess zeros as proof of zero inflation. Check count fit and possible heterogeneity; a zero-inflated specification is a model assumption, not a label assigned from a zero count alone.
Key takeaway: A zero-inflated Poisson model uses one predictor and link to produce \(\pi_i\), another to produce \(\lambda_i\), and a mixture distribution to combine them. The separation is substantive as well as algebraic: structural-zero probability and count rate describe different parts of the data-generating process.

Check Your Understanding

Use the convention that \(\pi_i\) is structural-zero probability and \(\lambda_i\) is the Poisson mean.

  1. Write the inverse-logit expression for \(\pi_i\) when \(\operatorname{logit}(\pi_i)=-0.4+0.6x_i\).
  2. A model has \(\log(\lambda_i)=\log(3)+\log(t_i/5)\). What is \(\lambda_i\) when exposure is 15 units, and what is its unit-based interpretation?
  3. For \(\pi_i=0.25\) and \(\lambda_i=2\), calculate the probability of an observed zero.
  4. Explain why a positive count’s probability includes the factor \(1-\pi_i\).

Solutions. (1) \(\pi_i=\exp(-0.4+0.6x_i)/[1+\exp(-0.4+0.6x_i)]\). (2) \(\lambda_i=\exp[\log(3)+\log(15/5)]=3\times3=9\), the expected count over the 15-unit exposure; the underlying rate is 3 counts per 5 exposure units. (3) \(P(Y_i=0)=0.25+0.75e^{-2}\approx0.25+0.75(0.1353)=0.3515\). (4) A structural-zero member cannot produce a positive count, so a positive observation must come from the count-generating group, whose probability is \(1-\pi_i\).

Clinical Biostats