Documentation

13.24 Custom tables: summary, count, and listing

Each [[table]] block adds one CSV table. The three kinds are summary, count, and listing. They share plot scopes (observations, doses, all, subjects), optional filter, and pk_only.

Summary

summary calculates selected statistics for vars, optionally within by groups. Available statistic names are n, nmiss, mean, sd, cv, sem, median, min, max, q1, q3, p5, p95, geomean, gcv, ci_lo, and ci_hi. Choose a coherent set rather than every statistic. Geometric measures require positive values; confidence bounds and SEM require enough data for meaningful estimation.

Count and listing

count reports n and percentage for levels of variables within groups. Verify denominators and missing-level handling. listing writes selected rows/columns and is useful for exceptions or review queues. max_rows caps a listing (default 10,000); a truncated listing must be labeled as such.

overall=true adds an All row/column across grouping; digits controls significant digits. Rounding is presentation, not precision, and source values should remain available.

Custom table names share one namespace with custom plot names, so use stable, descriptive slugs such as exposure_by_arm rather than table1. A missing named column stops the run, but a semantically wrong existing column does not. Validate variable meaning, units, population, and grouping independently.

[[table]]
name = "exposure_by_dose_and_sex"
kind = "summary"
scope = "subjects"
vars = ["CMAX", "AUCLAST"]
by = ["DOSE", "SEX"]
stats = ["n", "geomean", "gcv", "median", "min", "max"]
overall = true

Common mistakes

  • Summarizing record-level covariates when one row per subject is intended.
  • Reporting percentages without denominators.
  • Ignoring listing truncation.
  • Treating rounded CSV values as full numerical evidence.

Checklist

  • Define scope/population and filters.
  • Select variables, groups, and statistics deliberately.
  • Verify positivity and effective n.
  • Label overall rows and truncation.
  • Cross-check results with plots/source records.

Further reading

See custom plot scope, standard demographic tables, and the csvworked custom table.