DDP-Course-Project

Body Mass Index Calculator

Barbara M
9th April 2017

Background about BMI

For more details on BMI please visit https://en.wikipedia.org/wiki/Body_mass_index.

Inputs needed for BMI calculation are:

  • weight in kilograms
  • height in metres

The output is BMI in kg per metres squared

Calculation of BMI with default App inputs

weight <- 70
height <- 1.7
BMI1 <- weight/height^2
BMI1
[1] 24.22145

BMI less than 18.5 = Underweight

BMI between 18.5 and 24 = healthy weight

BMI more than 25 = overweight

Slide With random sample of height vs weight

weight <- rnorm(50, mean = 70, sd = 30)
height <- rnorm(50, mean = 1.7, sd = 0.5)
plot(height~weight)

plot of chunk unnamed-chunk-2

Slide With BMIs calculated for the random sample of height vs weight

BMI2 <- weight/height^2
hist(BMI2)

plot of chunk unnamed-chunk-3