Documentation

21.22 Filtering diagnostic views without changing the fit

--gof-filter EXPR keeps observations matching an R-style condition for GOF plots. The expression can reference dataset columns and values from predictions.csv, including ID, TIME, DV, PRED, IPRED, residuals, and ETAs. It is evaluated before any GOF back-transformation and also applies within stratified plots.

nlmx fit run101.ctl --plots `
  --gof-filter "TIME > 0 & STUDY != 3"

The filter does not change estimation, EBEs, predictions.csv, parameter estimates, or OFV. It is a presentation view of a fixed result. This makes it useful for planned questions such as postdose-only behavior, a specific endpoint, a concentration range, or a clinically important study phase.

Filtering is a declared view of full evidence

Always preserve an unfiltered figure set. State the exact expression and count of retained observations and subjects. Check operator precedence and boundary values with a small table; an apparently simple &/| expression can select an unintended population. Remember that log-DV values in the stored columns remain on the fitted scale when the filter is evaluated.

Filtering should not be used to hide outliers or inconvenient regions. If records are excluded from the scientific analysis, that requires a data/likelihood rule and a new fit—not merely a GOF filter. Use filtered plots to investigate, then document whether the finding changes the model or remains a limitation.

Common mistakes

  • Assuming a GOF filter changes the likelihood.
  • Publishing only the favorable filtered panel.
  • Using original-scale thresholds on stored log-scale values.
  • Failing to test expression precedence.
  • Calling a filtered view a sensitivity fit.

Checklist

  • Preserve the unfiltered overview.
  • Record the exact expression and evaluation scale.
  • Reconcile retained rows and subjects.
  • Test boundaries and logical precedence.
  • Separate presentation filtering from analysis exclusion.

Further reading

See diagnostic population, back-transformation, and decision documentation.