22.25 Stepwise covariate modelling with --method scm
SCM tests every decision with a refit of the population model and a likelihood-ratio test. It uses nlmx’s likelihood and estimator; no NONMEM executable is called.
nlmx cov -c nlmx.covar --method scm --scm-direction both
Forward selection starts from the base model plus mandatory terms. It refits remaining candidates, adds the smallest p-value below forward alpha, and repeats. Backward elimination removes each retained term in turn and drops the term with the largest p-value when it is at or above retention alpha. both runs forward then backward. backward alone starts from the full scoped model.
--scm-candidates-per-step 3 refits the top three score-ranked forward candidates by default. Zero refits every remaining candidate at every step, closer to PsN’s exhaustive behavior but more expensive. Backward steps test each term. Caches avoid repeating identical refits.
With multiple forms, equation comparison first chooses one form per relationship. selection_trace.csv records every addition/removal test. candidate_results stores selection step, backward p, and step-specific refit evidence.
Differences from PsN/NONMEM remain: nlmx uses its own likelihood/approximation, candidate catalogue, and refit implementation, so ΔOFV can differ. Confirm draft_model.ctl in the target reference workflow.
Reading the SCM path, not just the endpoint
The path shows what evidence was available at each conditional model. At every forward step, review all refitted candidates, the winning change in OFV, degrees of freedom, p-value, convergence, and coefficient plausibility. During backward elimination, confirm that removal tests use the current full model and the intended stricter retention threshold. --scm-candidates-per-step 0 refits all eligible candidates like a full PsN-style search; a positive cap accelerates work by using the frozen ranking to decide which candidates reach refitting and can therefore change the explored path. Inspect failed refits explicitly. A retained endpoint is credible only when the final joint fit is stable and diagnostically acceptable.
Common mistakes
- Assuming SCM always refits every candidate when the top-N shortcut is active.
- Comparing a step-specific ΔOFV with the base model as if identical.
- Treating backward-only as starting from the base model.
- Calling nlmx and PsN ΔOFVs numerically interchangeable.
- Deleting failed refits from the selection history.
Checklist
- Choose forward, backward, or both prospectively.
- Set forward/retention thresholds and candidates per step.
- Review convergence of every decisive refit.
- Preserve selection trace and cache.
- Confirm the final draft in NONMEM/reference software when required.
Further reading
Chapter 23A will give the full SCM reference. Also see thresholds and the worked SCM example.