Simulate obesity status
Usage
simulate_obesity(
x,
obes_prev = "OBESITY_CrudePrev",
obes_sd = "OBESITY_SD",
obes_label = "FIPS",
n = 1000
)
Examples
# Input has default column names
df <- data.frame(OBESITY_CrudePrev = c(20, 50, 80),
OBESITY_SD = c(5, 5, 5),
FIPS = letters[1:3])
simulate_obesity(df, n = 5)
#> $a
#> [1] "Normal" "Normal" "Normal" "Normal" "Normal"
#>
#> $b
#> [1] "Normal" "Obese" "Normal" "Normal" "Normal"
#>
#> $c
#> [1] "Obese" "Obese" "Obese" "Obese" "Obese"
#>
# Input has custom column names
df <- data.frame(prev = c(20, 50, 80),
sd = c(5, 5, 5),
label = letters[1:3])
simulate_obesity(df,
obes_prev = "prev",
obes_sd = "sd",
obes_label = "label",
n = 5)
#> $a
#> [1] "Normal" "Obese" "Normal" "Normal" "Normal"
#>
#> $b
#> [1] "Normal" "Obese" "Obese" "Normal" "Obese"
#>
#> $c
#> [1] "Obese" "Obese" "Obese" "Obese" "Obese"
#>