Tutorials › Pharmacometric Workflows and Reproducible Modeling › Fixed Effects And Random Effects In Virtual Populations

Simulation Pipelines · Tutorial 235 of 399

Fixed Effects And Random Effects In Virtual Populations

Distinguish population-level fixed effects from subject-level random effects and see how each changes predictions for virtual patients.

Advanced 12 min read

What You'll Learn

  • Identify fixed effects, covariate effects, and subject-specific random effects in a population model.
  • Interpret typical values in models that use exponential random effects.
  • Generate and check virtual-patient parameters from a random-effects distribution.
  • Explain why the average prediction across virtual patients can differ from the typical-subject prediction.
  • Distinguish interindividual variability from parameter uncertainty and residual error.
  • Recognize limitations of the random-effects distribution used to construct a virtual population.

Why Separate Typical Behavior From Individual Variability?

A population pharmacometric model can describe both a typical response and differences among individuals. These are related, but not interchangeable, parts of the model. Fixed effects specify the shared structure and typical parameter values for a defined scenario. Random effects represent modeled differences among individuals around that typical behavior. A virtual population that includes random effects therefore generates a distribution of individual predictions, not merely repeated copies of the typical prediction.

This distinction matters when a simulation is used to compare regimens, describe variability in exposure, or predict the fraction of virtual patients above a threshold. A fixed-effects-only run can be useful for a typical-subject result, but it cannot by itself represent between-subject variability. Conversely, drawing random effects does not mean that the fixed effects have also been varied to represent uncertainty in their estimates.

Definition: Fixed effects are model parameters shared across individuals in a specified simulation scenario, such as typical clearance, a covariate coefficient, or an absorption-rate parameter. Random effects are modeled individual-level deviations from the shared behavior. In a common population model, subject \(i\)'s parameter is written as \(\theta_i=g(\theta,x_i,\eta_i)\), where \(\theta\) contains fixed effects, \(x_i\) contains that subject's covariates, and \(\eta_i\) is a random-effect vector.

A Standard Population-Model Representation

For a positive pharmacokinetic parameter such as clearance, a common specification is

$$ CL_i=TVCL\exp(\eta_{CL,i}), \qquad \eta_{CL,i}\sim N(0,\omega_{CL}^2). $$

Here \(TVCL\) is the typical clearance for the reference covariate values, and \(\omega_{CL}^2\) is the variance of the clearance random effect on the log scale. The random effect is centered at zero; consequently, when \(\eta_{CL,i}=0\), the individual's clearance equals \(TVCL\). Because exponentiation keeps clearance positive, this specification produces a lognormal distribution of individual clearances. \(TVCL\) is the median, also the geometric mean, of that distribution when covariates are held at their reference values; it is not generally its arithmetic mean.

Fixed effects can also determine how typical behavior changes with covariates. For example, a model might specify \(TVCL_i=TVCL(WT_i/70)^{\theta_{WT}}\), where \(WT_i\) is body weight in kilograms and \(\theta_{WT}\) is a shared fixed-effect coefficient. The individual parameter then becomes \(CL_i=TVCL_i\exp(\eta_{CL,i})\). The covariate term shifts the typical value for a patient with those covariates; the random effect describes the patient's deviation from that covariate-adjusted typical value.

These statements rely on a specified model and a specified random-effects distribution. In the standard example, random effects have mean zero and variance \(\omega_{CL}^2\); they are sampled across subjects according to that distribution, and covariates are assigned according to the simulation target. If several random effects are included, their joint distribution and any modeled correlations must also be respected. A particular simulation can use other distributional assumptions, but the resulting virtual population represents those assumptions, not a distribution-free set of patients.

Worked Example: Calculating Clearance for One Virtual Patient

Suppose a hypothetical model has \(TVCL=5.5267\ \mathrm{L/h}\). A simulated patient has the random-effect draw \(\eta_{CL,i}=0.300\). Calculate that patient's clearance, assuming covariates are at the reference values.

The model is \(CL_i=TVCL\exp(\eta_{CL,i})\). Substituting the values gives

$$ CL_i=5.5267\exp(0.300) =5.5267(1.34986) \approx 7.460\ \mathrm{L/h}. $$

Thus this hypothetical patient's clearance is approximately \(7.460\ \mathrm{L/h}\). The fixed effect \(TVCL\) remains \(5.5267\ \mathrm{L/h}\); the difference arises from the random-effect realization. A positive \(\eta_{CL,i}\) increases clearance because the exponential multiplier exceeds one. This calculation does not imply that the model's typical clearance has changed.

What Random Effects Add to a Virtual Population

A virtual population is produced by applying the model to a set of simulated individuals. Each individual receives covariates and, when the target includes between-subject variability, random-effect draws. Holding the fixed effects constant while drawing different random effects gives individuals different parameters under the same population model. If random effects are omitted or set to zero, the resulting subjects share the same random-effect component, even if their covariates differ.

The distinction between a typical individual and a random individual is especially clear for the exponential model. The typical individual has \(\eta_{CL,i}=0\) and clearance \(TVCL\). A simulated individual instead receives a draw from the modeled distribution. Most draws may be near zero, but some are farther away; the frequency and magnitude of those deviations depend on \(\omega_{CL}^2\).

Worked Example: Two Random-Effect Draws Around a Typical Clearance

Consider a hypothetical model with \(TVCL=10.00\ \mathrm{L/h}\) and \(\eta_{CL,i}\sim N(0,0.20^2)\). For illustration, two virtual patients receive draws \(-0.200\) and \(+0.200\). Calculate their clearances and compare their arithmetic mean with the typical clearance.

For the first patient,

$$ CL_1=10.00\exp(-0.200) =10.00(0.8187308) =8.187\ \mathrm{L/h}. $$

For the second patient,

$$ CL_2=10.00\exp(0.200) =10.00(1.221403) =12.21\ \mathrm{L/h}. $$

The arithmetic mean of these two clearances is

$$ \frac{8.1873+12.2140}{2} =10.20065 \approx 10.20\ \mathrm{L/h}. $$

The two draws are equal in magnitude and opposite in sign, so their geometric mean is \(10.00\ \mathrm{L/h}\), the typical clearance. Their arithmetic mean is higher because exponentiation is nonlinear. These two selected draws illustrate the distinction; they do not establish the distribution's mean from a sample of two.

Why the Mean of Individual Predictions Can Differ

The individual random effect enters the parameter through a transformation, and that parameter in turn enters a prediction. In general, the average of predictions from simulated individuals need not equal the prediction calculated at the typical parameter. A short derivation shows this even for clearance alone. If \(\eta\sim N(0,\omega^2)\), the normal moment-generating function gives \(E[\exp(\eta)]=\exp(\omega^2/2)\). Therefore,

$$ E[CL]=TVCL\,E[\exp(\eta)] =TVCL\exp(\omega^2/2), $$

which exceeds \(TVCL\) whenever \(\omega^2>0\). The derivation assumes the stated normal distribution and the exponential parameterization. It does not say that \(TVCL\) is incorrectly specified: \(TVCL\) is the typical value on the model's scale, while the arithmetic population mean is a different summary.

Worked Example: Typical Exposure Versus Average Exposure Across Patients

Suppose a hypothetical one-compartment setting uses \(AUC_i=Dose/CL_i\), with a dose of \(100\ \mathrm{mg}\), \(TVCL=10.00\ \mathrm{L/h}\), and \(\eta_i\) draws of \(-0.200\) and \(+0.200\). Ignore other sources of variability. Calculate the typical-subject AUC and the average of the two individual AUCs.

At the typical value, clearance is \(10.00\ \mathrm{L/h}\), so

$$ AUC_{typ}=\frac{100\ \mathrm{mg}}{10.00\ \mathrm{L/h}} =10.00\ \mathrm{mg\,h/L}. $$

The two individual clearances from the previous calculation are \(8.1873\ \mathrm{L/h}\) and \(12.2140\ \mathrm{L/h}\). Their AUCs are

$$ AUC_1=\frac{100}{8.1873} =12.214\ \mathrm{mg\,h/L}, \qquad AUC_2=\frac{100}{12.2140} =8.1873\ \mathrm{mg\,h/L}. $$

The average of these two AUCs is \((12.214+8.1873)/2=10.20065\), or approximately \(10.20\ \mathrm{mg\,h/L}\). It differs from the typical-subject AUC of \(10.00\ \mathrm{mg\,h/L}\). Here the difference follows from taking reciprocals of the variable clearances. A simulation summary should therefore match the target: a typical-subject prediction and an average across a virtual population answer different questions.

Implementation Checks and Common Failure Modes

Before interpreting a virtual-population result, check that the implemented model generated the kind of individuals the simulation target requires. The earlier material on conditional and unconditional simulation targets distinguishes targets that condition on individual effects from those that average over them. In this tutorial's terms, the key practical question is whether the random effects were included, and whether they were sampled or fixed at specified values for the target at hand.

  • Check the scale of the random effect. In \(CL_i=TVCL\exp(\eta_i)\), \(\eta_i\) is on the log scale. Adding \(\eta_i\) directly to clearance, or exponentiating a variance rather than a random-effect draw, changes the model.
  • Check the distribution and spread. Compare simulated random effects with their intended mean, variance, and distribution. For a finite sample, the empirical mean and variance will not be exactly their theoretical values, but large discrepancies can indicate a coding, scaling, or sampling error.
  • Check the parameter transformation. Positive parameters modeled exponentially should remain positive. Extremely large or small values may be possible under a broad distribution; inspect their frequency and consider whether the assumed distribution is scientifically plausible.
  • Check the covariate reference and units. A fixed covariate effect is applied at the covariate values specified by the model. Incorrect units or an unintended reference value can shift all typical parameters before random effects are applied.
  • Check whether repeated observations share the subject effect. In a model with subject-level random effects, repeated records for one subject generally use that subject's same draw, rather than resampling a new subject effect at every observation.

A frequent mistake is to call \(TVCL\) the arithmetic mean clearance and then treat a simulated population's higher arithmetic mean as evidence that the simulation is wrong. That conclusion does not follow: for the exponential-normal model, the arithmetic mean is \(TVCL\exp(\omega^2/2)\), whereas \(TVCL\) is the median. The correction is to name the summary precisely and compare like with like.

Choosing the Representation for the Question

A fixed-effects-only prediction is appropriate when the intended result is the model's typical behavior at specified covariates. A virtual population with random effects is appropriate when the target requires between-subject variability, such as a distribution of exposures or the proportion of individuals meeting a criterion. These approaches are not competing ways to estimate the same quantity: they answer different simulation questions.

A more flexible alternative to a parametric random-effects distribution is to use a set of empirical individual effects, when such effects are available and the analysis design justifies their use. This can preserve features that a chosen normal distribution does not represent, but it does not remove the need to define the target population and assess representativeness. A further limitation applies to either approach: random effects describe variability under the specified model and distribution. They do not, by themselves, represent uncertainty in the estimated fixed effects; that is a separate simulation component.

Thus, simulation results should be reported with enough detail to identify the fixed-effect values, covariate scenario, random-effects specification, and whether the reported quantity describes a typical individual or a summary over simulated individuals. A precise description makes the result interpretable and helps distinguish model behavior from choices made in constructing the virtual population.

Check Your Understanding

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

  1. In \(CL_i=TVCL\exp(\eta_i)\), what clearance does an individual have when \(\eta_i=0\), and what does \(TVCL\) represent under normally distributed \(\eta_i\)?
  2. A model has \(TVCL=8.00\ \mathrm{L/h}\) and a patient's draw is \(\eta_i=0.10\). Calculate the patient's clearance to three significant figures.
  3. Why can the arithmetic mean of individual clearances exceed \(TVCL\) when random effects are normal with mean zero?
  4. What is lost if all random effects are set to zero when the goal is to describe between-subject exposure variability?

Solutions. (1) When \(\eta_i=0\), \(CL_i=TVCL\). With normal random effects in the exponential model, \(TVCL\) is the median clearance at reference covariates, not generally the arithmetic mean. (2) \(CL_i=8.00\exp(0.10)=8.00(1.10517)=8.84\ \mathrm{L/h}\). (3) Exponentiation is nonlinear: if \(\eta_i\sim N(0,\omega^2)\), then \(E[\exp(\eta_i)]=\exp(\omega^2/2)>1\) for \(\omega^2>0\), so \(E[CL]=TVCL\exp(\omega^2/2)>TVCL\). (4) Setting every random effect to zero removes modeled between-subject variability from the parameter values, so the simulation cannot describe its contribution to the spread of exposures.

Clinical Biostats