05 Jan 2017

Slide 2: Introduction

The Body mass index (BMI) is a measure of body fat based on height and weight that applies to adult men and women.

Regarding the BMI measure, the World Health Organization (WHO) proposes the following classification:

  1. BMI <18.5 : Underweight
  2. BMI [18.5-24.9] : Normal weight
  3. BMI [25-29.9] : Overweight
  4. BMI >=30 : Obesity

Slide 3: Source

Slide 4: Output

Sample output provided below based on dummy data. For more combinations, please use the app on https://sachinvraje.shinyapps.io/SachinApp/

df <- data.frame(weight = c(65, 70, 75, 65, 70), height = c(1.5, 1.6, 1.5, 1.6, 1.7))
bmi <- df[,1] / df[,2]^2
result <- ifelse(bmi<18.5,"underweight",ifelse(bmi<25,"normal weight",ifelse(bmi<30,"overweight","obesity")))
df <- cbind(df, bmi, result)
df
##   weight height      bmi        result
## 1     65    1.5 28.88889    overweight
## 2     70    1.6 27.34375    overweight
## 3     75    1.5 33.33333       obesity
## 4     65    1.6 25.39062    overweight
## 5     70    1.7 24.22145 normal weight

Slide 5: Thanks