Baseline characteristics tables are the most-copied, most-error-prone table in clinical papers. gtsummary generates a publication-ready one — with the right summary and test per variable — from a single call.
Author
Rverse Analytics
Published
July 9, 2026
Every clinical paper opens with the same table: participant characteristics, split by group. Built by hand it is tedious and easy to get wrong — the wrong summary statistic, the wrong test, a percentage that doesn’t add up. gtsummary builds it correctly from one function call, and regenerates it the moment your data changes.
The one-liner
We’ll use the trial dataset that ships with gtsummary — a small clinical-trial example:
2 Wilcoxon rank sum test; Pearson’s Chi-squared test
That’s the whole table. tbl_summary() picks median (IQR) for continuous variables and n (%) for categoricals; add_p() chooses an appropriate test for each row (Wilcoxon, chi-squared, Fisher) and reports the p-value. No manual test selection, no transcription.
Making it publication-ready
A few extra verbs turn it into something you can paste straight into a manuscript:
2 Wilcoxon rank sum test; Pearson’s Chi-squared test
Here we switched continuous summaries to mean (SD), relabelled variables, added an overall column, and counted missing values explicitly instead of dropping them silently — a small honesty that reviewers notice.
Why it matters
The value isn’t saving five minutes once; it’s that the table is code. Clean a data point, rerun, and every number updates — including the tests and the percentages. There is no window where the manuscript and the data disagree. That’s the whole philosophy behind how we work, applied to the humblest table in the paper.