We all know that the R software has 9 ways of calculating quantiles through the function quantile(x,probs,type=1,2,3,4...).
I'm looking for a nice simple and stupid special example for my students where each type of quantile calculation method would return a different value with a sample size of minimum 20 values.
The best would be an example where they all return a different value for the quantile 0.5 (ie the median).
I tried to simulate some random vectors but i wasn't able to get a different values for all of them for a given quantile at the same time.
Thanks for your help.
CodePudding user response:
matplot(quantile.vec(1:4, seq(0, 1, 0.05), 4:9), type = "p", pch = 0:6, col = 1:6, xlab = "prob", ylab = "quantile")
legend("topleft", legend = 4:9, pch = 0:6, col = 1:6)
The difference between types 8 and 9 is small.