Project Overview
This project utilized accelerometer data collected on 250
participants in the NHANES study, or the accel
dataset. The
demographic dataset is accessible from HERE, and the
accelerometer data is accessible from HERE. The project
utilized R version 4.3.1 and R packages dplyr
,
ggplot2
, and tidyverse
.
After cleaning, final dataset includes all originally observed variables; participants less than 21 years of age or with missing demographic data are excluded.
There are 228 participants in the study, and the merged dataset has 1445 variables, after excluding participants less than 21 years of age and those with missing demographic data.
Visualizations and EDA
Table of gender distribution in each education category
education | sex | n_obs |
---|---|---|
Less than high school | female | 28 |
Less than high school | male | 27 |
High school equivalent | female | 23 |
High school equivalent | male | 35 |
More than high school | female | 59 |
More than high school | male | 56 |
Based on the table, for education levels of Less than high school and More than high school, male and female have similar number of participants. For High school equivalent education level, however, there are much more males compared to females.
Box Plot of age distributions in each education category, by gender
Age distribution for different education level is similar across genders. Again, difference between genders is only apparent for High school equivalent education level, where the minimum, maximum, and mean age of female is higher than male.
Total Activity over the Day
Distribution of total activity over day by age, gender, and education level
Overall, total activity decreases as age increases, consistent across all education levels and genders. This trend is most apparent among those with less than high school education, and least apparent among those with more than high school education.
For those with less than high school education, total activity decreases as age proceed from 21 to 50, then increases as age proceed from 50 to 60, then decreases again as age continues to increase. Males have more increase from age 50 to 60 than female.
For those with high school equivalent education, total activity increases as age proceed from 21 to 40, then decreases as age continues to proceed. For females, total activity increases again from age 60 to 70, then decreases again. For males, total activity plateaus starting age 60.
For those with more than high school education, total activity plateaus from age 21 to 40. For females, total activity increases slightly as age proceed from 40 to 45, then decreases starting 50. For males, total activity plateaus from 21 to 50, increases slightly from 50 to 60, then decreases starting 60.
24-hour activity time courses by education level and gender
In a 24-hour time window, activity level first decreases in the early morning (0 to 250 minutes or 0 to 4.17 hours of day), sharply increases starting at 250 minutes or 4.17 hours of day, reaches its peak 500 to 10200 minutes or 8.33 to 170 hours of day, and sharply decreases starting at 10200 minutes or 170 hours of day. This trend is observed across education levels and sex. Female has higher activity level peak than males, across all education levels.
The activity peak for those with less than high school education is highest for both genders compared to the other two education level groups. This group decreases sharply after it reaches its peak activity level, consistent across genders.
The activity peak for those with high school equivalent education is the lowest for both genders compared to the other to education level groups. After reaching to its peak, this group plateaus (slightly decreases) from 500 to 10200 minutes or 8.33 to 170 hours of day, then sharply decreases afterwards.
The activity peak for those with more than high school education plateaus the longest, particularly for males.