if (FALSE) { # rlang::is_installed("cobalt")
library("cobalt")
data("lalonde", package = "cobalt")
# Generating targets; means by default
targets <- process_targets(~ age + race + married +
nodegree + re74,
data = lalonde)
# Notice race is split into three values
targets
# Generating targets; NA by default
targets <- process_targets(~ age + race + married +
nodegree + re74,
data = lalonde,
targets = NA)
targets
# Can also supply just a dataset
covs <- lalonde |>
subset(select = c(age, race, married,
nodegree, re74))
targets <- process_targets(covs)
targets
}
Run the code above in your browser using DataLab