<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/tracking-exercise-trends-with-nhanes/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://blog.nycdatascience.com/student-works/tracking-exercise-trends-nhanes/"> R – NYC Data Science Academy Blog</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>Contributed by <a target="_blank" rel="nofollow" href="http://blog.nycdatascience.com/author/tkassel/">Thomas Kassel</a>. He is currently enrolled in the NYC Data Science Academy 17-week remote bootcamp program taking place from January-April 2017. This post is based on his second class project, R Shiny (due on the 6th week of the program).</p>
<p> </p>
<h2><strong>Introduction</strong><em> </em></h2>
<p><strong>About NHANES</strong></p>
<p>The National Health and Nutrition Examination Survey (NHANES) is one of the foremost assessments of health statistics for children and adults in the United States. Sponsored by the Centers for Disease Control, <a target="_blank" rel="nofollow" href="https://wwwn.cdc.gov/Nchs/Nhanes/About/">NHANES</a> combines interviews with physical examinations and laboratory tests for approximately 5,000 Americans each year. Results are compiled, anonymized and made publicly available at the program’s website on a rolling basis. These datasets are a major source of information for further studies ranging from simple national averages for physiological measurements (height or weight) to epidemiological trends for public health policy reform.</p>
<p><strong>American Health Stats App</strong></p>
<p>The 2013-2014 NHANES publication is made accessible through an R shiny application, providing an interactive environment for users to explore data trends. Because of the wide range of information gathered by the survey, the app focuses on a subset of the findings, drawing particular attention to the prevalence of exercise and associated health outcomes across demographic groups.</p>
<p><a target="_blank" rel="nofollow" href="https://i1.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/02/Overview-App.png"><img sizes="(max-width: 1024px) 100vw, 1024px" alt="Overview App" class="wp-image-19320" src="https://i1.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/02/Overview-App-1024x581.png?resize=456%2C259" data-recalc-dims="1"></a></p>
<p> </p>
<h2><strong>Data</strong></h2>
<p>NHANES divides results into many separate tables for more manageable file download sizes. The app makes use of the following datasets (including but not limited to):</p>
<ul>
<li><u>Demographics</u> – gender, age, ethnicity, education, annual household income, household size</li>
<li><u>Exercise</u> – minutes of various forms of physical activity per day</li>
<li><u>Examination/Laboratory</u> – physiological measurements</li>
</ul>
<p>The common field across tables is the <em>sequence ID,</em> a unique identifier for each survey participant which can be used for joining operations across any/all tables. Let’s take a look at the initial raw data import of many NHANES tables and an example <em>dplyr</em> left_join operation to quickly aggregate information by survey participant.</p>
<p>View the code on <a target="_blank" rel="nofollow" href="https://gist.github.com/thomas-kassel/97fda845324d7c81b82af1c0659d34aa">Gist</a>.</p>
<p>View the code on <a target="_blank" rel="nofollow" href="https://gist.github.com/thomas-kassel/04565d89dbefe767f1ea217223aa7dc6">Gist</a>.</p>
<p> </p>
<h2><strong>Exploration</strong></h2>
<p><span><em>What demographic cohorts are covered by NHANES?</em></span></p>
<p>The “Overview &amp; Demographics” tab allows users to explore this question. NHANES appears to be a nationally representative sample of the U.S. population across gender, education level and income. However, certain populations of particular interest to public health policy, such as developing youths under 18 years old, make up a relatively large cohort.<em> </em></p>
<p><em><a target="_blank" rel="nofollow" href="https://i2.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/02/Demographics-Age-by-Ethnicity.png"><img sizes="(max-width: 977px) 100vw, 977px" alt="Demographics - Age by Ethnicity" class="wp-image-19315" src="https://i2.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/02/Demographics-Age-by-Ethnicity.png?resize=456%2C202" data-recalc-dims="1"></a></em></p>
<p> </p>
<p><span><em>Which populations regularly engage in physical activity? </em></span></p>
<p>The “Explore Exercise Trends” tab provides exploratory visualization of <em>who is getting exercise, in what form and amount, and the possible health outcomes associated</em>. Density curves help to illustrate exercise trends and confirm preconceptions about some of the grouping (i.e. demographic) variables involved in those trends.</p>
<p>Below we observe that, with each drop in level of education – from college/advanced graduate down to high school dropout – the density curve’s average moves from left to right. This implies a direct inverse relationship between minutes per day conducting “vigorous or moderate” physical activity at the workplace, i.e. manual labor, and education.</p>
<p><a target="_blank" rel="nofollow" href="https://i2.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/02/Workplace-Exercise-by-Education.png"><img sizes="(max-width: 976px) 100vw, 976px" alt="Workplace Exercise by Education" class="wp-image-19316" src="https://i2.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/02/Workplace-Exercise-by-Education.png?resize=456%2C200" data-recalc-dims="1"></a></p>
<p> </p>
<p><em><u>What health outcomes associate with physical activity?</u></em></p>
<p>Minutes per day of physical activity – whether in the workplace, recreationally; vigorous, moderate or otherwise – are used as the predictor variable in a scatterplot to explore correlations with a variety of health outcomes such as weight, BMI, cholesterol, or blood pressure.</p>
<p><a target="_blank" rel="nofollow" href="https://i2.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/02/Pulse-vs-Exercise.png"><img sizes="(max-width: 981px) 100vw, 981px" alt="Pulse vs Exercise" class="wp-image-19317" src="https://i2.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/02/Pulse-vs-Exercise.png?resize=456%2C242" data-recalc-dims="1"></a></p>
<p>Above we observe a clear negative correlation between resting pulse (bpm) and average minutes per day of vigorous recreational activity. Through the use of interactive graphing package <em>Plotly</em>, we gain further information from mouseover tooltips in this visual: of participants getting an average 180 mins of exercise per day, none had a resting pulse of over 98 bpm.</p>
<p>Other relationships explored, such as cholesterol levels versus exercise habits, highlight the limitations of taking a bivariate approach in predicting health outcomes. For example, we might assume a negative correlation between amount of exercise and LDL cholesterol levels, but in the case below we observe this correlation to actually be <em>positive</em>. This suggests the study could benefit from other known associations to cholesterol such as diet (perhaps individuals with moderate-exercise jobs tend to have higher-cholesterol diets) and genetic disposition.</p>
<p><a target="_blank" rel="nofollow" href="https://i0.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/02/Cholesterol.png"><img sizes="(max-width: 978px) 100vw, 978px" alt="Cholesterol" class="wp-image-19318" src="https://i0.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/02/Cholesterol.png?resize=456%2C237" data-recalc-dims="1"></a></p>
<p> </p>
<h2><strong>Next Steps</strong></h2>
<p>As alluded to in the previous section, addition of variables to the shiny app could provide a more comprehensive overview of health outcomes. Chief among these would be an exploration of dietary/nutritional and lifestyle habits (e.g. smoking, drug use), both of which NHANES has collected for each participant. Since the NHANES is an ongoing and continuously developing program, there is further potential to track the movement of these trends over time.</p>
<p>The post <a target="_blank" rel="nofollow" href="http://blog.nycdatascience.com/student-works/tracking-exercise-trends-nhanes/">Tracking Exercise Trends with NHANES</a> appeared first on <a target="_blank" rel="nofollow" href="http://blog.nycdatascience.com/">NYC Data Science Academy Blog</a>.</p>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://blog.nycdatascience.com/student-works/tracking-exercise-trends-nhanes/"> R – NYC Data Science Academy Blog</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/ZRiuQWYyElI"></a></div>