3.3 Explore: eda and nca
With the data passed, look at them. Two commands do this without a model. eda draws the standard plots and tables of a
PK/PD dataset; nca computes the non-compartmental parameters of every profile. Neither fits anything, and both are
quick: about 3 seconds each on the demo project.
3.3.1 eda: the standard plots and tables
nlmx eda data/analysis.csv --covariates WT,SEX,EGFR,CRCL --conc-unit mg/L --dose-unit mg --time-unit h -o out_eda
The options after the dataset do three jobs. --covariates names the covariates to describe (a plain list, since version
4.2.1). --conc-unit, --dose-unit and --time-unit are labels for the axes and tables; they convert nothing. The
dataset has no BLQ column and a single dose level, so several standard plots will not apply, and eda says which and why:
0.01s ok 200 individuals, 2200 records (2000 observations, 200 doses)
0.08s ok 19 plots, 8 tables (12 left out)
2.74s ok 41 output file(s) written
…
200 individuals · 2200 records · 2000 observations (2000 PK) · 200 doses · 0 BLQ
Covariates: continuous WT, EGFR, CRCL · categorical SEX
Plots (19):
P01 P01_conc_time_log Concentration over time (log scale)
P03 P03_individual Individual profiles (log scale) (10 pages)
P04 P04_mean_conc_time Mean concentration over time
P08 P08_sampling_times Sampling times
P12 P12_cov_hist Continuous covariates (baseline)
P15 P15_cov_pairs Pairs of continuous covariates
P16 P16_cov_corr Correlation of the continuous covariates
…
Left out:
P06 dose_normalised a single dose level
P11 blq_over_time no observation below the LLOQ (give --lloq or --blq-flag)
P13 cov_by_group no --group or --stratify column
P18 exposure_vs_cov exposure plots and tables are off by default (--eda-exposure)
…
The program has 24 standard plots and 10 standard tables. It draws those the data can support (19 plots and 8 tables
here) and lists the rest with a reason, so a missing plot is never a mystery. The reasons are also instructions: giving
--lloq, a --blq-flag column, --group or --stratify adds the plots that wait for them, and --eda-exposure turns on
the observed-exposure plots, which are off by default.
What to look at first. Open out_eda/report.html (a collapsible report with every plot and table), and go through
four questions.
| Question | Where to look | What the demo data show |
|---|---|---|
| Do the profiles look like the model I plan? | P01 (all profiles), P03 (individuals, ten pages) |
a rise to a peak after about 2 to 4 h, a decline, and a higher level after the fifth dose (Figure 3.1.1) |
| Is the sampling what the protocol said? | P08 (sampling times), P09 (observations per individual) |
seven times after the first dose and three after the fifth; ten observations for every individual |
| Is the dosing as I think? | P10 (dosing), table T04 |
one dose level, 100 mg, five doses |
| What do the covariates look like, and are they related? | P12, P14, P15, P16; tables T02, T03, T08 |
WT median 71.6 kg (range 31.5–141.4), EGFR median 96.2, SEX about half and half, and EGFR and CRCL correlated at 0.985, but WT unrelated to both (−0.013 and −0.010) |
The last row is the one to carry forward. The table eda_T08_cov_correlation.csv is the matrix behind the COV08 warning of
Section 3.2:
,WT,EGFR,CRCL
WT,1.000,-0.013,-0.010
EGFR,-0.013,1.000,0.985
CRCL,-0.010,0.985,1.000
Two more tables are worth opening now. eda_T05_obs_by_time.csv gives the number and the statistics of the concentration at
each sampling time (for the first time, 0.5 h: n = 200, mean 1.008 mg/L, CV 36.6 %); and eda_T09_missing.csv
says that no column has a missing value. Chapter 13 describes all 24 plots and 10 tables, and how to add your own with
[[plot]] and [[table]] blocks in a .eda settings file.
3.3.2 nca: the non-compartmental analysis
A non-compartmental analysis (NCA) describes each concentration-time profile with model-free parameters: the peak and its time, the area under the curve (AUC), the terminal slope, the half-life, the clearance. It needs no structural model, so it is the first quantitative look at the data and a source of starting values.
The units of an NCA decide the units of clearance and volume, so they belong in a settings file. Ask for the template, set the concentration unit, and run:
nlmx nca --print-config nlmx.nca # writes the annotated settings template
sed -i 's/^conc = "ng\/mL"/conc = "mg\/L"/' nlmx.nca # GNU sed; on macOS use sed -i '' ... or edit [units] by hand
nlmx nca data/analysis.csv -c nlmx.nca -o out_nca
The settings file is TOML with a section per topic ([units], [auc], [lambda_z], [summary], …). The [units] names
are labels for the tables; they convert nothing, and a factor dose_factor is what makes clearance come out in L/h
when the dose and concentration units differ (Chapter 15). Here dose is in mg and concentration in mg/L, so no factor is
needed.
0.01s ok 200 subjects, 2000 observations (1 below LLOQ), 200 dose records
0.01s info administration route: oral (extravascular) — 1000 dose(s) go into another compartment than the observations (CMT 2): extravascular
0.01s ok 400 profile(s) analysed of 1000, 49 summary row(s)
2.12s ok 41 output file(s) written
nlmx nca — data/analysis.csv
data 200 subjects (200 in the file), 2000 observations, 1 below LLOQ, 200 dose records
route oral (extravascular) — 1000 dose(s) go into another compartment than the observations (CMT 2): extravascular
profiles 400 analysed of 1000 dosing intervals; terminal slope found in 176
rules AUC linear-up-log-down · BLQ tmax-zero-missing · λz best-fit (adjusted R² ≥ 0.7, ≥ 3 points) · τ/steady state auto
units dose mg · time h · concentration mg/L
Read the header as the rules of the analysis, because they determine every number below it:
- The route was detected as oral from the compartments (doses in CMT 1, observations in CMT 2), so clearance and
volume are apparent (
CL/F,Vz/F). - 1000 dosing intervals, 400 analysed. The dataset has five doses per subject and so five intervals (200 × 5 = 1000).
Samples exist after the first dose (seven) and the fifth (three), so those two intervals are analysed (200 × 2 = 400);
the other three have no samples and are skipped, with the reason "0 usable sample(s) (at least 3 are needed)" in the SKIPPED
column of
nca_parameters.csv. - Terminal slope found in 176 of the 200 first-dose profiles. The profiles end at 23.9 h, within about 2.8 half-lives,
and for 24 subjects the terminal phase was not reached with an adjusted R² of at least 0.7 on at least three points;
they get the flag
NO_LZ, and so no area to infinity, clearance or volume. - The area rule is linear-up/log-down trapezoid, the usual choice; others are options.
The summary for the first dose:
Summary — occasion 1 (200 profiles)
parameter n mean SD CV% geomean median min max
CMAX (mg/L) 200 2.114 0.7462 35.3 1.996 1.994 0.7711 5.011
TMAX (h) 200 2.98 1.425 47.8 2.685 2 1 8
AUCLAST (mg/L*h) 200 25.493 9.174 36.0 23.958 23.954 7.445 59.568
LAMZ (1/h) 176 0.0871 0.0383 44.0 0.0795 0.0813 0.0226 0.2526
THALF (h) 176 9.561 4.394 46.0 8.713 8.527 2.744 30.71
AUCINF_OBS (mg/L*h) 176 31.058 13.167 42.4 28.557 28.437 8.642 80.475
CL_F_OBS (mg/(mg/L*h)) 176 3.812 1.652 43.3 3.502 3.517 1.243 11.571
VZ_F_OBS (mg/mg/L) 176 47.095 18.412 39.1 44.02 44.369 19.423 140.2
…
A reading, in model-free terms. The typical peak is about 2 mg/L at 2 to 3 hours, the half-life about 9 hours, and the apparent clearance about 3.5 L/h and the apparent volume about 44 L (geometric means). Compare these with the model parameters printed at generation, CL = 3.34 L/h and V = 43.7 L: the NCA recovers the order of magnitude of both without a model. It also shows its limits: for 24 of the 200 subjects the profile stops before the terminal phase, so these subjects have no clearance or volume; and the spread of the NCA clearance (CV 43 %) mixes the true between-subject variability with the noise of a slope fitted to three or four points, which a model separates (Section 3.4).
After the fifth dose, with samples at 0.5, 4 and 12 h only, nca reports what three points allow (the concentration
at the end, the area to the last sample, the peak) and not a terminal slope.

Figure 3.3.1 shows the profile in one picture. The two curves have the same shape. The curve after the fifth dose starts
higher (about 1.6 mg/L at 0.5 h, against 1.0 after the first dose): this is accumulation, drug left from earlier doses.
nca_summary.csv carries the quantity that measures it, the accumulation ratio (RACC_PRED, mean 1.23 in the first-dose
summary).
The files: nca_parameters.csv (one row per subject and dosing interval, with flags), nca_summary.csv (the summary by
occasion), nca_lambda_z.csv (the points used for each terminal slope, and why a slope was not found), nca_profiles.csv,
33 figures including individual pages, and report.html. Chapters 14 and 15 describe the method and the options.
3.3.3 What the exploration told you
Before any model, you know now that the profiles are one-compartment-like with a peak at 2 to 4 h and a half-life of about 9 hours; that the sampling is sparse in the middle of the dosing period; that EGFR and CRCL are almost the same variable; and that one subject has an extreme renal function. Each of these will matter in the next sections: the sampling decides how much the data can say about absorption, and the correlation decides what the covariate analysis can say about renal function.