# NOT RUN {
library(GD)
x <- sim[,4:6]
x.disc <- apply(x, 2, FUN = function(u) disc(u, 4, "quantile"))
xh <- do.call(cbind, lapply(1:ncol(x), function(u)
data.frame(cut(x[, u], x.disc[[u]]$itv, include.lowest = TRUE))))
names(xh) <- names(x)
qidsa.all <- qs2all(y = sim$y, x = x, xh = xh,
location = sim[, c("lo","la")])
# }
Run the code above in your browser using DataLab