MyNixOS website logo
Description

Aggregate Data Modelling.

Fit pharmacokinetic/pharmacodynamic (PK/PD) models to aggregate-level data (mean vector and covariance matrix per study) rather than individual-level data. Integrates with the 'nlmixr2'/'rxode2' ecosystem via four estimation methods: a First-Order ('FO') analytical estimator, a Monte Carlo (MC) estimator, a Gauss-Hermite quadrature ('GH') estimator, and an Iterative Reweighting Monte Carlo ('IRMC') estimator. Methods are based on Välitalo (2021) <doi:10.1007/s10928-021-09760-1>; software described in van de Beek et al. (2025) <doi:10.1007/s10928-025-10011-w>.

admixr2

R-CMD-check CRAN version CRAN downloads License: GPL v3 Lifecycle: stable DOI Codecov

admixr2 fits pharmacometric PK/PD models directly to aggregate-level data — the observed mean vector E and covariance matrix V reported per clinical study — rather than requiring individual patient records. It integrates with the nlmixr2 / rxode2 ecosystem and provides four estimation backends:

Estimatorest =Control
First-Order"adfo"adfoControl()
Monte Carlo"admc"admControl()
Gauss-Hermite"adgh"adghControl()
Iterative Reweighting MC"adirmc"adirmcControl()

Model-Based Meta-Analysis

Model-Based Meta-Analysis (MBMA) is a pharmacometric framework for synthesising evidence across multiple clinical studies by fitting a shared mechanistic PK/PD model to the aggregate outcomes (means, variances) reported in each study. Unlike classical meta-analysis, which pools effect estimates, MBMA preserves the full pharmacometric model structure — including nonlinear dose-response, inter-individual variability, and residual error — enabling principled extrapolation and dose optimisation across the evidence base.

admixr2 fits a single population model jointly to all studies. Between-study differences in outcomes are accounted for through the population model structure: inter-individual variability captures subject-level spread within each study, and residual error absorbs remaining discrepancies. Each study contributes its own dosing regimen, observation times, and sample size, but shares the same structural and variance parameters.

When to use admixr2

Individual patient data are unavailable — the most common scenario in MBMA. Published papers report means and standard deviations; regulatory submissions and competitive reasons prevent individual patient data sharing across companies or institutions. admixr2 extracts the maximum information from what is publicly available.

Leveraging the literature for trial design — fit a mechanistic PK/PD model to aggregated results from existing trials, then simulate new dosing regimens or patient populations before committing to a costly study.

Combining evidence across heterogeneous trials — studies differ in dose, formulation, population, or observation schedule. admixr2 handles multi-study fits with per-study dosing events and time grids under a single shared population model.

Reproducing and extending published models — digitised mean concentration– time profiles from figures are sufficient input. No individual patient data required.

Installation

# From CRAN
install.packages("admixr2")

# Development version from GitHub
pak::pak("LeidenPharmacology/admixr2")

Quick start

library(admixr2)
library(rxode2)
library(nlmixr2)

# 1. Compute aggregate statistics from individual data (or digitise from paper)
data("examplomycin")
obs    <- examplomycin[examplomycin$EVID == 0, ]
obs    <- obs[order(obs$ID, obs$TIME), ]
times  <- sort(unique(obs$TIME))
ids    <- unique(obs$ID)
dv_mat <- matrix(NA_real_, nrow = length(ids), ncol = length(times))
for (i in seq_along(ids)) {
  sub         <- obs[obs$ID == ids[i], ]
  dv_mat[i, ] <- sub$DV[order(sub$TIME)]
}
E <- colMeans(dv_mat)
V <- cov.wt(dv_mat, method = "ML")$cov

# 2. Define the model (standard nlmixr2 syntax)
pk_model <- function() {
  ini({
    tcl     <- log(5);  label("Log clearance (L/hr)")
    tv1     <- log(10); label("Log central volume (L)")
    tv2     <- log(30); label("Log peripheral volume (L)")
    tq      <- log(10); label("Log inter-compartmental CL (L/hr)")
    tka     <- log(1);  label("Log absorption rate constant (1/hr)")
    prop.sd <- c(0, 0.2)
    eta.cl ~ 0.09; eta.v1 ~ 0.09; eta.v2 ~ 0.09
    eta.q  ~ 0.09; eta.ka ~ 0.09
  })
  model({
    cl <- exp(tcl + eta.cl); v1 <- exp(tv1 + eta.v1)
    v2 <- exp(tv2 + eta.v2); q  <- exp(tq  + eta.q)
    ka <- exp(tka + eta.ka)
    d/dt(depot)      <- -ka * depot
    d/dt(central)    <- ka * depot - (cl/v1 + q/v1) * central + (q/v2) * peripheral
    d/dt(peripheral) <- (q/v1) * central - (q/v2) * peripheral
    cp <- central / v1
    cp ~ prop(prop.sd)
  })
}

# 3. Fit
fit <- nlmixr2(
  pk_model, admData(), est = "admc",
  control = admControl(
    studies = list(examplomycin = list(
      E = E, V = V, n = length(ids),
      times = times, ev = et(amt = 100)
    )),
    n_sim = 5000L, seed = 1L
  )
)

print(fit)
plot(fit)

Vignettes

VignetteTopic
Getting startedCore workflow: data prep, model, fit, diagnostics
Diagnostic plotsAll four plot panels explained; IIV heatmap
Multiple studiesJoint fitting across studies with different designs
Estimator comparisonadfo, admc, adgh and adirmc: mathematical foundations and when to use each
Advanced usageGradient modes, parallel restarts, AIC/BIC model comparison

Citation

If you use admixr2 in your work, please cite the software paper, which introduces the Iterative Reweighting Monte Carlo estimator:

van de Beek H., Välitalo P.A.J., van Hasselt J.G.C., Zwep L.B. (2025). Aggregate data modelling: A fast implementation for fitting pharmacometrics models to summary-level data in R. Journal of Pharmacokinetics and Pharmacodynamics, 53(1), 3. https://doi.org/10.1007/s10928-025-10011-w

The aggregate data modelling methodology is introduced in:

Välitalo P.A.J. (2021). Pharmacometric estimation methods for aggregate data, including data simulated from other pharmacometric models. Journal of Pharmacokinetics and Pharmacodynamics, 48(5), 623–638. https://doi.org/10.1007/s10928-021-09760-1

Metadata

Version

0.2.0

License

Unknown

Platforms (79)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    wasip1
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasip1
  • wasm64-wasip1
  • x86_64-cygwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows