gtsummary

Overview

{gtsummary} has become my preferred way of creating tables of all types. It’s highly customizable and can almost always get the exact output I’m looking for. It’s based of the {gt} package for creating tables, so can be even more customizable. It also includes functions for pulling out numbers from the tables to report in the text.

Slides

Open the slides in a new tab here.

Exercises

  1. Download the quarto document here and put it into your R project folder.
  2. Render the document.
  3. Make a tbl_summary(). Include (at least) number of hours of sleep on weekdays and weekends, categorical region, and income and make sure they are nicely labeled. Play around with the extra functions from the examples and/or from the documentation
  4. Fit a Poisson regression for the number of siblings, using at least 3 predictors of your choice. Create a nice table displaying your Poisson regression and its exponentiated coefficients.

Resources