BMI(Body Mass Index) Calculator

Developing Data Products Course Project

David Shao

BMI Introduction

  • an app to predict BMI (Body Mass Index).
  • BMI is an attempt to quantify the amount of tissue mass (muscle, fat, and bone) in an individual
  • BMI categorizes that person as underweight normal weight, overweight, or obese based on that value
  • App Name: BMI Calculator
  • Language & Packages: R, Shiny, Knitr
  • IDE: Rstudio
  • Server: shinnyapps.io

BMI Calculation

  • Input: Height and Weight(Mass)
  • Output: BMI(Body Mass Index)
  • Formular: \[BMI = \frac{mass_{kg}}{(height_m)^2} = \frac{mass_{lb}}{(height_{in})^2 }\]

BMI Weight Catorgries

BMI Range Category
<=18.5 Underweight
18.5 - 24.9 Normal Weight
25.0 - 29.9 Overweight
>= 30.0 Obesity

How to Use BMI APP?

  • Website: https://davidhhshao.shinyapps.io/BMICalculator
  • Steps:
    1. Select the unit for weight and height inputs on the left panel. There are two choices: Standard and Metric. For Standard, Height uses feet and inch, and Weight uses pounds; for Metric, Height uses centimeters, and Weight uses kilograms
    2. Input the numerical values of Height and Weight fields
    3. Click Go! button (It is not necessay because it will update the output automatically). Then you can get your BMI value and Weight Category on the right panel.

Simulation of BMI APP Calcualtion Process

  • Input: \(Height = 180cm\) and \(Weight = 90 kilograms\)
Category <- c("Underweight", "Normal Weight", "Overweight", "Obesity")
get_weight_catory <- function(height, weight){ 
 bmi <- round( weight/ ((height/100) * (height/100)), digit = 1) 
 if(bmi< 18.5){ category<-  Category[1]} 
 else if (bmi>=18.5 & bmi<= 24.9){category<-Category[2]}
 else if( bmi >= 25 & bmi <= 29.9){category<-Category[3]} else{category<-Category[4]}
 return (c( "BMI" =  bmi, " Weight Catorgary" = category) )
}
  • Output: BMI & Weight Catorgary
get_weight_catory(180, 90)
##               BMI:   Weight Catorgary : 
##              "27.8"        "Overweight"