Behrouz Eslami
25.10.2015
Ideal Weight Predictor is a simple app which helps you estimate your ideal weight. Just give it your height and gender, and it calculates your ideal weight according to four popular formulas:
“Reaching and maintaining a healthy weight is important for overall health and can help you prevent and control many diseases and conditions.”
“If you are overweight or obese, you are at higher risk of developing serious health problems, including heart disease, high blood pressure, type 2 diabetes, gallstones, breathing problems, and certain cancers.”
“That is why maintaining a healthy weight is so important: It helps you lower your risk for developing these problems, helps you feel good about yourself, and gives you more energy to enjoy life” (quoted from NIH webpage).
It is very easy:
Note: the formulas are only valid for adults, age 18 or older.
Here is an example of how the app works with the Robinson Formula:
height <- 70 # in inches
gender <- 1 # {1 = Man, 2 = Woman}
delta_h <- 0
if (height > 60) delta_h <- height - 60
if(gender == 1){cat("Your ideal weight is", (52 + 1.9*delta_h), "Kg")
}else {cat("Your ideal weight is", (49 + 1.7*delta_h), "Kg")}
Your ideal weight is 71 Kg