The Quantitative Playbook for Public Health Research in R

R Plays to Promote and Protect Health

Author

Shane McCarty, PhD

Published

October 22, 2025

Preface

In the FRI Public Health research stream at Binghamton University, student research teams explore a variety of biopsychosocial factors affecting human physical and mental health. Some teams collect biological measures using the MUSE S headband and fitbit charge 6. Most teams collect self-report survey data on psychological and sociodemographics via Qualtrics. Some teams design online behavioral experiments to examine cause-and-effect relationships. To analyze quantitative data in R, the FRI Public Health Lab has created this playbook with a variety of “plays” (R code) for students in the quantitative data analysis track to use for their team-based research projects.

The most successful sports teams rely on well-designed plays to navigate complex game situations. The FRI Public Health research stream uses strategic data analysis “plays” to tackle the multifaceted challenges of health promotion and disease prevention. Our research stream explores the intricate biopsychosocial factors affecting human physical and mental health by collecting physiological data through wearables like MUSE S and Fitbits, psychological insights via survey questionnaires and interviews, and behavioral patterns through online experiments. Ultimately, our research aims to connect the dots between biological, social, political, commercial, and economic determinants of health behavior, outcomes, and inequities.

Like a coach calling the right play at the crucial moment, this playbook equips you and your research teams with proven strategies from the tidyverse for importing data, tidying data in tidyr, transforming data in dplyr, visualizing data in ggplot2, modeling with stats, and writing reproducibly in quarto with R. Each “play” in this guide has been field-tested by research teams who have successfully used quantitative techniques to answer pressing questions about physical and mental health. Whether you’re facing a complex dataset for the first time or looking to refine your analytical strategy, this playbook offers guidance for you to turn data into information, information into knowledge, and knowledge into wisdom in order to improve public health outcomes.