This example uses [derived] to compute pharmacodynamic metrics from PK predictions after the fit: an Emax response, a TAD-gated Cmax, and time-above-MEC per dosing interval.
The PD parameters (MEC, EMAX, EC50) are fixed at assumed values — they do not enter the PK likelihood and cannot be estimated from PK-only data. Only TVCL, TVV, TVKA, and the random effects are estimated.
The PK thetas have proper SEs; MEC, EMAX, and EC50 show SE = 0 because they are fixed:
fit$estimates
param transform estimate se rse_pct lower_95
1 TVCL identity 0.132969032 0.0066273862 4.984158 0.119979355
2 TVV identity 7.730699900 0.2340548162 3.027602 7.271952460
3 TVKA identity 0.725207009 0.1245295550 17.171587 0.481129081
4 MEC identity 0.500000000 0.0000000000 0.000000 0.500000000
5 EMAX identity 80.000000000 0.0000000000 0.000000 80.000000000
6 EC50 identity 3.000000000 0.0000000000 0.000000 3.000000000
7 ETA_CL variance 0.028594955 0.0127980762 44.756414 0.003510725
8 ETA_V variance 0.009576924 0.0042973116 44.871522 0.001154193
9 ETA_KA variance 0.348964241 0.1608188257 46.084615 0.033759343
10 PROP_ERR proportional 0.010748528 0.0009417291 8.761470 0.008902739
upper_95 estimate_natural lower_95_natural upper_95_natural init_as_sd
1 0.14595871 NA NA NA FALSE
2 8.18944734 NA NA NA FALSE
3 0.96928494 NA NA NA FALSE
4 0.50000000 NA NA NA FALSE
5 80.00000000 NA NA NA FALSE
6 3.00000000 NA NA NA FALSE
7 0.05367918 NA NA NA FALSE
8 0.01799965 NA NA NA FALSE
9 0.66416914 NA NA NA FALSE
10 0.01259432 NA NA NA TRUE
EFF varies per time point (it depends on IPRED). CMAX_INTERVAL, TAM_TAU, and TAM_D1 are aggregate quantities — constant per 24-h window or per subject.
Why step= for time-above-threshold
TAM_TAU uses step=0.1 to force grid evaluation at 0.1-hour intervals. Without step=, only observation time points are evaluated. If the observation design is sparse (large gaps between samples), the trapezoidal rule can miss brief periods above threshold between those times. The step= argument fills in the gaps:
# Without step= (observation-time only -- can miss threshold crossings):
TAM_approx = integral(1.0, IPRED > MEC, window=24, anchor=0)
# With step=0.1 (fine grid -- catches brief excursions):
TAM_TAU = integral(1.0, IPRED > MEC, window=24, anchor=0, step=0.1)