On Github joethetoast / bmi_calculator_slides
by Joe the Toast
According to Wikipedia:
The body mass index (BMI), or Quetelet index, is a measure of relative weight based on the mass and height of an individual.
BMI is a way to calculate whether an individual's weight is considered to be in the normal range for their height.
The formula to calculate BMI (using feet and lbs) is:
\[\dfrac{mass(lb)}{height (in)^2} \times 703\]
This formula is relatively simple, but more complex than most people are able to do in their head.
To assist with the calculation, we've created a Shiny app that takes 2 inputs:
Given the height and weight, the app will calculate the BMI for that individual.
As an example, with an input height of 5 feet 7 inches and a weight of 155 lbs, the app would perform the following calculation in R:
inches <- (5 * 12) + 7 weight <- 155 conversion_const = 703 bmi <- (weight / (inches^2)) * conversion_const bmi
## [1] 24.27
In addition to calculating the BMI, the app includes a reference table that tells what cateogry the calculated BMI falls into.
It should be noted that not everybody agrees how BMI numbers should be classified. This section of the Wikipedia article on BMI outlines some of the crticisms and limitations of BMI number classifications.
In spite of its shortcomings, BMI calculations can still be a useful measurement.