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:
ferx_estimates(fit)
param transform estimate se rse_pct lower_95
1 TVCL identity 0.132969570 0.0066284653 4.984949 0.119977778
2 TVV identity 7.730695262 0.2340617937 3.027694 7.271934147
3 TVKA identity 0.725187222 0.1253027264 17.278673 0.479593879
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.028585310 0.0127900421 44.743410 0.003516827
8 ETA_V variance 0.009575317 0.0042943833 44.848474 0.001158325
9 ETA_KA variance 0.348959133 0.1609684369 46.128163 0.033460997
10 PROP_ERR proportional 0.010748634 0.0009421476 8.765277 0.008902025
upper_95 estimate_natural lower_95_natural upper_95_natural init_as_sd
1 0.14596136 NA NA NA FALSE
2 8.18945638 NA NA NA FALSE
3 0.97078057 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.05365379 NA NA NA FALSE
8 0.01799231 NA NA NA FALSE
9 0.66445727 NA NA NA FALSE
10 0.01259524 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)