# nlmx report (posterior engine) — run22 covariate analysis

Command: `nlmx cov --model-dir C:\Users\askph\Desktop\PROJECTS\RUST\CovariateAnalysis\nlmx-book\documents\ch22\results\base_fit --run-stem run22 --covariates 'CL=WT,EGFR,SEX;V=WT,SEX' --method posterior --seed 24048 --output C:\Users\askph\Desktop\PROJECTS\RUST\CovariateAnalysis\nlmx-book\documents\ch24\results\primary --replicates 60 --draws-per-resample 2 --write-subject-level --write-replicate-selections`

Engine: `nlmx 4.8.0`

## Identity, model and data

```
Analysis           : run22 covariate analysis
Method             : posterior
Configuration      : C:\Users\askph\Desktop\PROJECTS\RUST\CovariateAnalysis\nlmx\nlmx.covar
Run stem           : run22 (input mode: directory)
Control stream     : C:\Users\askph\Desktop\PROJECTS\RUST\CovariateAnalysis\nlmx-book\documents\ch22\results\base_fit\run22.ctl
Problem            : Chapter 22 covariate-method example
Subroutine         : ADVAN2 TRANS2
Dataset            : C:\Users\askph\Desktop\PROJECTS\RUST\CovariateAnalysis\nlmx-book\documents\ch22\results\base_fit\../../input/analysis.csv (540 rows used, 0 filtered, 480 observations, 60 subjects)
Model (detected)   : ADVAN2 TRANS2: one compartment with first-order absorption; 4 THETA, 2 ETA, 1 EPS
Estimation         : $ESTIMATION METHOD=1 -> nlmx evaluates foce_i
Residual error     : from $ERROR/$PRED: EPS[1] with non-zero SIGMA
OFV in .ext        : -1082.5610
Random effects     : ETA[1, 2]
Frozen parameters  : 6 (THETA(1), THETA(2), THETA(3), THETA(4), OMEGA(1,1), OMEGA(2,2))
ETA estimates      : from .phi
Posterior engine   : source prefer_phi, response posterior_draws, complementary_pairs x 60 replicate(s), 2 draw(s)/resample, learners adaptive_elastic_net+group_elastic_net+weighted_gls (primary adaptive_elastic_net)

Detected parameters (from the control stream):
  CL       ETA 1    exponential   THETA [1]          typical 4.12873      basic PK parameter
  V        ETA 2    exponential   THETA [2]          typical 44.26899     basic PK parameter
  KA       ETA -    none          THETA [3]          typical 1.18714      basic PK parameter

Diagnostics:
  - covariate `WT`: continuous (detected; 60 distinct values, 45.02 to 104.6) — equations: power
  - covariate `EGFR`: continuous (detected; 60 distinct values, 56.34 to 142.1) — equations: power
  - covariate `SEX`: binary (detected; levels 0, 1; reference 0) — equations: proportional
  - likelihood approximation: foce_i (from $ESTIMATION METHOD=1)
  - base-parameter covariance: 6 parameter(s), condition number 6.038e4
  - maximum |cor(.cov) - .cor| discrepancy = 2.183e-7
  - .phi parsed: 60 subject(s), ETA[1, 2], ETC columns present
  - ETA-estimate coverage: 60 of 60 dataset subjects matched, 0 record(s) unmatched

Candidate scope:
  CL~WT:power                      status=test           columns=1 reference=72.2047
  CL~EGFR:power                    status=test           columns=1 reference=93.6222
  CL~SEX:proportional              status=test           columns=1 reference=0.0000
  V~WT:power                       status=test           columns=1 reference=72.2047
  V~SEX:proportional               status=test           columns=1 reference=0.0000
```

## Posterior reconstruction

- Sources: phi mean + phi ETC: 60, phi mode + reconstructed curvature: 0, fully reconstructed: 0, point EBE only: 0
- Subjects with a usable posterior: 60 (of 60 in the dataset)
- Subjects with weak individual information: 0
- Failed or unreliable subjects under policy `error`: 0

| ETA | Var(m) | mean(V) | OMEGA | moment rel. error | eta-shrinkage |
|---|---:|---:|---:|---:|---:|
| ETA1 | 6.68372e-2 | 4.26932e-3 | 7.08683e-2 | 0.3% | 2.9% |
| ETA2 | 6.53344e-2 | 4.02066e-3 | 6.90122e-2 | 0.5% | 2.7% |

The identity OMEGA ≈ Var(m) + mean(V) holds approximately when the posterior approximation, OMEGA and the residual model agree. A large error should be understood before the selection results are trusted.

## Variance consistency

Method: **penalized_matching** (tolerance 25%)

| ETA | explained | residual | mean posterior var | OMEGA | rel. error |
|---|---:|---:|---:|---:|---:|
| ETA1 | 1.71984e-2 | 4.96388e-2 | 4.26932e-3 | 7.08683e-2 | 0.3% |
| ETA2 | 3.25157e-2 | 3.28186e-2 | 4.02066e-3 | 6.90122e-2 | 0.5% |

## Stability selection

- Scheduled fits: 720, completed: 720, failed: 0
- Average selected set size (primary learner): 2.54
- PFER bound at threshold 0.80: **1.084**; the target 1.00 needs threshold 0.817
- Retention threshold used: **0.800** (pfer)
- The PFER bound assumes exchangeability and a half-sample fraction; with grouped, weighted or dependent features it is approximate.

| relationship | sel. prob | 95% CI | sign | form | agreement | coef (median) | IIV explained | class |
|---|---:|---|---:|---:|---:|---:|---:|---|
| `V~WT:power` | 0.950 | 0.90–0.98 | 1.00 | 1.00 | 1.00 | 0.9564 | 47.1% | **retained** |
| `CL~WT:power` | 0.833 | 0.76–0.89 | 1.00 | 1.00 | 1.00 | 0.7069 | 24.3% | **retained** |
| `CL~EGFR:power` | 0.717 | 0.63–0.79 | 1.00 | 1.00 | 0.67 | 0.5834 | 17.9% | **uncertain** |
| `V~SEX:proportional` | 0.025 | 0.01–0.07 | 1.00 | 1.00 | 0.00 | -0.1766 | 0.0% | **rejected** |
| `CL~SEX:proportional` | 0.017 | 0.00–0.06 | 1.00 | 1.00 | 0.00 | -0.1536 | 0.0% | **rejected** |

### Per-learner selection probabilities

| relationship | adaptive_elastic_net | group_elastic_net | weighted_gls |
|---|---:|---:|---:|
| `V~WT:power` | 0.950 | 1.000 | 1.000 |
| `CL~WT:power` | 0.833 | 0.983 | 0.917 |
| `CL~EGFR:power` | 0.717 | 1.000 | 0.900 |
| `V~SEX:proportional` | 0.025 | 0.350 | 0.075 |
| `CL~SEX:proportional` | 0.017 | 0.283 | 0.008 |

## Final covariate model

joint refit: OFV -1141.867, 59.31 below the base model's -1082.561.

```
CL = TVCL × (WT/72.2)^0.7506
V = TVV × (WT/72.2)^1.009
```

| parameter ~ covariate | equation | decision | reason |
|---|---|---|---|
| CL~WT | power | retained | selection probability 0.83 >= 0.80 (95% CI 0.76-0.89); sign stability 1.00, algorithm agreement 1.00 |
| CL~EGFR | power | uncertain | selection probability 0.72 lies in the uncertainty band [0.55, 0.80) |
| CL~SEX | proportional | rejected | selection probability 0.02 < 0.55 |
| V~WT | power | retained | selection probability 0.95 >= 0.80 (95% CI 0.90-0.98); sign stability 1.00, algorithm agreement 1.00 |
| V~SEX | proportional | rejected | selection probability 0.03 < 0.55 |

## Equations tried

| pair | type | form | equation | sel. prob | share | pair prob | median estimate | chosen |
|---|---|---|---|---:|---:|---:|---|---|
| CL~WT | continuous | power | `(WT/72.2)^θ` | 0.833 | 100% | 0.833 | `(WT/72.2)^0.7069` | ✓ |
| CL~EGFR | continuous | power | `(EGFR/93.62)^θ` | 0.717 | 100% | 0.717 | `(EGFR/93.62)^0.5834` | ✓ |
| CL~SEX | binary | proportional | `(1 + θ if SEX = 1)` | 0.017 | 100% | 0.017 | `(1 − 0.1424 if SEX = 1)` | ✓ |
| V~WT | continuous | power | `(WT/72.2)^θ` | 0.950 | 100% | 0.950 | `(WT/72.2)^0.9564` | ✓ |
| V~SEX | binary | proportional | `(1 + θ if SEX = 1)` | 0.025 | 100% | 0.025 | `(1 − 0.1619 if SEX = 1)` | ✓ |

## Decisions

### retained (2)

- `CL~WT:power` — selection probability 0.83 >= 0.80 (95% CI 0.76-0.89); sign stability 1.00, algorithm agreement 1.00
  - draft: `TVCL = TVCL * (WT/72.2047)**0.7506   ; UNCONFIRMED nlmx draft`
- `V~WT:power` — selection probability 0.95 >= 0.80 (95% CI 0.90-0.98); sign stability 1.00, algorithm agreement 1.00
  - draft: `TVV = TVV * (WT/72.2047)**1.0087   ; UNCONFIRMED nlmx draft`

### uncertain (1)

- `CL~EGFR:power` — selection probability 0.72 lies in the uncertainty band [0.55, 0.80)

### rejected (2)

- `CL~SEX:proportional` — selection probability 0.02 < 0.55
- `V~SEX:proportional` — selection probability 0.03 < 0.55

## Limitations and required confirmation

- This is an **accelerated posterior-stability recommendation**, not a re-estimated NLME model. No NONMEM fit was performed.
- Selection frequency is not a posterior probability, and learner importance is never converted into a p-value.
- Reported coefficients are two-stage estimates from an unpenalised refit of the selected set, not refitted NLME parameters.
- The PFER bound relies on assumptions that grouped, weighted or dependent features can violate; treat it as approximate.
- Correlated covariates that substitute for one another are reported as a cluster; the engine refuses to name a unique winner.
- Every retained relationship must be confirmed by an explicit NONMEM fit before it is used for inference or regulatory submission.
