dose <- 100 # mg
volume <- 20 # L
time <- seq(0, 16, by = 0.1) # hours after dosing
volunteer_clearance <- c(3, 4, 5, 6, 7) # L/h
# Store one row per time and one column per volunteer.
profiles <- matrix(NA_real_, nrow = length(time),
ncol = length(volunteer_clearance))
for (i in seq_along(volunteer_clearance)) {
elimination_rate <- volunteer_clearance[i] / volume
profiles[, i] <- dose / volume * exp(-elimination_rate * time)
}
# Compare averaging the predictions with averaging clearance first.
average_profile <- rowMeans(profiles)
average_clearance <- mean(volunteer_clearance)
profile_at_average_clearance <- dose / volume *
exp(-average_clearance / volume * time)Why Are Patients Different? An Introduction to Population PK
Same dose, different people
Give five volunteers the same dose and collect blood at the same times. Why might their concentration profiles still look different? And what would we miss if we looked only at the average profile?
This notebook uses hypothetical Compound X and the same one-compartment IV bolus model as the dose–exposure–response notebook. Everyone receives a single 100 mg intravenous dose and has a volume of distribution of 20 L. We vary clearance first, then add a kidney-function covariate and simulated measurement scatter.
The simulations use base R. Run the code blocks in order. Rendering the whole notebook requires Quarto, knitr, and rmarkdown. See the repository setup instructions.
1. Five volunteers and one average curve
After an IV bolus, the concentration for volunteer \(i\) at time \(t\) follows
\[ C_i(t) = \frac{D}{V}e^{-\frac{CL_i}{V}t}. \]
Here \(D\) is dose (mg), \(V\) is volume of distribution (L), and \(CL_i\) is the volunteer’s clearance (L/h). Time is measured in hours and concentration in mg/L. Everyone starts at \(D/V = 5\) mg/L. Higher clearance makes the concentration decline faster.
par(bg = "white")
matplot(time, profiles, type = "l", lty = 1, col = "grey75",
xlab = "Time after dose (h)", ylab = "Concentration (mg/L)")
lines(time, average_profile, lwd = 2, col = "#176b82")
lines(time, profile_at_average_clearance, lwd = 2, lty = 2, col = "#b45309")
legend("topright", c("Individual profiles", "Mean of five profiles",
"Profile at mean clearance"),
col = c("grey75", "#176b82", "#b45309"), lty = c(1, 1, 2),
lwd = c(1, 2, 2), bty = "n")
The average concentration curve summarizes the group. At 8 hours, its concentration is 0.79 mg/L. The prediction using mean clearance is 0.68 mg/L. The two calculations differ because clearance is inside the exponential. A mean curve also conceals the range of individual exposures.
2. Same typical clearance, different exposure ranges
For a population model, we need a typical value and a way to describe how individuals vary around it. Here typical clearance is 5 L/h. We assign each virtual volunteer a random deviation \(\eta_i\) on the log scale.
\[ CL_i = CL_{\mathrm{typ}}e^{\eta_i}, \qquad \eta_i \sim \mathcal{N}(0,\omega^2). \]
The exponential keeps clearance positive. A deviation of zero gives typical clearance. Half the underlying clearance distribution lies above that value and half below it, so the typical value is the median of this log-normal distribution. The standard deviation \(\omega\) controls the spread on the log scale.
For this linear IV model, total exposure is the area under the concentration–time curve from dosing onward, \(AUC = D/CL_i\). At the same dose, lower clearance gives higher AUC.
typical_clearance <- 5 # L/h
n_volunteers <- 100
set.seed(4) # Reproduce the same random draws each time.
# Reuse the same standard normal draws to isolate the effect of the spread.
standard_draws <- rnorm(n_volunteers)
omega_narrow <- 0.15 # standard deviation on the log-clearance scale
omega_wide <- 0.45
clearance_narrow <- typical_clearance * exp(omega_narrow * standard_draws)
clearance_wide <- typical_clearance * exp(omega_wide * standard_draws)
auc_narrow <- dose / clearance_narrow
auc_wide <- dose / clearance_widepar(bg = "white", mar = c(5.1, 8, 4.1, 2.1))
boxplot(auc_narrow, auc_wide, names = c("Less variability", "More variability"),
horizontal = TRUE, las = 1, col = c("#cae4eb", "#f3d8be"),
xlab = "AUC (mg·h/L)")
abline(v = dose / typical_clearance, lty = 3)
legend("topright", "AUC at typical clearance", lty = 3, bty = "n")
The dotted line marks the exposure at typical clearance, 20 mg·h/L. The boxes show the middle half of each simulated group. The population with greater variability has more volunteers far from the typical exposure in either direction.
The typical clearance is a fixed effect, shared across the population in this example. The individual deviations are random effects that describe between-subject variability. The model is mixed-effects because it combines the two. Concentration depends nonlinearly on clearance, even though doubling the dose doubles exposure at any fixed clearance.
3. Kidney function can explain some differences
A covariate is a measured characteristic used to explain differences in a model parameter. Suppose Compound X is primarily cleared through the kidneys. To illustrate a covariate relationship, we use a fictional kidney-function score and assume typical drug clearance is proportional to the score over the simulated range.
\[ CL_{\mathrm{typ},i} = CL_{\mathrm{ref}}\frac{K_i}{100}, \qquad CL_i = CL_{\mathrm{typ},i}e^{\eta_i}. \]
Here \(K_i\) is the volunteer’s score and \(CL_{\mathrm{ref}}\) is the typical clearance at a score of 100. The score is unitless. At a score of 60, the assumed relationship gives a typical clearance of 3 L/h. Volunteers with the same score can still have different clearances.
kidney_score <- seq(50, 120, length.out = n_volunteers)
clearance_from_score <- typical_clearance * kidney_score / 100
# Add between-subject variability around the covariate prediction.
eta <- rnorm(n_volunteers, mean = 0, sd = omega_narrow)
individual_clearance <- clearance_from_score * exp(eta)par(bg = "white")
plot(kidney_score, individual_clearance, pch = 16, col = "grey45",
ylim = range(individual_clearance, clearance_from_score),
xlab = "Kidney-function score", ylab = "Drug clearance (L/h)")
lines(kidney_score, clearance_from_score, lwd = 2, col = "#176b82")
legend("topleft", "Typical clearance at each score", col = "#176b82",
lty = 1, lwd = 2, bty = "n")
We put this relationship into the simulation. In a study, we would estimate and evaluate it using data. A covariate association alone cannot establish its biological cause. Whether the resulting exposure difference matters depends on the drug’s efficacy and safety.
4. A few measurements from one volunteer
So far, the lines have shown model predictions. A measured concentration can differ from the prediction for the same person and time. A residual error model describes that scatter. To simulate it here, we multiply the predicted concentration at each sampling time by \(e^{\epsilon}\), where \(\epsilon\) is a new random draw for each observation.
sample_time <- c(1, 4, 8) # hours after dosing
one_clearance <- individual_clearance[1]
elimination_rate <- one_clearance / volume
# Use the same individual clearance for the full curve and the sampled times.
individual_profile <- dose / volume * exp(-elimination_rate * time)
predicted_samples <- dose / volume * exp(-elimination_rate * sample_time)
# Draw a separate residual error for each concentration measurement.
residual_sd <- 0.15 # standard deviation on the log-concentration scale
epsilon <- rnorm(length(sample_time), mean = 0, sd = residual_sd)
observed_samples <- predicted_samples * exp(epsilon)par(bg = "white")
plot(time, individual_profile, type = "l", lwd = 2, col = "#176b82",
ylim = c(0, max(individual_profile, observed_samples)),
xlab = "Time after dose (h)", ylab = "Concentration (mg/L)")
segments(sample_time, predicted_samples, sample_time, observed_samples,
lty = 3, col = "grey45")
points(sample_time, observed_samples, pch = 19, col = "#b45309")
legend("topright", "Simulated measurements", pch = 19, col = "#b45309", bty = "n")
Between-subject variability changes the parameter and therefore the whole curve for a given volunteer. Residual error changes individual observations around that curve. If the same volunteer had different clearance across two treatment periods, an unexplained change could be modeled as between-occasion variability. This example uses one occasion per person.
We can draw the full blue curve because we assigned the volunteer’s clearance in the simulation. In a real study, a population model uses the combined dataset to estimate typical behavior and variability. Combining that fitted population model with a volunteer’s own samples can give an empirical Bayes estimate of individual clearance. When individual samples carry little information, those estimates tend to sit closer to the model’s typical prediction, a pattern called shrinkage. The number and timing of samples both matter. For example, moving all three samples close together gives us a shorter window to observe the decline.
Try changing one thing
Change one input at a time and rerun the blocks in order.
- Change
omega_widefrom 0.45 to 0.15. What happens to the two AUC boxplots when the spread is the same? - Set the covariate section’s
sdargument inrnorm()to zero. Where do the individual clearances fall relative to the typical clearance line? - Change
sample_timetoc(7, 7.5, 8). How much of the concentration decline are you now sampling? - Set
residual_sdto zero. Where do the measured points land relative to the predicted curve?
What this model tells us
A single dose can produce a range of exposures even when everyone starts at the same concentration. A population model gives us a way to describe the typical value, the spread around it, and the part of that variation we can explain with measured characteristics.
Here the model inputs are specified and the data are simulated. In an actual analysis, we’d check whether a fitted model reproduces the observed trends and variability under the study’s sampling design. We’d also evaluate whether its predictions are reliable for the population and decision we have in mind.
Further reading
- Sheiner LB, Rosenberg B, Marathe VV. Estimation of population characteristics of pharmacokinetic parameters from routine clinical data. J Pharmacokinet Biopharm. 1977. Original paper
- Savic RM, Karlsson MO. Importance of shrinkage in empirical Bayes estimates for diagnostics: problems and solutions. AAPS J. 2009. Open-access paper