BMI Calculator – A Shiny app to calculate BMI



BMI Calculator – A Shiny app to calculate BMI

0 0


bmi_calculator_slides

Slidify presentation for the bmi_calculator Shiny app

On Github joethetoast / bmi_calculator_slides

BMI Calculator

A Shiny app to calculate BMI

by Joe the Toast

What is BMI?

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.

How is BMI calculated?

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.

How does the BMI calculator help?

To assist with the calculation, we've created a Shiny app that takes 2 inputs:

  • Height (in feet and inches)
  • Weight (in lbs)

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.