Documentation

41.31 Case 7: four generated projects, a known truth and a design to review

Four generated projects

What you will learn

  • Generate a complete project (data, models, settings, a README that states the truth) from one settings file.
  • Choose between generating a design, generating without fitting, and building a project from your own data.
  • Use the known truth to check an estimate in standard-error units.
  • Read the generated project as a design review: what the sampling can and cannot identify.

Prerequisites: Chapter 29, generating designs and projects and 41.30.

The question: before a study is run, how can its design be tried on data whose truth is known? And when a study already exists, how can a project be built from its data in one step?

The evidence: four Chapter 29 project folders, each written by nlmx generate: custom_design, ode_infusion_nofit, own_dataset_project and preset_analytic.

What generate writes

A project folder is the starting point of the covariate and evaluation commands of Cases 5 and 6, produced from one settings file (nlmx.gen). It holds:

Part What it is
data/analysis.csv the simulated data set (or your data set, cleaned to upper-case column names)
truth.ctl the model the data were simulated from, with its covariate effects
models/run101 the base model; fitted, unless fit = false
models/run102 the model with the true covariate effects, estimated
nlmx.covar, nlmx.vpc, nlmx.forest ready settings for the commands of Cases 5 and 6
README.md the design, the truth, and the fitted OFVs in words

The README is the cheapest review document in the book: it says, in plain sentences, what was simulated, how many subjects and doses, what the true effects are, and what the fits found.

Project 1: a three-arm design with a covariate model (custom_design)

The settings describe a two-compartment oral drug (typical clearance 4.5 L/h, central volume 35 L, intercompartmental clearance 5 L/h, peripheral volume 80 L, absorption 1.2 h⁻¹); between-subject variability of 30 % on clearance, 25 % on volume and 40 % on absorption; a residual error of 15 % proportional plus 0.02 mg/L additive. Three arms of 15 subjects receive 50, 100 or 200 mg, four doses 24 h apart; samples are taken at 0.5, 1, 2, 4, 8 and 12 h after the first dose and at 0.5, 1, 2, 4, 8, 12 and 24 h after the fourth (72.5–96 h). The truth includes four covariate effects:

Relationship True value Form
CL ~ eGFR 0.6 power on eGFR/95
CL ~ sex 0.8 proportional factor, a fractional change of −0.2 for SEX = 1
CL ~ weight 0.75 power on WT/70
V₂ ~ weight 1.0 power on WT/70

and a near-copy of eGFR (CRCL, with noise) as a nuisance covariate. The data have 45 subjects, 45 dose records and 585 observations, none below a limit.

Fitting the truth back

The README reports the base model (no covariates) at OFV −1180.331 and the model with the four true effects at −1231.133. The drop is 50.80 for four added parameters, far above the 9.49 that a chi-square with four degrees of freedom puts at the 5 % level. The estimates, with their standard errors, against the truth:

Effect Truth Estimate SE (Estimate − truth) / SE
CL ~ eGFR (power) 0.6 0.5749 0.1313 −0.19
CL ~ sex (fractional change) −0.2 −0.2888 0.0691 −1.28
CL ~ weight (power) 0.75 0.9441 0.1950 +1.00
V₂ ~ weight (power) 1.0 0.9471 0.1969 −0.27

All four estimates are within 1.3 standard errors of the truth: this design recovers the truth, but with intervals so wide (the eGFR and weight exponents have a standard error near 0.2) that exponents of 0.4 and 0.8 on weight could not be told apart. A known truth lets an estimate be judged in standard-error units, not only by whether it "looks reasonable". The standard errors are the other result: they are the design's answer to the question "how well would 45 subjects estimate this effect?", and page 41.33 asks that question formally.

Project 2: an ODE model, generated and not fitted (ode_infusion_nofit)

The second project is a three-compartment intravenous infusion model written as differential equations ($DES, solved with the general ADVAN13 routine at tolerance 10⁻⁶): clearance 3.2 L/h, volume 42 L, two peripheral compartments (5 L/h with 80 L, and 1.5 L/h with 120 L), a two-hour infusion, between-subject variability on clearance and volume only, and no covariate effects. Two arms of 8 subjects (100 and 300 mg) give 16 subjects and 112 observations at 0.5–24 h.

The setting that matters is fit = false (--no-fit). A three-compartment ODE model is the most expensive fit in the book; generating the project without fitting lets the analyst review the design first: the data file, the control stream (which starts from the true values) and the README. The README ends with the command that fits it later (nlmx fit models/run101.ctl). A design that is wrong should be found at this step, not after an hour of estimation.

Whether 112 observations from 16 subjects can estimate six structural parameters of a three-compartment model is a fair question, and the right answer is not in this bundle. It is the sort of question the power commands of the next pages exist for, and a reason why the project is shipped unfitted.

Project 3: your own data set (own_dataset_project)

With --data, nothing is simulated. The command reads an existing file (here the data of Case 5), upper-cases the column names, writes the control stream, and fits the base model. The README lists what it did to the file: 60 empty cells were written as . (NONMEM's missing-value convention); the original is untouched. It then reports the starting values, taken from each subject's first-dose AUC and terminal slope (60 of 60 subjects, median dose 100 mg, median Cmax 1.94), the fitted base model, and a second model with a weight effect on clearance and volume:

Run Model OFV Estimates
run101 base −1082.561 CL 4.13, V 44.3, KA 1.19
run102 base + weight effects −1141.867 CLWT 0.7505, VWT 1.0087

The first row is the base OFV of Case 5 (−1082.5614), so this project is that analysis rebuilt in one command from the same file. The ΔOFV of 59.31 for two parameters is the weight effect found in Case 5 before eGFR was added, and the exponents (0.7505 and 1.0087) are those the full model gives (0.7268 and 1.010) within their standard errors (0.159 and 0.130). The settings asked for a combined error; the additive term was estimated at 1 × 10⁻⁵ with a standard error of 1 × 10⁻³, which is zero: the data support a purely proportional error, and the generated model can be simplified.

Project 4: the shared example (preset_analytic)

The fourth project is the one the power chapters use: 200 simulated subjects, one-compartment oral, 10 observations each (2 000 in all), with an allometric weight effect on clearance (0.75) and volume (1.0), a renal effect (eGFR on clearance, 0.6), a near-perfect proxy for eGFR (CRCL, correlation about 0.99) and a null covariate (sex). Its base model is fitted (OFV −2880.213) and its README lists the commands that run the covariate analysis three ways (--method frozen, posterior, both) and the VPC. Built with a proxy and a null on purpose, it is a trap for covariate selection: the proxy competes with the real covariate, and the null is there to be falsely selected. The next page's study uses exactly this structure.

The decision

Question Evidence Decision Reversible?
Does the custom design recover its truth? four effects within 1.3 SE; ΔOFV 50.80 yes, with wide intervals yes
Is the three-compartment project ready to fit? generated unfitted; data and stream reviewed review the design first yes
Can an existing study become a project in one step? base OFV −1082.561 reproduced yes yes
Which project does the power analysis use? preset_analytic, 200 subjects the shared example yes

What this case does not show

A generated data set follows the generator's assumptions: normal-like covariates, a log-normal between-subject distribution, a stated error model. It is excellent for testing software and design and tells you nothing about how real data depart from them. A project built from your own data has the cleaned file and a first model, and not a qualified model: the model checks of Cases 4 to 6 still have to be run.

Review checklist

  • Does the README say what was simulated, with the truth, in numbers?
  • Do you express each estimate's distance from the truth in standard errors?
  • For an expensive model, have you reviewed the design before fitting?
  • Do you record what was done to your own file (here, 60 cells written as .)?

See the previous page, the next page and the complete case-study reference.