Tutorials › Pharmacokinetic-Pharmacodynamic (PK/PD) Modeling › Modeling Seizure Counts Against Antiseizure-Drug Exposure

Worked Case Studies · Tutorial 584 of 598

Modeling Seizure Counts Against Antiseizure-Drug Exposure

Learn to specify and interpret an overdispersed seizure-count model that adjusts for follow-up time and baseline burden, and use it to predict event rates at alternative drug exposures.

Advanced 12 min read

What You'll Learn

  • Specify a negative-binomial model for recurrent seizure counts with an observation-time offset.
  • Adjust expected seizure rates for baseline seizure burden.
  • Interpret an exposure coefficient as a rate ratio and calculate alternative-exposure predictions.
  • Derive the negative-binomial variance from a gamma-Poisson mixture.
  • Assess overdispersion, model fit, and limitations of the model.
  • Compare negative-binomial regression with Poisson and other count-model approaches.

Why Seizure Counts Need a Rate Model

A count of seizures is not interpretable without its observation window. Four seizures recorded over 28 days and four recorded over 84 days are the same count but represent different observed rates. Baseline seizure burden matters as well: a participant with frequent seizures before treatment may be expected to have more events during follow-up, even at the same antiseizure-drug exposure as another participant. A useful exposure-response analysis therefore models counts in relation to observation time, baseline burden, and drug exposure.

The model developed here estimates an association between exposure and the expected seizure rate. Its interpretation depends on the chosen exposure measure, the adequacy of baseline adjustment, and the assumption that the model describes the relevant population. An exposure-associated rate difference is not automatically a causal drug effect: confounding, adherence, disease severity, and other features of treatment assignment can affect both exposure and seizure counts.

Definition: Let \(Y_i\) be the number of recurrent seizures observed for participant \(i\) during \(T_i\) days of follow-up. Let \(C_i\) be the participant's exposure measure in mg/L and \(B_i\) the baseline seizure rate in seizures per 28 days. A negative-binomial regression specifies a conditional mean \(\mu_i=E(Y_i\mid C_i,B_i,T_i)\) and allows the conditional variance to exceed the mean. In the NB2 parameterization used here, \(\operatorname{Var}(Y_i\mid C_i,B_i,T_i)=\mu_i+\alpha\mu_i^2\), where \(\alpha>0\) is the overdispersion parameter.

Model Specification and Assumptions

Use 28 days as the reference unit for observation time, 2 mg/L as the reference exposure, and 2 seizures per 28 days as the reference baseline burden. The log-linear mean model is

$$ \log(\mu_i)=\log(T_i/28)+\beta_0+\beta_E(C_i-2)+\beta_B\log(B_i/2). $$

The term \(\log(T_i/28)\) is an offset: its coefficient is fixed at 1, rather than estimated. Equivalently, dividing the expected count by the observation-time factor gives the expected number of seizures per 28 days:

$$ r_i=\frac{\mu_i}{T_i/28} =\exp\{\beta_0+\beta_E(C_i-2)+\beta_B\log(B_i/2)\}. $$

Here \(r_i\) is a rate in seizures per 28 days. The coefficient \(\beta_E\) is the change in log rate for a 1 mg/L exposure increase, conditional on baseline burden; \(\exp(\beta_E)\) is the corresponding rate ratio. The coefficient \(\beta_B\) describes the change in log rate for a multiplicative change in baseline rate. For example, doubling baseline burden multiplies the modeled rate by \(2^{\beta_B}\). The intercept \(\beta_0\) is the log expected rate at the reference exposure and baseline burden.

The negative-binomial assumption concerns the distribution of counts around this mean, not the exposure-response curve itself. Under the stated parameterization, a common probability mass function is

$$ P(Y_i=y)= \frac{\Gamma(y+1/\alpha)}{\Gamma(1/\alpha)y!} \left(\frac{1}{1+\alpha\mu_i}\right)^{1/\alpha} \left(\frac{\alpha\mu_i}{1+\alpha\mu_i}\right)^y, \qquad y=0,1,2,\ldots. $$

This formulation assumes that, conditional on the modeled predictors, participants' counts are independent, the conditional mean has the specified log-linear form, and a single dispersion parameter adequately describes the extra variability. Follow-up time must be measured appropriately, and the offset assumes that expected counts scale proportionally with time at risk. The baseline rate must be positive for the logarithm in this specification; when zero baseline counts occur, the analysis plan needs a defensible approach to that value rather than an unexplained arbitrary adjustment. Exposure and baseline measures are treated as observed without material error in this basic model.

The model is for one count per independent participant. If each participant contributes multiple interval counts, those rows are generally correlated. A negative-binomial variance alone does not account for within-participant correlation; a repeated-measures or other dependence structure is then needed. Likewise, the offset is not a substitute for handling periods when a participant is not at risk or is not observed.

Why the Negative-Binomial Variance Allows Overdispersion

A Poisson count has conditional variance equal to its conditional mean. Seizure counts may vary more than that, even after measured predictors are included. One justification for the NB2 variance is a gamma-Poisson mixture: suppose a participant's latent Poisson mean \(\Lambda_i\) varies around \(\mu_i\), with \(E(\Lambda_i)=\mu_i\) and \(\operatorname{Var}(\Lambda_i)=\alpha\mu_i^2\). Given \(\Lambda_i\), let \(Y_i\) be Poisson with mean \(\Lambda_i\). The law of total variance gives

$$ \begin{aligned} E(Y_i)&=E\{E(Y_i\mid\Lambda_i)\}=E(\Lambda_i)=\mu_i,\\ \operatorname{Var}(Y_i) &=E\{\operatorname{Var}(Y_i\mid\Lambda_i)\} +\operatorname{Var}\{E(Y_i\mid\Lambda_i)\}\\ &=E(\Lambda_i)+\operatorname{Var}(\Lambda_i) =\mu_i+\alpha\mu_i^2. \end{aligned} $$

Thus, the extra variance can be understood as unmodeled heterogeneity in the latent event intensity. This interpretation does not mean the model has identified the biological source of heterogeneity; it only explains the variance form.

Worked Example: Separating Count From Observation Time

Consider three hypothetical participants. Their follow-up counts, durations, and baseline rates are shown below. Calculate each observed follow-up rate in seizures per 28 days.

ParticipantFollow-up seizuresFollow-up daysBaseline seizures per 28 days
A4284
B5562
C3146

The observed rate per 28 days is \(Y_i/(T_i/28)\). For A, the calculation is \(4/(28/28)=4.00\) seizures per 28 days. For B, it is \(5/(56/28)=5/2=2.50\) seizures per 28 days. For C, it is \(3/(14/28)=3/0.5=6.00\) seizures per 28 days. Comparing the raw counts alone would obscure the difference in observation time.

These are descriptive rates, not adjusted predictions. In particular, C's higher observed rate occurs alongside a higher baseline burden, and the table alone cannot isolate an exposure association. The regression model uses all participants' data to estimate exposure and baseline effects together, while the offset places their counts on a common time scale.

Estimating and Interpreting Exposure Effects

For a given dataset, the regression coefficients and \(\alpha\) are typically estimated by maximizing the negative-binomial likelihood. A fitted model should be interpreted through predicted rates and rate ratios, not just the sign of a coefficient. The following hypothetical fitted output will be used for the calculations: \(\hat{\beta}_0=\log(1.06564)\), \(\hat{\beta}_E=-0.180\) per mg/L, \(\hat{\beta}_B=0.70\), and \(SE(\hat{\beta}_E)=0.060\). The fitted dispersion is \(\hat{\alpha}=0.40\). These are illustrative estimates, not results from an actual study.

Worked Example: Comparing Two Exposures

Compare modeled rates at 2 and 5 mg/L for participants with the reference baseline burden of 2 seizures per 28 days. Use the hypothetical fitted output above.

At the reference exposure and baseline, the modeled rate is \(r(2,2)=\exp\{\log(1.06564)\}=1.06564\), or 1.066 seizures per 28 days when rounded. At 5 mg/L, the baseline term remains zero because \(\log(2/2)=0\), and the exposure term is \(-0.180(5-2)=-0.540\). The model gives

$$ r(5,2)=\exp\{\log(1.06564)-0.540\} =1.06564\exp(-0.540)\approx 0.6210 $$

seizures per 28 days. The model-based rate ratio is \(\exp\{-0.180(5-2)\}=\exp(-0.540)\approx0.5827\). Thus, under this fitted model, the expected rate at 5 mg/L is about 0.583 times the rate at 2 mg/L, or about 41.7% lower, for the same baseline burden. This is an association conditional on the model covariates, not by itself evidence that raising exposure would cause the rate to fall.

There is a small rounding issue worth making explicit. The displayed rounded rates give \(0.6210/1.066\approx0.5826\), whereas the model-based ratio from the unrounded coefficient is \(\exp(-0.540)\approx0.5827\). These differ because the displayed rates have been rounded; the model-based contrast is the appropriate rate ratio to report.

A Wald 95% confidence interval for the exposure coefficient is \(-0.180\pm1.96(0.060)=[-0.2976,-0.0624]\). Exponentiating both limits gives \([\exp(-0.2976),\exp(-0.0624)]=[0.7426,0.9395]\) for a 1 mg/L exposure increase. Under the model and its standard-error approximation, this interval is compatible with a rate ratio from 0.7426 to 0.9395 per 1 mg/L increase, holding baseline burden fixed. It is not a 95% probability statement about a fixed parameter. The interval describes uncertainty in the estimated conditional association and does not address bias from confounding or model misspecification.

Worked Example: Predicting Counts at a Different Baseline Burden and Follow-Up Time

For a hypothetical participant with baseline burden \(B=8\) seizures per 28 days, exposure \(C=5\) mg/L, and 42 days of follow-up, calculate the model-predicted expected count using the same fitted output.

First calculate the rate. Relative to the reference baseline, \(B/2=8/2=4\), so the baseline multiplier is \(4^{0.70}=\exp\{0.70\log(4)\}\approx2.639\). The exposure multiplier relative to 2 mg/L is \(\exp\{-0.180(5-2)\}=\exp(-0.540)\approx0.5827\). Therefore,

$$ r(5,8)=1.06564(0.582748)(2.63902)\approx1.639 $$

seizures per 28 days. Forty-two days is \(42/28=1.5\) reference periods, so the expected count is

$$ \mu=(42/28)(1.639)\approx2.458 $$

seizures. This is a model-based expected count; it need not be an integer, and it does not state that this particular participant will experience a fractional seizure. The estimate is conditional on the fitted coefficients, the specified exposure, and the baseline burden.

Overdispersion, Diagnostics, and Alternatives

In the hypothetical fit, suppose a participant has predicted mean \(\mu=1.50\) seizures over a specified period and \(\hat{\alpha}=0.40\). The NB2 conditional variance is

$$ \widehat{\operatorname{Var}}(Y)=1.50+0.40(1.50)^2=2.40. $$

A Poisson model with the same mean would have variance \(1.50\). The larger negative-binomial variance allows a wider spread of counts around that mean. It does not guarantee correct predictions: misspecified exposure effects, an unsuitable baseline adjustment, excess zeros, or dependence among observations may remain.

Useful checks include comparing observed and predicted counts across exposure and baseline-burden ranges, examining residual patterns against fitted values and covariates, and checking whether a few participants dominate the estimated exposure slope. Compare observed and predicted proportions of zero and high counts; systematic discrepancies can signal a poor distributional fit. Assess whether estimates materially change under plausible alternative exposure or baseline specifications. A pattern in residuals across exposure suggests that the assumed linear effect on log rate may be inadequate; simply increasing \(\alpha\) does not fix a wrong mean relationship. With repeated intervals per participant, check the dependence structure rather than treating a dispersion parameter as a substitute for correlation modeling.

ApproachStrengthImportant limitation
Poisson regression with offsetDirect rate interpretation and a simple mean-variance model.Its variance-equals-mean assumption can understate uncertainty when counts are overdispersed.
Negative-binomial regressionAllows variance to exceed the mean through a dispersion parameter while retaining a log-rate interpretation.Does not automatically address repeated-measure correlation, confounding, excess structural zeros, or mean-model misspecification.
Quasi-Poisson regressionCan adjust standard errors for overdispersion without specifying a full count probability distribution.It does not provide the same fully specified likelihood for likelihood-based comparisons or count probability predictions.
Zero-inflated or hurdle count modelsCan distinguish a modeled zero-generating component from positive-count behavior when the data and scientific question support that structure.They add assumptions and parameters; an abundance of zeros alone does not establish a separate zero-generating process.

The negative-binomial model is most useful when a single overdispersed count process with a defensible log-linear mean is an adequate approximation. Its rate predictions rely on the exposure-response functional form and covariate adjustment, and can be imprecise outside the exposure and baseline ranges represented in the data. It also summarizes counts over an interval; it does not describe the timing or spacing of individual seizures within that interval.

Common Pitfall

A common mistake is to compare total seizure counts across participants or treatment groups without accounting for follow-up duration, then interpret the difference as an exposure effect. A longer observation period creates more opportunity to observe events, while baseline burden can predict follow-up counts independently of exposure. The correction is to define the count window and at-risk time, include the log-time offset, adjust for a justified baseline measure, and interpret the fitted exposure contrast conditionally. Even after those steps, an observational exposure association is not automatically causal.

Key takeaway: A negative-binomial PK/PD count model links expected seizure rate to exposure and baseline burden while using an offset to account for observation time. Report rate ratios and predicted rates with their units, assess fit beyond overdispersion, and state the assumptions that make the exposure interpretation credible.

Check Your Understanding

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

  1. A participant has 6 seizures in 42 days. What is the observed rate per 28 days?
  2. In the stated model, what is the rate ratio for a 2 mg/L exposure increase if \(\beta_E=-0.12\) per mg/L?
  3. For \(\mu=2\) and \(\alpha=0.50\), what is the NB2 variance, and how does it compare with the Poisson variance?
  4. Why does an offset with \(\log(T_i/28)\) have a coefficient fixed at 1?
  5. What limitation arises if the same participant contributes several interval counts?

Solutions. (1) The rate is \(6/(42/28)=6/1.5=4.00\) seizures per 28 days. (2) The rate ratio is \(\exp\{(-0.12)(2)\}=\exp(-0.24)\approx0.7866\); the modeled rate is about 21.3% lower for a 2 mg/L increase, conditional on the other covariates. (3) The NB2 variance is \(2+0.50(2^2)=4.00\); the Poisson variance would be 2, so the negative-binomial model permits greater variability. (4) The offset encodes proportional scaling of expected counts with observed time at risk; fixing its coefficient at 1 makes the model a rate model rather than estimating an unconstrained time relationship. (5) Counts from the same participant may be correlated, and the basic independent-participant model does not account for that dependence. A suitable repeated-measures or other dependence structure is needed.

Clinical Biostats