Shiny App Pitch - Body Mass Index (BMI) Calculation and Evaluation

D. Bretheim
8/27/2016

Introduction

The body mass index (BMI) is a value derived from the weight and height of an individual using the following formula.

     \( (weight/height^{2}) x 703 \), where weight is in pounds and height is in inches.

The BMI is an attempt to quantify the amount of tissue mass (muscle, fat, and bone) in an individual, and then categorize that person as underweight, normal weight, overweight, or obese based on that value. Commonly accepted BMI categories are:

Category BMI Range
Very severely underweight <= 15
Severely underweight 15 <= 16
Underweight 16 <= 18.5
Normal (healthy weight) 18.5 <= 25
Overweight 25 <= 30
Obese Class I (Moderately obese) 30 <= 35
Obese Class II (Severely obese) 35 <= 40
Obese Class III (Very severely obese) > 40

The Application

The user is prompted to enter the following values:
   * Gender
   * Age group
   * Weight in pounds
   * Height in inches

Selection options, defaults and max values include:
   * Gender: Female and Male
   * Age group: 10 year age bands beginning at 20
   * Weight: default is 0; max is 440 pounds, and step value is 1
   * Height: default is 0; max is 84 inches, and step value is 1

When the 'Submit' button is pushed, the application displays the values entered by the user:
   * The gender selection
   * The age group selection
   * The weight entererd
   * The age entered

Then the application returns the following values derived from the user inputs:
   * BMI (calculated)
   * BMI Category (function call)
   * BMI percentile tier based on the user's gender and age group (function call)

Benchmark Data

The percentile data represents the BMI values for U.S. males and females aged 20 and over by age group for the period 2007-2010 and is displayed in the table below. See the reference section for additional source information.

pct <- read.csv('C:/Users/Dan/datasciencecoursera/Course9_Project/percentile.csv', header=TRUE)
names(pct) <- c("Male","5th","10th","15th","25th","50th","75th","85th","90th","95th")
pct
     Male  5th 10th 15th 25th 50th 75th 85th 90th 95th
1   20-29 19.4 20.7 21.4 22.9 25.6 29.9 32.3 33.8 36.5
2   30-39 21.0 22.4 23.3 24.9 28.1 32.0 34.1 36.2 40.5
3   40-49 21.2 22.9 24.0 25.4 28.2 31.7 34.4 36.1 39.6
4   50-59 21.5 22.9 23.9 25.5 28.2 32.0 34.5 37.1 39.6
5   60-69 21.3 22.7 23.8 25.3 28.8 32.5 34.7 37.0 40.0
6   70-79 21.4 22.9 23.8 25.6 28.3 31.3 33.5 35.4 37.8
7     80+ 20.7 21.8 22.8 24.4 27.0 29.6 31.3 32.7 34.5
8  Female  5th 10th 15th 25th 50th 75th 85th 90th 95th
9   20-29 18.8 19.9 20.6 21.7 25.3 31.5 36.0 38.0 43.9
10  30-39 19.4 20.6 21.6 23.4 27.2 32.8 36.0 38.1 41.6
11  40-49 19.3 20.6 21.7 23.3 27.3 32.4 36.2 38.1 43.0
12  50-59 19.7 21.3 22.1 24.0 28.3 33.5 36.4 39.3 41.8
13  60-69 20.7 21.6 23.0 24.8 28.8 33.5 36.6 38.5 41.1
14  70-79 20.1 21.6 22.7 24.7 28.6 33.4 36.3 38.7 42.1
15    80+ 19.3 20.7 22.0 23.1 26.3 29.7 31.6 32.5 35.2

Application Hosting and References

The application is hosted on the Shiny website. Click here to view.

Supporting documentation for the application is also hosted on the Shiny website. Click here to view.

Application R code (ui.R and server.R) is posted on GitHib. Click here to view. Or go to https://github.com/danielbret/datasciencecoursera/tree/master/Course_Project/shinycode

Information and data pertaining to BMI were obtained from Wikipedia. Click here to view.