data("rl_reg1")
## random prototyping
rep_dat_random <- represent(rl_reg1, identity.rl_reg1, "proto_random", id = FALSE, parallel = FALSE)
## empirical KL divergence
cat_vars <- c("sex")
num_vars <- c("income", "bp")
emp_kl_div(rl_reg1[unique(identity.rl_reg1), c(cat_vars, num_vars)],
rep_dat_random[, c(cat_vars, num_vars)],
cat_vars, num_vars)
Run the code above in your browser using DataLab