# NOT RUN {
set.seed(23131)
N <- 1000
K <- 20
toy_data <- data.frame(id = 1:N,
score = rnorm(N, sd = 2),
type = rep(paste0("inc", 1:20), each = N/K),
wt = 1)
# perc_diff(toy_data, type, score)
# type is not an ordered factor!
toy_data$type <- factor(toy_data$type, levels = unique(toy_data$type), ordered = TRUE)
perc_dist(toy_data, type, score)
# }
Run the code above in your browser using DataLab