Stepwise covariate modeling with nlmixr2scm

Watch on YouTube nlmixr2scm is on CRAN! Happily, nlmixr2scm, which does stepwise covariate modeling (SCM) for nlmixr2 models, is now on CRAN. It took a while - seems they’re very busy now that everyone is churning out packages with AI - but it’s finally there. install.packages("nlmixr2scm") If you’ve built covariate models in NONMEM, you’ve probably used scm in Perl-speaks-NONMEM. nlmixr2scm follows the same approach (Jonsson & Karlsson, 1998), and it works directly on an nlmixr2 fit.

Pharmacometrics in R on the Posit blog

Watch on YouTube Janice Goh and I wrote a post for the Posit blog: Tiny Doses for Tiny Babies – How much is too much? It is a hands-on introduction to pharmacometrics for R users who have never built a pharmacokinetic model. Posit also published a narrated video walkthrough of the post (above). The question A preterm infant weighing 900 g is having seizures. A doctor has read that one flat dose of phenobarbital might work for every neonate, which would save dose calculations at the bedside.

By Matthew Fidler in nlmixr2

October 16, 2026

nlmixr2save: fits you can read, runs you don’t repeat

Watch on YouTube If you are at ACoP 2026 (October 11-14, National Harbor, Maryland), come find the nlmixr2save poster. This post covers the same material, with code you can run. nlmixr2save is on CRAN and version 0.2.0 is out now: install.packages("nlmixr2save") Two problems Problem 1: Fits you can’t open later. Nonlinear mixed-effects models can take minutes to weeks to fit. Once one is done, you want to keep it. The usual way is saveRDS(), but that ties the result to R’s binary format and to how nlmixr2 stored the fit internally.

By Matthew Fidler in nlmixr2

October 11, 2026

Model diagrams and equations, straight from the code

Watch on YouTube Many pharmacometric reports have the same two items near the top of the methods section: a compartment diagram of the final model and the equations that define it. They are also two of the easiest things to get wrong. The diagram is usually drawn by hand in PowerPoint or Visio early in the analysis. The equations are typed into Word or LaTeX from the control stream. Then the model changes – a transit compartment is added, the effect goes from stimulation to inhibition, a covariate moves – and the code is updated but the figure and the math are not.

Adaptive dosing in rxode2

Watch on YouTube In the past, every rxode2 simulation started the same way: you coded down the doses first, and then you solved. The event table is fixed before the solver takes its first step. That is fine for a fixed schedule. It is not fine clinical adaptive dosing. Real protocols have clinical endpoints decide: hold this cycle, cut the dose one level, start the rescue infusion, draw an extra sample.

By Matthew Fidler in rxode2

September 9, 2026