Computational Foundations for Pharmacometrics (R Track)

A practical, modeling-first course for PK/PD analysis and reproducible workflows

Welcome

Computational Foundations for Pharmacometrics (R Track) is a hands-on course for pharmacometricians, clinical pharmacologists, and quantitative scientists who want to use R effectively for PK/PD analysis, modeling support, and clear communication.

The focus isn’t just how to code — it’s how to think and work in R like a PMx scientist: start with structure, validate assumptions early, and make every step reproducible.


Get Access

Enroll — Computational Foundations R Track Try Free Previews First

Free introductory modules are available with a free AEAcademy Member account — no credit card required.


Who this course is for

  • Pharmacometrics scientists and analysts
  • Clinical pharmacology and translational scientists
  • Modelers supporting MIDD decisions
  • Scientists transitioning from NONMEM-centric workflows to R-enabled pipelines

Learning objectives

By the end of this course, you will be able to:

  • Use R confidently for PK/PD exploration, QC, and analysis
  • Build clean, reproducible PMx workflows (project structure → data → plots → models → report)
  • Create publication-ready visualizations and QC graphics
  • Support modeling workflows with robust R-based data preparation and diagnostics
  • Communicate decisions clearly using Quarto reports and structured QC logs

Course structure

The course is organized into five sections that build toward an end-to-end case study:

  1. R Basics → write clean, readable R code
  2. Data Wrangling → build model-ready datasets from raw clinical-style tables
  3. Data Visualization → diagnose structure and variability before modeling
  4. Modeling → fit and interpret core R models (lm(), nls(), lme(), nlme())
  5. Case Study → apply everything in a realistic workflow with a QC decision log

After the final case study lesson, you’ll reach a Course Completion page where you can confirm completion and generate your certificate.


Syllabus

1. R Basics

  • R and RStudio/Positron workflow essentials for PMx
  • Objects, vectors, lists, and data frames
  • Packages and the tidyverse mindset
  • Logical operations, indexing, functions
  • Pipes and readable “workflow-style” code

2. Data Wrangling

  • Reading/writing data and preserving raw sources
  • The “first 10 minutes” structural QC checklist
  • Core dplyr verbs (select/filter/mutate/summarise) in PMx patterns
  • Joining, binding, strings, and time handling
  • Reshaping with pivot_longer() / pivot_wider() (including long-form covariates)
  • Missingness and BLQ handling for modeling readiness
    • includes structural completion with tidyr::fill() (carry-forward within subject, not imputation)
  • Final QC and export of analysis-ready datasets

3. Data Visualization

  • Plot construction and layering with ggplot2 (reusable patterns)
  • Individual profiles for QC (spaghetti plots that actually diagnose issues)
  • Linear vs log scales in PK contexts
  • Stratification and covariate visualization
  • Summary overlays (central tendency + variability without hiding individuals)
  • Visualization-driven QC case study
  • Publication-ready figures + exporting/reuse

4. Modeling

  • Why we model: questions, assumptions, and decisions
  • A minimal modeling workflow in R
  • Linear models as first-pass PK/PD insight (lm())
  • Nonlinear regression for structural curves (nls())
  • Mixed-effects intuition and hierarchy
  • Mixed-effects in practice (lme()) and nonlinear mixed-effects (nlme())
  • Diagnostics, limitations, and how this transitions to advanced PMx frameworks

5. Case Study

  • Case setup + data overview with a structured QC decision log
  • Structural QC and minimal fixes
  • Dataset assembly (including long-form DM reshaping with pivot_wider())
  • Visualization-driven QC
  • Fixing realistic issues (e.g., unit mismatches like WT recorded in lb vs kg)
  • Final dataset lock + exploratory analysis
  • Naive pooled modeling (nls()) and population modeling (nlme())
  • Simulation and scenario exploration
  • Automated reporting with Quarto

Tools used

  • R (≥ 4.2 recommended)
  • RStudio or Positron
  • tidyverse (dplyr, tidyr, readr, ggplot2, stringr, lubridate)
  • nlme

How to Run the Code

This site is built with Quarto, so code chunks are executed during rendering to produce the outputs you see on the page.

To reproduce lessons locally:

  • work inside an R project
  • install the packages introduced in the relevant section or lesson
  • run the code in RStudio, Positron, or your preferred IDE
  • compare your results to the rendered outputs on the site
Note

Some lessons comment out write operations during teaching builds to avoid accidental file creation.


Outcomes

By completing this course, you will have:

  • A reusable PMx-ready R project workflow
  • A library of wrangling and plotting patterns you can reuse across studies
  • A practical understanding of core modeling tools in R (and their limitations)
  • An end-to-end case study with QC decisions documented clearly
  • Increased confidence using R in real drug development settings

Get started

Start with Section 1: R Basics and complete the workflow setup first — it will make everything downstream smoother.