data(kfm, package = "ISwR")
require(sjlabelled, quietly = TRUE)
kfm <- kfm |>
var_labels(
dl.milk = "Breast-milk intake (dl/day)",
sex = "Sex",
weight = "Child weight (kg)",
ml.suppl = "Milk substitute (ml/day)",
mat.weight = "Maternal weight (kg)",
mat.height = "Maternal height (cm)"
)
kfm |>
gen_bst_df(dl.milk ~ sex)
data(birthwt, package = "MASS")
require(dplyr, quietly = TRUE)
birthwt <- mutate(birthwt,
smoke = factor(smoke, labels = c("Non-smoker", "Smoker")),
Race = factor(race > 1, labels = c("White", "Non-white"))
)
birthwt <- birthwt |>
var_labels(
bwt = "Birth weight (g)",
smoke = "Smoking status"
)
gen_bst_df(bwt ~ smoke | Race, data = birthwt)
Run the code above in your browser using DataLab