Terminal phase and partial areas. Before this version the package had no lambda z, no half-life, no AUCINF and no partial AUC, and — worse — said so nowhere, so the only way to find out was to notice they were missing from the metric list.

  • Terminal phase: derive_terminal_phase() estimates the terminal elimination rate constant LAMZ by log-linear regression over the best-fit window (every window of at least min_points = 3 points strictly after TMAX; the longest whose adjusted R-squared is within tol = 1e-4 of the best), and derives LAMZHL = log(2) / LAMZ, AUCIFO (observed variant, from CLST) and AUCIFP (predicted variant, from the fitted CLSTP) — both are returned, neither is called the answer.
  • Fit diagnostics travel with the estimate, never separately: LAMZNPT, LAMZLL, LAMZUL, R2 and R2ADJ, so a reviewer can judge the fit.
  • Extrapolated fraction: AUCPEO and AUCPEP, with AUCPEFL = "Y" when AUCPEO exceeds max_pct_extrap (default 20, the conventional acceptance threshold).
  • No silently bad numbers: a profile that does not meet the criteria — fewer than min_points quantifiable points after TMAX, a non-negative fitted slope, or no quantifiable concentration at all — returns NA for LAMZ and everything derived from it, with the reason in words in LAMZNRS.
  • Partial AUC: derive_partial_auc(pc, start, end) for AUC[0, 24], AUC over a dosing interval, or any other window. The window-edge rule is documented rather than assumed: linear interpolation under method = "linear", logarithmic interpolation on a descending segment under "lin_up_log_down", and INTRPFL reports whether an edge was interpolated at all. Over the full observed window AUCINT is identical to AUCLST.
  • eradam_structure() now documents six datasets, adding "terminal" and "partial"; the same tables render into the new help pages.
  • README gains a Scope and limits section, and the “Conventions followed, and conventions chosen” section now covers every new parameter.

Limits, stated rather than left to be discovered

  • No steady-state parameters: AUCTAU, CAVG, CLSS, accumulation ratio, fluctuation. A partial AUC over the dosing interval gives the AUCTAU number under the name AUCINT and nothing else.
  • No clearance, volume or moment parameters: CL, CLF, VZ, VZF, MRT, AUMC, VSS.
  • No manual override of the LAMZ window — best-fit or nothing.
  • No sparse-sampling / Bailer-type variance estimation.
  • derive_partial_auc() refuses a window outside the observed range: it never back-extrapolates to time zero and never forward-extrapolates with LAMZ. It returns NA and the reason in AUCINTRS.
  • derive_terminal_phase() treats a whole by group as one profile. On the shipped two-dose fixture, 10 of 24 subjects therefore have TMAX after the second dose with only two terminal points left, and return NA with the reason. Subset to one dosing interval for a multiple-dose study.
  • AUCLST from derive_terminal_phase() runs to the last positive concentration (the NCA convention); derive_exposure_metrics() runs its AUCLST over every non-missing record. They differ only on profiles with trailing zeros, e.g. after make_adpc(blq = "zero").
  • Not validated software. Open implementations of published rules, tested against analytic values.

Initial development version.

  • Exposure metrics: derive_exposure_metrics() computes CMAX, TMAX, CMIN, CTROUGH and AUCLST per subject and analyte, by the linear trapezoidal rule or the linear up / log down variant, with dose-normalised AUC when dosing data is supplied.
  • Concentration analysis dataset: make_adpc() builds one record per subject, analyte and timepoint with nominal and actual time, actual time since the most recent dose, and a BLQ policy ("half", "zero", "drop", "keep") chosen by argument, flagged in BLQFL and marked in DTYPE.
  • Population PK dataset: make_poppk() interleaves dosing and observation records in time order per subject and returns ID, TIME, TAD, AMT, DV, MDV, EVID, CMT, BLQ and the subject-level covariates.
  • Exposure-response dataset: make_ader() joins exposure metrics to a response endpoint and derives labelled exposure quantile groups.
  • Documented structure: eradam_structure() returns the variable, meaning and source of every column the package produces, and the same table is rendered into each function’s help page.
  • Example data: eradam_example() loads the self-contained 24-subject concentration, dosing, subject-level and response fixtures shipped in inst/extdata, so every example, test and vignette runs offline.
  • S3 classes eradam_exposure, eradam_adpc, eradam_poppk and eradam_ader, each with a print() method.