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 fixed se rse_pct
TVCL TVCL identity 0.132974266 FALSE 0.006627764 4.984245
TVV TVV identity 7.730567619 FALSE 0.234046431 3.027545
TVKA TVKA identity 0.725258574 FALSE 0.124477058 17.163128
MEC MEC identity 0.500000000 TRUE NA NA
EMAX EMAX identity 80.000000000 TRUE NA NA
EC50 EC50 identity 3.000000000 TRUE NA NA
ETA_CL ETA_CL variance 0.028597228 FALSE 0.012799151 44.756613
ETA_V ETA_V variance 0.009578216 FALSE 0.004297905 44.871665
ETA_KA ETA_KA variance 0.348919533 FALSE 0.160784992 46.080823
PROP_ERR PROP_ERR proportional 0.010748072 FALSE 0.000941583 8.760483
lower_95 upper_95 estimate_natural lower_95_natural
TVCL 0.119983849 0.14596468 NA NA
TVV 7.271836614 8.18929862 NA NA
TVKA 0.481283541 0.96923361 NA NA
MEC NA NA NA NA
EMAX NA NA NA NA
EC50 NA NA NA NA
ETA_CL 0.003510892 0.05368356 NA NA
ETA_V 0.001154322 0.01800211 NA NA
ETA_KA 0.033780947 0.66405812 NA NA
PROP_ERR 0.008902569 0.01259357 NA NA
upper_95_natural init_as_sd weight scale level class
TVCL NA FALSE <NA> <NA> <NA> NA
TVV NA FALSE <NA> <NA> <NA> NA
TVKA NA FALSE <NA> <NA> <NA> NA
MEC NA FALSE <NA> <NA> <NA> NA
EMAX NA FALSE <NA> <NA> <NA> NA
EC50 NA FALSE <NA> <NA> <NA> NA
ETA_CL NA FALSE <NA> log_normal <NA> NA
ETA_V NA FALSE <NA> log_normal <NA> NA
ETA_KA NA FALSE <NA> log_normal <NA> NA
PROP_ERR NA TRUE <NA> <NA> <NA> NA
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)