Home > database >  Dummy example of the 9 types of Quantiles
Dummy example of the 9 types of Quantiles

Time:09-14

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:

Take a look at the enter image description here

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)

enter image description here

The difference between types 8 and 9 is small.

  • Related