<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="http://www.r-bloggers.com/how-many-calories-should-you-eat-per-day/"></div></div><div><a data-url="http://www.r-bloggers.com/how-many-calories-should-you-eat-per-day/" data-counturl="http://www.r-bloggers.com/how-many-calories-should-you-eat-per-day/" data-count="horizontal" data-text="How many calories should you eat per day?" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://www.decisionsciencenews.com/2016/07/06/many-calories-eat-per-day/"> R – Decision Science News</a></strong>, and kindly contributed to <a rel="nofollow" href="http://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>US GOVERNMENT GUIDELINES BY AGE, SEX, ACTIVITY LEVEL</p>
<p><a target="_blank" href="http://i0.wp.com/www.decisionsciencenews.com/wp-content/uploads/2016/07/raw.png"><img alt="raw.s" class="wp-image-5761" src="http://i1.wp.com/www.decisionsciencenews.com/wp-content/uploads/2016/07/raw.s.png?resize=450%2C900" data-recalc-dims="1"></a><br>Click to enlarge</p>
<p>At Decision Science News, we are always on the lookout for rules of thumb.</p>
<p>Our colleague <a target="_blank" href="http://www.justinmrao.com/">Justin Rao</a> was thinking it would be useful to express calories as a percentage of daily calories. So instead of a coke being 150 calories, you could think of it as 7.5% of your daily calories. Or whatever. The whatever is key.</p>
<p>This is an example of putting <a target="_blank" href="http://dangoldstein.com/papers/Barrio_Goldstein_Hofman_Improving_Comprehension_Numbers_News_CHI16.pdf">unfamiliar numbers in perspective</a>.</p>
<p>So, we were then interested to see if there would be an easy rule of thumb for people to calculate how many calories per day they should be eating, so that they could re-express foods as a percentage of that.</p>
<p>We found some <a target="_blank" href="http://health.gov/dietaryguidelines/2015/guidelines/appendix-2/">calorie guidelines on the Web</a> published by the US government. With the help of <a target="_blank" href="http://jakehofman.com/">Jake Hofman</a>, we used <a target="_blank" href="http://hadley.nz/">Hadley Wickham</a>‘s <a target="_blank" href="https://blog.rstudio.org/2014/11/24/rvest-easy-web-scraping-with-r/">rvest</a> package to scrape them and his <a target="_blank" href="https://cran.rstudio.com/web/packages/dplyr/vignettes/introduction.html">other</a> <a target="_blank" href="https://blog.rstudio.org/2015/12/21/ggplot2-2-0-0/">tools</a> to process and plot them.</p>
<p>The result is above. If you have any ideas on how to fit it elegantly, let us know.</p>
<p>We tried a number of fits. Lines are good for heuristics, so we made a bi-linear fit to the raw data (in points). We’re all grownups reading this blog, so let’s focus on the lines to the right of the peak.</p>
<p><a target="_blank" href="http://i0.wp.com/www.decisionsciencenews.com/wp-content/uploads/2016/07/two.part_.linear.png"><img alt="two.part.linear.s" class="wp-image-5763" src="http://i0.wp.com/www.decisionsciencenews.com/wp-content/uploads/2016/07/two.part_.linear.s.png?resize=456%2C912" data-recalc-dims="1"></a>Click to enlarge</p>
<p>Time to make the heuristics. For women, you need about 65 fewer calories per day for every decade after age 20. For men, you need about 105 fewer calories per day for every decade after age 20. Or let’s just say 70 and 100 to keep it simple.</p>
<p>So, if you have an opposite sex life partner (OSLP?), keep in mind that you may need to cut back by more or fewer calories as the person across the table as you age together. Same sex life partner (SSLP?), cut back the same amount. Just don’t go beyond the range of the chart. The guidelines suggest even sedentary men shouldn’t eat fewer than 2,000 calories a day at any age. For women, that number is 1650.</p>
<p>REFERENCES</p>
<p>Barrio, Pablo J., Daniel G. Goldstein, &amp; Jake M. Hofman. (2016). Improving comprehension of numbers in the news. ACM Conference on Human Factors in Computing Systems (CHI ’16). [<a target="_blank" href="http://dangoldstein.com/papers/Barrio_Goldstein_Hofman_Improving_Comprehension_Numbers_News_CHI16.pdf">Download</a>]</p>
<p>The R code, below, has some other attempts at plots in it. You may be most interested in it as a way to see rvest in action. Or just to get the data.</p>
<p></p>
<p>The post <a target="_blank" rel="nofollow" href="http://www.decisionsciencenews.com/2016/07/06/many-calories-eat-per-day/">How many calories should you eat per day?</a> appeared first on <a target="_blank" rel="nofollow" href="http://www.decisionsciencenews.com/">Decision Science News</a>.</p>
<p><div><div><div><div data-width="55" data-show-faces="false" data-send="true" data-layout="box_count" data-height="62" data-href="http://www.r-bloggers.com/how-many-calories-should-you-eat-per-day/"></div></div><div><a data-url="http://www.r-bloggers.com/how-many-calories-should-you-eat-per-day/" data-counturl="http://www.r-bloggers.com/how-many-calories-should-you-eat-per-day/" data-count="vertical" data-text="How many calories should you eat per day?" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://www.decisionsciencenews.com/2016/07/06/many-calories-eat-per-day/"> R – Decision Science News</a></strong>.</div>
<hr>
<a rel="nofollow" href="http://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="http://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="http://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="http://www.r-bloggers.com/?s=data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="http://www.r-bloggers.com/?s=Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="http://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="http://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" rel="nofollow" href="http://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="http://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="http://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="http://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="http://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="http://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="http://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="http://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="http://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="http://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" rel="nofollow" href="http://www.r-bloggers.com/?s=time+series">time series</a>, <a title="finance trading" rel="nofollow" href="http://www.r-bloggers.com/?s=trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/gzLX2DgwqBs"></a></div>