Description Usage Arguments Examples
Calculate the bmi and classify it into underweight (0), healthy weight (1),overweight (2) and obese (3), based on CDC's BMI reference tables for age and sex.
1 2 |
data |
A data frame. The default is NULL. When the data frame is provided, use the corresponding variables for the parameters sex, age, wt.kg and ht.m. |
sex |
Character. "F", "M" |
age |
Numeric. In months or years |
wt.kg |
Numeric. Weight in kg |
ht.m |
Numeric. Height in meters |
age.unit |
Character. The age unit ("month" or "year") |
bind |
Logical. TRUE or FALSE. Add the two new variables to the data provided. They are the calculated BMI (bmi) and the BMI categories (bmicat). The variable "bmicat" is coded as numeric from 0,1,2 or 3 for respectively "underweight", "healthy weight", "overweight" and "obesity" |
1 2 3 4 5 6 7 8 9 10 11 | No dataset provided
bmicat(data = NULL,sex = "F",age = 18,wt.kg = 70 ,ht.m = 1.75, age.unit="year",bind = F)
Create and provide data frame df first:
df <- data.frame(sex = c("F","M", "F"), age = c(18,15,NA), weight = c(70,50, 55), height = c(1.75, 1.60, 1.65))
Use the new data frame, df with the function bmicat:
bmicat(data = df,sex = sex,age = age,wt.kg = weight ,ht.m = height, age.unit="year",bind = T)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.