liuyubobobo
2015-06-21
This app try to predict your normal weight and height according your given height an weight.
Furthe more, you will get your BMI (Body Mass Index) and see your BMI categoy.
to get started, input your weight and height seperately and click Submit.
We use women data set in R.
library(datasets)
data(women)
Weight Prediction Process is as follows, we use lm function to model our data and use predict to calcualte the result
predictWeight <- function( yourHeight ){
fit <- lm( weight~height , data = women )
yourData <- data.frame(height=yourHeight)
predict( fit , newdata = yourData )
}
predictWeight( 70 ) #Suppose your height is 70 inches
1
153.9833
The Height Prediction Process is quite similar as Weight Prediction
The BMI is calculated by following function
calcBMI <- function( height , weight ) (weight*0.4535)/(height*0.0254)^2
Suppose your height is 70 inches, and your weight is 146 pounds, Then the following invokation calculate the BMI.
calcBMI( 70 , 146 )
[1] 20.94434
According to the computed BMI value, we can choose the category, the rule is as follows:
This app can be viewd on: https://liuyubobobo.shinyapps.io/bmi-calculator
The data set used in this app appears to have been taken from the American Society of Actuaries Build and Blood Pressure Study for some (unknown to us) earlier year.
This data set gives the average heights and weights for American women aged from 30 to 39.So it may be not accuracy for men or women beyong that age range.
Source, The World Almanac and Book of Facts, 1975.
References, McNeil, D. R. (1977) Interactive Data Analysis. Wiley.