Tutorials › Generalized Linear Mixed Models (GLMM) › Analyzing Clinic Utilization Counts

Software and Case Studies · Tutorial 685 of 698

Analyzing Clinic Utilization Counts

Learn to specify and interpret an exposure-adjusted clinic count GLMM, including how observation periods and clinic-level grouping affect estimated visit rates.

Intermediate 11 min read

What You'll Learn

  • Specify a Poisson GLMM for clinic-period visit counts with the log of patient-time as an offset.
  • Distinguish a visit count from a visit rate and choose an exposure denominator that matches the estimand.
  • Interpret fixed effects and clinic random intercepts in the context of fitted visit rates.
  • Explain why observation periods and the grouping of repeated records by clinic affect comparisons.
  • Check model fit for overdispersion, temporal structure, influential clinics, and unsuitable exposure assumptions.
  • Compare a clinic random-intercept model with alternatives such as a negative-binomial GLMM or clinic fixed effects.

From Clinic Counts to Visit Rates

A clinic that records more visits may serve more patients, observe them for longer, or have a higher underlying visit rate. Counts alone cannot separate these explanations. An exposure-adjusted count GLMM models the number of visits while accounting for the amount of time or population at risk, and a clinic-level random effect represents residual differences among clinics.

The observational rows are often clinic-period records: for example, one row for each clinic in each quarter. The count is the number of visits during that period. The exposure should measure the relevant opportunity to generate visits, such as eligible patient-years. Calendar duration alone is an adequate denominator only when the size of the population at risk is comparable or is otherwise accounted for.

Definition: Let \(Y_{ij}\) be the visit count for clinic \(i\) in observation period \(j\), and let \(E_{ij}>0\) be its exposure, measured in units such as patient-years. A Poisson random-intercept GLMM with a log link is $$ Y_{ij}\mid b_i \sim \operatorname{Poisson}(\mu_{ij}), \qquad \log(\mu_{ij})=\log(E_{ij})+\mathbf{x}_{ij}^{\mathsf T}\boldsymbol{\beta}+b_i, \qquad b_i\sim N(0,\sigma^2_{\text{clinic}}). $$ The term \(\log(E_{ij})\) is an offset: its coefficient is fixed at 1. Conditional on the clinic effects and modeled predictors, the counts are assumed independent, with mean equal to variance. The clinic effects are assumed normally distributed and independent across clinics.

Writing \(\lambda_{ij}=\mu_{ij}/E_{ij}\) for the modeled visit rate per exposure unit gives \(\log(\lambda_{ij})=\mathbf{x}_{ij}^{\mathsf T}\boldsymbol{\beta}+b_i\). Thus the offset lets a count have a larger expected value simply because more patient-time was observed, without treating that extra exposure as a change in the rate. The clinic intercept \(b_i\) shifts the log rate for records from the same clinic.

Why the Exposure Offset Works

The offset encodes a proportional-exposure assumption: holding the rate fixed, doubling exposure doubles the expected count. This follows directly from the model. If \(\eta_{ij}=\mathbf{x}_{ij}^{\mathsf T}\boldsymbol{\beta}+b_i\), then the specified mean is \(E_{ij}\exp(\eta_{ij})\). Replacing \(E_{ij}\) by \(cE_{ij}\), for \(c>0\), changes the mean to \(cE_{ij}\exp(\eta_{ij})=c\mu_{ij}\), while leaving the rate \(\mu_{ij}/E_{ij}\) unchanged.

This assumption is appropriate when exposure is a measure of time or population genuinely at risk and the rate is reasonably constant within the modeled conditions. If visits are counted over different calendar periods, period effects may be needed because seasonal demand or service changes can alter rates. If patient numbers differ, patient-time is usually more informative than the number of calendar months alone. The exposure must be positive to take its logarithm; a zero-exposure row cannot provide information about a visit rate and should not be entered as an ordinary offset record.

Worked Example: Comparing Crude Rates With Unequal Exposure

Suppose two hypothetical clinics record visits over a study interval. Clinic A has 24 visits over 120 patient-months; Clinic B has 30 visits over 300 patient-months. Calculate each crude rate per patient-year and compare the counts with the rates.

There are 12 patient-months in one patient-year. Clinic A has \(120/12=10\) patient-years of exposure, so its crude rate is $$ \frac{24\ \text{visits}}{10\ \text{patient-years}}=2.40\ \text{visits per patient-year}. $$ Clinic B has \(300/12=25\) patient-years, so its crude rate is $$ \frac{30\ \text{visits}}{25\ \text{patient-years}}=1.20\ \text{visits per patient-year}. $$ The raw count is higher at Clinic B, but the crude rate is twice as high at Clinic A: \(2.40/1.20=2.00\). This arithmetic is descriptive, not an adjusted GLMM comparison. It shows why comparing counts without their exposure can reverse the apparent ordering of clinic utilization.

Fitting and Interpreting the Clinic Model

For repeated clinic-period records, a typical model includes an offset for exposure, fixed effects for relevant predictors or periods, and a random intercept for clinic. For example, in R, a Poisson model using glmmTMB can be specified as:

$$ \texttt{glmmTMB(visits \textasciitilde\ service + period + offset(log(patient\_years)}\\ \texttt{) + (1 | clinic), family = poisson(link = "log"), data = d)} $$

Here, \(\texttt{service}\) and \(\texttt{period}\) represent fixed-effect predictors, and \(\texttt{(1 | clinic)}\) requests a clinic random intercept. In practice, check that the software uses the intended rows, exposure units, reference categories, and link function. A package may report estimates on the log-rate scale; exponentiating a fixed-effect coefficient gives a rate ratio for a one-unit predictor change or a specified category contrast, conditional on the model structure.

Worked Example: Turning Model Estimates Into Clinic Rates

Suppose a hypothetical model uses patient-years as exposure and estimates an intercept of \(-1.609\), a service coefficient of \(0.405\), and a clinic random intercept of \(0.300\) for a particular clinic. Assume the baseline service is coded 0, the comparison service is coded 1, and the other fixed predictors are at their reference values. Find the baseline rate, the comparison rate in this clinic, and the expected count for 40 patient-years at the comparison service.

For the baseline service at a clinic with \(b_i=0\), the rate is $$ \exp(-1.609)=0.200\ \text{visits per patient-year}. $$ The service coefficient changes the log rate by \(0.405\). Its rate ratio is $$ \exp(0.405)=1.50. $$ This is a 1.50-fold modeled rate for the comparison service relative to the baseline service, conditional on the same clinic effect and the other predictors.

For the specified clinic, include its random intercept. The comparison-service rate is $$ \exp(-1.609+0.405+0.300) =\exp(-0.904)=0.405\ \text{visits per patient-year}. $$ At 40 patient-years, the expected visit count is $$ 40\times 0.405=16.2\ \text{visits}. $$ An expected count need not be an integer; actual observed counts are integers. The calculation is a model-based mean, not a prediction that exactly 16.2 visits will occur.

A fixed-effect rate evaluated at \(b_i=0\) describes the rate at the center of the random-effects distribution on the log scale. It is not automatically the average rate across clinics. Under the stated normal random-intercept model, averaging over clinics multiplies a rate at \(b_i=0\) by \(\exp(\sigma^2_{\text{clinic}}/2)\), because \(E[\exp(b_i)]=\exp(\sigma^2_{\text{clinic}}/2)\). Clinic-specific fitted rates that include estimated random effects answer a different question from this population-averaged rate. State which comparison is intended before presenting a rate.

Observation Periods and Clinic Grouping

The data layout is part of the model. If a clinic contributes multiple periods, all those records should carry the same clinic identifier so that the random intercept captures their shared clinic-level tendency. Treating clinic-period rows as unrelated would discard that dependence and can make uncertainty too small. Conversely, using a distinct clinic identifier for every period would fail to represent the repeated clinic grouping.

The period length and exposure denominator also determine what the fitted rate means. A count over a longer period will generally be larger under the same rate, while an exposure-adjusted rate has units set by its denominator. When the denominator is patient-years, report visits per patient-year, not visits per month or per clinic. If a clinic’s population changes over time, calculate exposure for each clinic-period rather than applying one clinic-wide total to every row.

Worked Example: Aggregating Periods Without Losing the Rate Meaning

Consider hypothetical six-month records. Clinic A records 12 visits over 40 patient-years in the first period and 18 visits over 60 patient-years in the second. Clinic B records 10 visits over 20 patient-years in each period. Compare the clinic-level rates after combining periods, and explain why the rows should remain grouped by clinic when fitting a repeated-period GLMM.

For Clinic A, the combined count is \(12+18=30\) visits and combined exposure is \(40+60=100\) patient-years. Its combined rate is $$ 30/100=0.300\ \text{visits per patient-year}. $$ For Clinic B, the combined count is \(10+10=20\) visits and exposure is \(20+20=40\) patient-years. Its combined rate is $$ 20/40=0.500\ \text{visits per patient-year}. $$ Although Clinic A has more total visits, Clinic B has the higher exposure-adjusted rate. In a GLMM that also models period effects, retaining the two records per clinic preserves the period information; the shared clinic identifier tells the model that the records come from the same clinic. Summing first gives the descriptive combined rates above, but it removes the ability to estimate period differences from these records.

1
Verify the observational unit.
Confirm that each row represents the stated clinic and period, and that repeated rows use a consistent clinic identifier.
2
Verify the exposure.
Check its definition, units, and positivity. The denominator should match the population and time at risk for the visits being counted.
3
Fit and examine the model.
Fit the offset and clinic grouping as specified, then check convergence, dispersion, residual patterns, and influential clinics.
4
Report the target comparison.
Distinguish a conditional rate for a specified clinic effect from a rate averaged over the clinic distribution, and state the exposure unit and observation period.

Assumptions, Diagnostics, and Alternatives

The Poisson GLMM is most credible when the conditional mean is correctly specified, the log exposure is a valid offset, and counts are conditionally Poisson after accounting for predictors and the clinic effect. Conditional independence means that, given the modeled effects and predictors, remaining counts do not share additional dependence. Repeated quarters may still have serial correlation or unmodeled seasonality; a clinic random intercept does not automatically account for either.

Inspect observed and fitted counts or rates by clinic and period, and examine simulation-based residual diagnostics where available. Look for systematic residual patterns over time, many more zeros or extreme counts than predicted, and conditional overdispersion. Check convergence warnings and whether the estimated clinic variance is near zero or unstable. A small estimated variance may indicate little detectable between-clinic variation, but it does not prove clinics are identical. A few highly influential clinics can also strongly affect the estimated variance or fixed effects.

A negative-binomial GLMM is a common alternative when there is extra count variation beyond the conditional Poisson model. A clinic fixed-effect model instead estimates a separate intercept for each observed clinic; it can control for stable clinic differences, but does not estimate a distribution of clinic effects for generalizing to other clinics. A marginal approach such as a generalized estimating equation targets population-average associations and uses a different dependence and variance framework. These approaches answer related but not identical questions; choose among them based on the scientific target and data structure, not solely on which gives the preferred estimate.

The offset is not a remedy for an incorrect denominator. If the eligible patient population is not at risk throughout all recorded time, or if different exposure units correspond to materially different opportunities for visits, the rate comparison may be misleading. Likewise, a random-intercept model assumes clinic variation is adequately represented by a common distribution; it does not automatically handle clinic-specific predictor effects. Those limitations should shape how broadly fitted comparisons are interpreted.

Common Mistake

Pitfall: “Clinic B had 30 visits and Clinic A had 24, so Clinic B had greater utilization.” This ignores that Clinic B had 2.5 times as much patient-time in the example. Compare counts only when exposure is comparable; otherwise model the counts with a justified exposure offset and interpret rates in their stated units. Also, do not treat repeated periods from one clinic as separate independent clinics.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. A clinic observes 36 visits over 18 patient-years. What is its crude visit rate per patient-year?
  2. In a log-link model, a coefficient for a service indicator is \(0.182\). What is the corresponding rate ratio, approximately, and what does it compare?
  3. Why is a random clinic intercept not a substitute for including the exposure offset?
  4. What is one consequence of assigning a new clinic identifier to every clinic-period row when clinics contribute repeated periods?

Solutions. (1) \(36/18=2.00\) visits per patient-year. (2) \(\exp(0.182)=1.20\), approximately. Conditional on the same clinic effect and other modeled predictors, the comparison service has an estimated rate 1.20 times the baseline service’s rate. (3) The random intercept represents residual differences among clinics; it does not adjust the expected count for different amounts of patient-time. The offset does that by multiplying the rate by exposure. (4) The model would no longer recognize periods from the same clinic as sharing a clinic effect, so the intended repeated-clinic dependence would be lost and uncertainty could be understated.

Clinical Biostats