# \donttest{
# Using simulated data
set.seed(1111)
n <- 1000
x1 <- runif(n,0,3)
x2 <- rbinom(n,1,0.5)
u <- runif(n)
y <- 1*qexp(u) + (2 + 3*u)*x1 + 5*x2
# This model is likely to suffer from quantile crossing
m <- iqr(y ~ x1 + x2, formula.p = ~ slp(p,7))
diagnose.qc(m)
# Repeat estimation with remove.qc = TRUE
m2 <- iqr(y ~ x1 + x2, formula.p = ~ slp(p,7), remove.qc = TRUE)
diagnose.qc(m2)
# Use remove.qc = qc.control(trace = TRUE) to see what is going on!
# You can set a larger 'maxTry', if the algorithm failed to remove
# quantile crossing entirely, or a smaller one, if you want to stop
# the procedure before it becomes 'too expensive' in terms of loss.
# }
Run the code above in your browser using DataLab