7.1 Example data

library(ggplot2)
library(dplyr)
library(rstanarm)

This data comes from:

https://www.kaggle.com/datasets/spittman1248/cdc-data-nutrition-physical-activity-obesity

I will use a small subset, 2016 data containing for each state the percentage if adults who have obesity and the percent who engaged in strength training at least twice a week.

exercise <- readr::read_csv('data/2016Exercise.csv',show_col_types = FALSE)
head(exercise)
## # A tibble: 6 × 3
##   state obesity strengthTraining
##   <chr>   <dbl>            <dbl>
## 1 AL       35.6             25.7
## 2 AK       29.8             34.1
## 3 AZ       28.4             30.7
## 4 AR       34.5             24.4
## 5 CA       24.2             33  
## 6 CO       20.2             35.4