# nlmx report (stepwise covariate modelling) — 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 scm --scm-direction both --scm-candidates-per-step 3 --seed 22048 --output C:\Users\askph\Desktop\PROJECTS\RUST\CovariateAnalysis\nlmx-book\documents\ch22\results\scm --no-color --suppress-console 1`

Engine: `nlmx 4.8.0`

## Result

Final covariate model (joint refit: OFV -1157.813, 75.25 below the base model's -1082.561):

```
CL = TVCL × (WT/72.2)^0.7268 × (EGFR/93.62)^0.5776
V = TVV × (WT/72.2)^1.01
```

| parameter ~ covariate | equation | decision | reason |
|---|---|---|---|
| CL~WT | power | **retained** | kept by the backward elimination: removing it raises the OFV by 21.942 (p 2.810e-6 < 0.01) |
| CL~EGFR | power | **retained** | kept by the backward elimination: removing it raises the OFV by 15.947 (p 6.516e-5 < 0.01) |
| CL~SEX | proportional | **rejected** | tested on refits: dOFV 0.111 (p 7.388e-1) was not below 0.05 at any forward step |
| V~WT | power | **retained** | kept by the backward elimination: removing it raises the OFV by 41.853 (p 9.840e-11 < 0.01) |
| V~SEX | proportional | **rejected** | tested on refits: dOFV 0.707 (p 4.003e-1) was not below 0.05 at any forward step |

## Equations tried

The stepwise search tests each relationship by a likelihood-ratio test on refits (all parameters re-estimated). ΔOFV is the OFV change when the term was added (forward) or removed (backward) the last time it was tested, against the model of that step, and p its chi-square p-value; the OFV column is left empty because it is not against the base model.

| pair | type | form | equation | OFV | ΔOFV | df | ΔAIC | estimate | chosen |
|---|---|---|---|---:|---:|---:|---:|---|:-:|
| CL~WT | continuous | power | `(WT/72.2)^θ` | – | 21.94 | 1 | – | `(WT/72.2)^0.7268` | ✓ |
| CL~EGFR | continuous | power | `(EGFR/93.62)^θ` | – | 15.95 | 1 | – | `(EGFR/93.62)^0.5776` | ✓ |
| CL~SEX | binary | proportional | `(1 + θ if SEX = 1)` | – | 0.11 | 1 | – | `(1 + 0.005121 if SEX = 1)` | ✓ |
| V~WT | continuous | power | `(WT/72.2)^θ` | – | 41.85 | 1 | – | `(WT/72.2)^1.01` | ✓ |
| V~SEX | binary | proportional | `(1 + θ if SEX = 1)` | – | 0.71 | 1 | – | `(1 + 0.00946 if SEX = 1)` | ✓ |

## Identity and inputs

```
Analysis           : run22 covariate analysis
Method             : scm
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
Frozen engine      : foce_i approximation, efficient information (opg estimator, nuisance: observed), selection refit_scm (both search, forward p < 0.05, backward p >= 0.01), multiplicity bh

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
  - information: opg estimator; nuisance block from nlmx's own likelihood

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

## Statistical configuration

- Approximation: **foce_i**
- Information: **efficient**, estimator **opg** (nuisance block from **observed**)
- Selection: **refit_scm** (stepwise, direction **both**)
- Multiplicity: **bh** (forward alpha 0.05, retention alpha 0.01)
- Uncertainty propagation: **enabled** (200 draws, seed 22048, linearized)

Base-solution stationarity: U_n' I_nn^-1 U_n = **0.000** on 6 df. Values near the degrees of freedom mean the NONMEM estimates are close to an optimum of nlmx's likelihood; much larger values point to an approximation mismatch or a parameter-map error. The efficient score is corrected for it either way.

## Candidate results

| candidate | S (univ) | df | p (univ) | p (adj) | S (cond) | p (cond) | step | beta | SE | pass prob. | class |
|---|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---|
| `V~WT:power` | 42.464 | 1 | 7.199e-11 | 3.599e-10 | – | – | 1 | 1.01002 | 0.21991 | 0.97 | **retained** |
| `CL~WT:power` | 21.433 | 1 | 3.664e-6 | 9.159e-6 | – | – | 2 | 0.72682 | 0.22183 | 1.00 | **retained** |
| `CL~EGFR:power` | 13.727 | 1 | 2.114e-4 | 3.523e-4 | – | – | 3 | 0.57762 | 0.19666 | 0.99 | **retained** |
| `V~SEX:proportional` | 0.015 | 1 | 9.020e-1 | 9.466e-1 | – | – | – | 0.00946 | 0.07680 | 0.29 | **rejected** |
| `CL~SEX:proportional` | 0.004 | 1 | 9.466e-1 | 9.466e-1 | – | – | – | 0.00512 | 0.07646 | 0.36 | **rejected** |

## Calibration and virtual refits

| candidate | p (calibrated) | p (Westfall-Young) | refit ΔOFV | refit p | refit beta | converged |
|---|---:|---:|---:|---:|---:|---|
| `V~WT:power` | – | – | 41.853 | 9.840e-11 | 1.01002 | yes |
| `CL~WT:power` | – | – | 21.942 | 2.810e-6 | 0.72682 | yes |
| `CL~EGFR:power` | – | – | 15.947 | 6.516e-5 | 0.57762 | yes |
| `V~SEX:proportional` | – | – | 0.707 | 4.003e-1 | – | – |
| `CL~SEX:proportional` | – | – | 0.111 | 7.388e-1 | – | – |

Joint refit of the retained set: OFV -1082.561 → -1157.813 (ΔOFV 75.252, converged: true).

## Decisions

### retained (3)

- `CL~WT:power` — added at SCM forward step 2 by refit (dOFV 18.542, p 1.662e-5 < 0.05); kept by the backward elimination: removing it raises the OFV by 21.942 (p 2.810e-6 < 0.01)
  - draft: `TVCL = TVCL * (WT/72.2047)**0.7268   ; UNCONFIRMED nlmx draft`
- `CL~EGFR:power` — added at SCM forward step 3 by refit (dOFV 15.947, p 6.516e-5 < 0.05); kept by the backward elimination: removing it raises the OFV by 15.947 (p 6.516e-5 < 0.01)
  - draft: `TVCL = TVCL * (EGFR/93.6222)**0.5776   ; UNCONFIRMED nlmx draft`
- `V~WT:power` — added at SCM forward step 1 by refit (dOFV 40.764, p 1.718e-10 < 0.05); kept by the backward elimination: removing it raises the OFV by 41.853 (p 9.840e-11 < 0.01)
  - draft: `TVV = TVV * (WT/72.2047)**1.0100   ; UNCONFIRMED nlmx draft`

### uncertain (0)

_none_

### rejected (2)

- `CL~SEX:proportional` — tested on refits: dOFV 0.111 (p 7.388e-1) was not below 0.05 at any forward step
- `V~SEX:proportional` — tested on refits: dOFV 0.707 (p 4.003e-1) was not below 0.05 at any forward step

## Selection trace

- base-solution stationarity: U_n' I_nn^-1 U_n = 0.000 on 6 df (approximate OFV that re-estimating the frozen parameters would gain in this engine's likelihood); largest standardised components: OMEGA(1,1) -0.00, THETA(1) -0.00, THETA(4) -0.00
- stepwise covariate modelling on refits: both search, forward p < 0.05, backward p >= 0.01 removes, 3 candidate(s) refitted per forward step
- scm forward step 1: `V~WT:power` dOFV 40.764 (p 1.718e-10)
- scm forward step 1: `CL~WT:power` dOFV 17.533 (p 2.824e-5)
- scm forward step 1: `CL~EGFR:power` dOFV 12.696 (p 3.664e-4)
- scm forward step 1: added `V~WT:power` (dOFV 40.764, p 1.718e-10)
- scm forward step 2: `CL~WT:power` dOFV 18.542 (p 1.662e-5)
- scm forward step 2: `CL~EGFR:power` dOFV 12.546 (p 3.971e-4)
- scm forward step 2: `V~SEX:proportional` dOFV 0.723 (p 3.952e-1)
- scm forward step 2: added `CL~WT:power` (dOFV 18.542, p 1.662e-5)
- scm forward step 3: `CL~EGFR:power` dOFV 15.947 (p 6.516e-5)
- scm forward step 3: `CL~SEX:proportional` dOFV 0.263 (p 6.082e-1)
- scm forward step 3: `V~SEX:proportional` dOFV 0.715 (p 3.976e-1)
- scm forward step 3: added `CL~EGFR:power` (dOFV 15.947, p 6.516e-5)
- scm forward step 4: `CL~SEX:proportional` dOFV 0.111 (p 7.388e-1)
- scm forward step 4: `V~SEX:proportional` dOFV 0.707 (p 4.003e-1)
- scm forward step 4: best refit p 4.003e-1 >= 0.05 — forward stage stops
- scm backward step 1: without `V~WT:power` dOFV 41.853 (p 9.840e-11)
- scm backward step 1: without `CL~WT:power` dOFV 21.942 (p 2.810e-6)
- scm backward step 1: without `CL~EGFR:power` dOFV 15.947 (p 6.516e-5)
- scm backward step 1: every term has p < 0.01 — backward stage stops
- scm final model: 3 relationship(s) (V~WT:power, CL~WT:power, CL~EGFR:power), OFV -1157.813
- final model refit: OFV -1157.8135; coefficients [0.72682, 0.57762, 1.01002]

## 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
- information: opg estimator; nuisance block from nlmx's own likelihood
- Subjects without a converged conditional mode: 0
- Subject-level likelihood evaluations: 1380
- Full run transcript: `C:\Users\askph\Desktop\PROJECTS\RUST\CovariateAnalysis\nlmx-book\documents\ch22\results\scm\log_6349336351.txt`

## Limitations

- Results are **frozen-model efficient-score recommendations**. The base model was not re-estimated and equivalence with NONMEM SCM has not been established for this model class.
- One-step coefficients are local (one Newton step from beta = 0), not maximum-likelihood estimates from a refitted model; large effects are typically over- or under-stated.
- Conditional selection keeps the frozen parameters at their final estimates; only candidate directions are decorrelated.
- The likelihood is a Laplace (or FO) approximation evaluated by nlmx, not NONMEM's own objective.
- Every candidate retained here must be confirmed by an explicit NONMEM fit before it is used for inference or submission.
