From Dose to Exposure to Response: PK/PD Modeling

PK/PD Modeling
Follow hypothetical Compound X from IV and oral doses to plasma concentrations and biomarker inhibition using simple base R calculations.

Same dose, same response?

Two people receive the same dose. Do they experience the same drug concentrations? And if their concentrations match, must their responses match too?

Follow hypothetical Compound X from a single intravenous dose to oral dosing, drug exposure, and biomarker inhibition. This notebook is self-contained.

We will connect three quantities:

Dose (mg) → plasma concentration (mg/L) → biomarker inhibition (%)

All values are hypothetical. Compound X is a teaching example, not a real drug. The biomarker effect is not a prediction of clinical benefit or a dosing recommendation.

The calculations use base R, with no additional packages. To render this .qmd file, use R with Quarto, knitr, and rmarkdown; see the repository setup instructions. Run the code blocks in order. Each calculation uses the values defined above it.

1. Start with one intravenous dose

An intravenous (IV) bolus places the dose directly into the systemic circulation. We start with one well-mixed compartment and first-order elimination: the elimination rate is proportional to the amount of drug present. Clearance and volume remain constant, and there is no drug in the body before the dose.

The compartment is a mathematical representation, not an anatomical space. Its apparent volume relates the amount of drug in the body to the measured concentration.

Parameter Meaning Example value
\(D\) Dose 100 mg
\(V\) Apparent volume of distribution 20 L
\(CL\) Clearance 2 L/h
\(k = CL/V\) Elimination rate constant 0.1 h\(^{-1}\)

If \(A(t)\) is the amount in the body and \(C(t)=A(t)/V\), mass balance gives

\[ \frac{dA(t)}{dt} = -CL\,C(t) = -\frac{CL}{V}A(t), \qquad A(0^+) = D. \]

Here \(0^+\) means immediately after the bolus. Clearance has units of volume per time; multiplying it by concentration gives the amount eliminated per time. The solution is

\[ C_{\mathrm{IV}}(t) = \frac{D}{V}e^{-kt}. \]

We can calculate this directly in R without a differential equation solver.

dose <- 100          # mg
volume <- 20         # L
clearance <- 2       # L/h
k <- clearance / volume

time <- seq(0, 48, by = 0.1)  # hours after dosing
initial_concentration <- dose / volume
concentration_iv <- initial_concentration * exp(-k * time)
half_life <- log(2) / k

half_life
[1] 6.931472

seq() creates the times at which we calculate concentration. exp() calculates the exponential in the equation. R applies the calculation to every time in the sequence.

par(bg = "white")
plot(time, concentration_iv, type = "l", lwd = 2, col = "#176b82",
     xlab = "Time after dose (h)", ylab = "Concentration (mg/L)")
half_concentration <- initial_concentration / 2

# Draw guides from the half-life point to the plot axes.
plot_limits <- par("usr")
segments(plot_limits[1], half_concentration, half_life, half_concentration,
         col = "grey55", lty = 2)
segments(half_life, plot_limits[3], half_life, half_concentration,
         col = "grey55", lty = 2)
axis(1, at = half_life, labels = sprintf("%.1f", half_life),
     col.axis = "grey35", cex.axis = 0.85)
axis(2, at = half_concentration, labels = half_concentration,
     col.axis = "grey35", cex.axis = 0.85)
points(half_life, half_concentration, pch = 19)
text(half_life, half_concentration, "Half-life", pos = 4, cex = 0.85)
A decay curve starts at 5 mg/L. A horizontal dashed guide connects the half-life point to 2.5 mg/L on the y-axis, and a vertical dashed guide connects it to 6.9 hours on the x-axis.
Figure 1: After a 100 mg IV bolus, concentration starts at 5 mg/L. Dashed guides mark when it reaches half that concentration, 2.5 mg/L at 6.9 hours.

The initial concentration is \(C_0 = D/V = 100\ \mathrm{mg}/20\ \mathrm{L} = 5\ \mathrm{mg/L}\). With first-order elimination, it halves approximately every 6.9 hours.

\[ t_{1/2} = \frac{\log(2)V}{CL}. \]

At fixed volume, increasing clearance shortens the half-life. At fixed clearance, increasing volume lowers the initial concentration and lengthens the half-life. Dose scales the concentration profile proportionally under these linear assumptions.

2. From an oral dose to a concentration–time curve

An oral dose takes time to enter the bloodstream. We will represent that with first-order absorption into one well-mixed compartment, followed by first-order elimination. The model assumes constant bioavailability, clearance, and volume, with no absorption lag or drug present before the first dose.

Keep the same dose, volume, and clearance. Add two parameters for absorption:

Parameter Meaning Example value
\(F\) Fraction reaching systemic circulation unchanged 0.8 (80%)
\(k_a\) Absorption rate constant 1 h\(^{-1}\)

With these assumptions, concentration after one oral dose is

\[ C(t) = \frac{F D k_a}{V(k_a-k)}\left(e^{-kt}-e^{-k_a t}\right). \]

You do not need to solve a differential equation to use this result. The two exponential terms describe the rise and fall of concentration. This version of the equation requires \(k_a \ne k\); keep the two rate constants different when experimenting.

bioavailability <- 0.8
ka <- 1              # 1/h

concentration <- bioavailability * dose * ka / (volume * (ka - k)) *
  (exp(-k * time) - exp(-ka * time))

The oral profile starts at zero, rises as drug is absorbed, and then declines.

par(bg = "white")
plot(time, concentration, type = "l", lwd = 2, col = "#176b82",
     xlab = "Time after dose (h)", ylab = "Concentration (mg/L)")
Plasma concentration starts at zero, peaks near 3.1 mg/L at about 2.6 hours, then declines toward zero over 48 hours.
Figure 2: Compound X rises to a peak after oral dosing, then declines as elimination continues.

Peak, exposure, and half-life

\(C_{\max}\) is the peak concentration, and \(T_{\max}\) is when it occurs. Here we find the peak on our simulated time grid. In a study, the highest measured concentration also depends on when samples are collected.

For this linear model, total single-dose exposure from time zero to infinity and the elimination half-life are

\[ \mathrm{AUC}_{0-\infty} = \frac{F D}{CL}, \qquad t_{1/2} = \frac{\log(2)V}{CL}. \]

cmax <- max(concentration)
tmax <- time[which.max(concentration)]
auc <- bioavailability * dose / clearance
half_life <- log(2) * volume / clearance

data.frame(
  Cmax_mg_L = cmax,
  Tmax_h = tmax,
  AUC_0_infinity_mg_h_L = auc,
  Elimination_half_life_h = half_life
)
  Cmax_mg_L Tmax_h AUC_0_infinity_mg_h_L Elimination_half_life_h
1  3.096791    2.6                    40                6.931472

which.max() gives the position of the highest concentration; square brackets select the time at that position. data.frame() puts the results into a table.

The total AUC is 40 mg·h/L and the elimination half-life is about 6.9 hours. The plot stops at 48 hours, but the AUC calculated above includes the remaining exposure beyond that time. If absorption were slower than elimination, the final decline after oral dosing could reflect absorption rather than this elimination half-life.

Slower absorption: same total AUC, different peak

Now keep the dose and bioavailability unchanged but reduce the absorption rate constant.

ka_slow <- 0.3
concentration_slow <- bioavailability * dose * ka_slow /
  (volume * (ka_slow - k)) *
  (exp(-k * time) - exp(-ka_slow * time))
par(bg = "white")
plot(time, concentration, type = "l", lwd = 2, col = "#176b82",
     xlab = "Time after dose (h)", ylab = "Concentration (mg/L)")
lines(time, concentration_slow, lwd = 2, lty = 2, col = "#b45309")
legend("topright", c("Faster absorption", "Slower absorption"),
       col = c("#176b82", "#b45309"), lty = c(1, 2), lwd = 2, bty = "n")
The faster-absorption curve peaks earlier and higher; the slower-absorption curve has a later, lower peak and higher concentrations later on.
Figure 3: Slower absorption lowers and delays the peak. Both curves have the same AUC from zero to infinity because dose, bioavailability, and clearance are unchanged.

This is a simplified way to illustrate different absorption rates. It does not describe every feature of a modified-release formulation. Equal total AUC does not mean equal concentration at every time, or equal AUC over a shorter interval.

3. Same dose, different exposure

Imagine a second person with clearance of 4 L/h instead of 2 L/h. Keep everything else the same, including the 100 mg oral dose.

clearance_high <- 4
k_high <- clearance_high / volume

concentration_high_clearance <- bioavailability * dose * ka /
  (volume * (ka - k_high)) *
  (exp(-k_high * time) - exp(-ka * time))

data.frame(
  Clearance_L_h = c(clearance, clearance_high),
  AUC_0_infinity_mg_h_L = bioavailability * dose /
    c(clearance, clearance_high)
)
  Clearance_L_h AUC_0_infinity_mg_h_L
1             2                    40
2             4                    20
par(bg = "white")
plot(time, concentration, type = "l", lwd = 2, col = "#176b82",
     xlab = "Time after dose (h)", ylab = "Concentration (mg/L)")
lines(time, concentration_high_clearance, lwd = 2, lty = 2, col = "#b45309")
legend("topright", c("Clearance: 2 L/h", "Clearance: 4 L/h"),
       col = c("#176b82", "#b45309"), lty = c(1, 2), lwd = 2, bty = "n")
Concentration is lower and declines faster with clearance of 4 L/h than with clearance of 2 L/h.
Figure 4: At the same dose, higher clearance reduces exposure: doubling clearance halves total AUC in this linear model.

The same dose produces AUC values of 40 and 20 mg·h/L. A difference in exposure could therefore explain a difference in response even before considering pharmacodynamic sensitivity.

4. From concentration to biomarker inhibition

Suppose Compound X can reduce an inflammatory biomarker by at most 80% relative to its baseline. Use an immediate E-max model:

\[ I(C) = \frac{I_{\max} C}{EC_{50} + C}. \]

\(I(C)\) is biomarker inhibition in percent. \(I_{\max}\) is the maximum inhibition, and \(EC_{50}\) is the concentration producing half of that maximum. We use the symbol \(I_{\max}\) because the effect is inhibition; it represents the maximum drug effect in this E-max relationship.

At \(EC_{50}\), inhibition is 40%, half of the 80% maximum. It is not necessarily 50% inhibition.

imax <- 80            # maximum biomarker inhibition (%)
ec50 <- 0.5           # mg/L

concentration_range <- seq(0, 5, by = 0.05)
inhibition <- imax * concentration_range / (ec50 + concentration_range)

# A less sensitive system needs a higher concentration for the same effect.
ec50_less_sensitive <- 1.5
inhibition_less_sensitive <- imax * concentration_range /
  (ec50_less_sensitive + concentration_range)
par(bg = "white")
ec50_values <- c(ec50, ec50_less_sensitive)
curve_colors <- c("#176b82", "#b45309")
half_max <- imax / 2

plot(concentration_range, inhibition, type = "n",
     ylim = c(0, 1.08 * imax), xlab = "Concentration (mg/L)",
     ylab = "Biomarker inhibition (%)")
segments(0, half_max, max(ec50_values), half_max, col = "grey65", lty = 3)
segments(ec50_values, 0, ec50_values, half_max, col = "grey65", lty = 3)
lines(concentration_range, inhibition, lwd = 2, col = curve_colors[1])
lines(concentration_range, inhibition_less_sensitive,
      lwd = 2, lty = 2, col = curve_colors[2])
points(ec50_values, rep(half_max, length(ec50_values)), pch = 19, col = curve_colors)
abline(h = imax, lty = 3)
text(max(concentration_range), 1.04 * imax, sprintf("Shared maximum (%g%%)", imax),
     adj = c(1, 0.5), cex = 0.85)
legend("bottomright", sprintf("EC50: %g mg/L", ec50_values),
       col = curve_colors, lty = c(1, 2), lwd = 2, bty = "n")
Two rising curves share a dotted ceiling labeled 80%. At 40% inhibition, guides connect the marked points to concentrations of 0.5 mg/L on the solid curve and 1.5 mg/L on the dashed curve.
Figure 5: Both curves approach the same 80% maximum. The marked EC50 points show that 40% inhibition occurs at 0.5 mg/L for the more sensitive curve and 1.5 mg/L for the less sensitive curve.

The same concentration can produce different effects if sensitivity differs. A lower \(EC_{50}\) means greater potency within this model; it does not imply a greater maximum effect.

Double the dose: does the effect double?

Our PK model is linear, so doubling the dose doubles concentration at every time. The inhibition model is nonlinear, so inhibition does not double.

concentration_double_dose <- 2 * concentration

inhibition_time <- imax * concentration / (ec50 + concentration)
inhibition_double_dose <- imax * concentration_double_dose /
  (ec50 + concentration_double_dose)

data.frame(
  Dose_mg = c(dose, 2 * dose),
  Peak_inhibition_percent = round(c(max(inhibition_time),
                                    max(inhibition_double_dose)), 1)
)
  Dose_mg Peak_inhibition_percent
1     100                    68.9
2     200                    74.0
par(bg = "white")
plot(time, inhibition_time, type = "l", lwd = 2, col = "#176b82",
     ylim = c(0, 80), xlab = "Time after dose (h)",
     ylab = "Biomarker inhibition (%)")
lines(time, inhibition_double_dose, lwd = 2, lty = 2, col = "#b45309")
legend("topright", c("100 mg", "200 mg"),
       col = c("#176b82", "#b45309"), lty = c(1, 2), lwd = 2, bty = "n")
The 200 mg dose produces greater inhibition than 100 mg throughout the profile, but peak inhibition rises only modestly because both peaks approach the maximum effect.
Figure 6: Doubling the dose increases inhibition, but the effect remains limited by the 80% maximum.

These curves assume inhibition follows plasma concentration immediately. Near the plateau, a large increase in concentration produces only a small additional effect.

5. Same daily dose, different dosing schedules

Compare two dosing schedules:

  • 100 mg every 24 hours.
  • 50 mg every 12 hours.

Both provide 100 mg per day. Under linear, time-invariant PK with unchanged bioavailability and clearance, their 24-hour AUC at steady state is the same:

\[ \mathrm{AUC}_{\text{24 h, steady state}} = \frac{F\times\text{daily dose}}{CL} = 40\ \mathrm{mg\cdot h/L}. \]

That equality applies at steady state. Starting with no drug in the body, the AUC over the first day need not be equal for the two schedules.

With linear PK, we can add together the concentrations contributed by each dose. The code below uses one loop for each schedule. Each loop applies the same single-dose equation we used earlier.

time_repeated <- seq(0, 168, by = 0.1)  # seven days
concentration_daily <- rep(0, length(time_repeated))
concentration_twice_daily <- rep(0, length(time_repeated))

for (dose_time in seq(0, 144, by = 24)) {
  after_dose <- time_repeated >= dose_time
  hours_since_dose <- time_repeated[after_dose] - dose_time

  concentration_daily[after_dose] <- concentration_daily[after_dose] +
    bioavailability * 100 * ka / (volume * (ka - k)) *
    (exp(-k * hours_since_dose) - exp(-ka * hours_since_dose))
}

for (dose_time in seq(0, 156, by = 12)) {
  after_dose <- time_repeated >= dose_time
  hours_since_dose <- time_repeated[after_dose] - dose_time

  concentration_twice_daily[after_dose] <- concentration_twice_daily[after_dose] +
    bioavailability * 50 * ka / (volume * (ka - k)) *
    (exp(-k * hours_since_dose) - exp(-ka * hours_since_dose))
}

rep(0, ...) starts each profile at zero. after_dose selects times at or after the dose, so a future dose cannot contribute to an earlier concentration. The loop adds each dose’s contribution to the existing profile.

Calculate inhibition from the total concentration at each time. We add concentrations because the PK model is linear; we cannot add the inhibition from separate doses because the PD model is nonlinear.

inhibition_daily <- imax * concentration_daily / (ec50 + concentration_daily)
inhibition_twice_daily <- imax * concentration_twice_daily /
  (ec50 + concentration_twice_daily)

# Show the final day, when these example profiles are very close to steady state.
last_day <- time_repeated >= 144
hours_in_day <- time_repeated[last_day] - 144
par(bg = "white", mfrow = c(2, 1))
plot(hours_in_day, concentration_daily[last_day], type = "l",
     lwd = 2, col = "#176b82", ylim = c(0, 4),
     xlab = "Hours into day seven", ylab = "Concentration (mg/L)")
lines(hours_in_day, concentration_twice_daily[last_day],
      lwd = 2, lty = 2, col = "#b45309")
legend("topright", c("100 mg every 24 h", "50 mg every 12 h"),
       col = c("#176b82", "#b45309"), lty = c(1, 2), lwd = 2, bty = "n")

plot(hours_in_day, inhibition_daily[last_day], type = "l",
     lwd = 2, col = "#176b82", ylim = c(0, 80),
     xlab = "Hours into day seven", ylab = "Biomarker inhibition (%)")
lines(hours_in_day, inhibition_twice_daily[last_day],
      lwd = 2, lty = 2, col = "#b45309")
par(mfrow = c(1, 1))
Two panels show the final 24 hours. Once-daily dosing has one higher concentration peak and a lower trough; twice-daily dosing has two smaller peaks and maintains more consistent inhibition.
Figure 7: On day seven, both schedules are very close to steady state. Dividing the daily dose reduces fluctuations in concentration and immediate biomarker inhibition in this example.

Steady state means a repeating pattern, not a flat concentration. Here, divided dosing produces smaller peaks and higher troughs. The trough is the concentration just before the next dose; it is not the zero concentration at the start of a first-dose profile.

The inhibition curves illustrate the consequences of our chosen immediate E-max relationship. They do not establish that one regimen is clinically better. A different sensitivity, delayed response, or safety relationship could change the comparison.

6. What if the effect arrives late?

Some drug effects peak after plasma concentration has begun falling. Our immediate model cannot reproduce that behavior: inhibition is determined entirely by the current concentration.

A delay could reflect slow movement to the site of action or turnover of the biomarker itself. If a drug inhibits biomarker production, existing biomarker still takes time to disappear. In either case, the same plasma concentration may accompany different effects while concentrations are rising and falling, producing a hysteresis loop.

Those mechanisms need an additional model for how the effect site or biomarker changes over time. We leave those equations for a dedicated notebook. A hysteresis loop alone would not identify which mechanism caused the delay.

Try changing one thing

Change one parameter at a time, then rerun all code from the beginning. This updates dependent calculations such as k <- clearance / volume before redrawing the plots.

  • Change clearance from 2 to 4. How do exposure and inhibition change?
  • Change ec50 from 0.5 to 2. Does doubling the dose now make a bigger difference near the peak?
  • Change imax from 80 to 60. Which curves change, and which stay the same?
  • Plot all seven days of repeated-dose concentrations instead of selecting last_day. Can you see the profiles approach a repeating pattern?

What this model tells us—and what it leaves open

Dose, exposure, and effect are different quantities. Equal doses can produce different exposures; equal concentrations can produce different effects; and equal daily AUC can accompany different concentration and effect profiles.

This model is deliberately limited to linear one-compartment PK, first-order absorption, and an immediate saturating biomarker effect. It does not include active metabolites, protein binding, nonlinear clearance, delayed effects, disease progression, or measurement noise. It also assumes plasma concentration is a useful driver of the biomarker response.

Finally, 80% biomarker inhibition does not imply 80% symptom improvement. Clinical benefit and adverse effects require their own evidence and relationships to exposure. An observed exposure–outcome association alone does not establish that changing exposure would cause a better outcome.

Further reading

Subscribe

Subscribe for new podcast episodes and resources.