Supplemental Lesson: Creating Table 1, Table 2, and References
Applied Epidemiologic Reporting in Quarto
Overview
In this lesson, you will learn how to create Table 1 (Descriptive Statistics), Table 2 (Analytic Results), and properly format references in a reproducible Quarto workflow.
These are essential components of epidemiologic manuscripts and will be required for your final project.
Learning Objectives
By the end of this lesson, students will be able to:
Create a publication-style Table 1
Create a regression-based Table 2
Interpret tables in plain language
Export clean tables from R
Add and format references in Quarto
Required Packages
library(tidyverse)
Warning: package 'dplyr' was built under R version 4.5.1
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.2.0 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.5.2 ✔ tibble 3.2.1
✔ lubridate 1.9.4 ✔ tidyr 1.3.1
✔ purrr 1.0.4
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(gtsummary)
Warning: package 'gtsummary' was built under R version 4.5.1
library(gt)
Warning: package 'gt' was built under R version 4.5.1
Abbreviations: CI = Confidence Interval, OR = Odds Ratio
Export Table 2
table2 %>%as_gt() %>% gt::gtsave("table2.html")
Writing About Tables
Example:
“The mean BMI was higher among individuals with diabetes compared to those without (p < 0.05). In adjusted models, age and BMI were significantly associated with diabetes status.”
Adding References in Quarto
Step 1: Create a .bib File
Example references.bib:
@article{nhanes,
title={National Health and Nutrition Examination Survey},
author={CDC},
year={2023}
}
Step 2: Add to YAML
bibliography: references.bib
csl: apa.csl
Step 3: Cite in Text
Example:
This dataset comes from NHANES [@nhanes].
Step 4: References Section
Add this at the end:
## References
Quarto will automatically generate the reference list.
Key Takeaways
Table 1 describes your sample
Table 2 presents analytic results
Use gtsummary for clean outputs
Always interpret results in plain language
Use Quarto citation tools for references
Practice Activity
Create Table 1 using your Project dataset
Create Table 2 using a regression model
Export both tables
Write 2–3 sentences interpreting each table
Add at least one reference using .bib
Conclusion
Tables and references are essential for scientific communication. Mastering these skills will help you produce clear, professional, and reproducible public health reports.