Purpose Computes quantiles from data in a matrix, given specified probabilities.
Format y = quantile(x,e)
Input
Output
Remarks quantile will not succeed if N*minc(e) is less than 1, or N*maxc(e)
is greater than N - 1. In other words, to produce a quantile for a level of
.001, the input matrix must have more than 1000 rows.
Example rndseed 345567;
x = rndn(1000,4); /* data */
e = { .025, .5, .975 }; /* quantile levels */
y = quantile(x,e);
print "medians";
print y[2,.];
print;
print "95 percentiles";
print y[1,.];
print y[3,.];
produces:
medians
-0.0020 -0.0408 -0.0380 -0.0247
95 percentiles
-1.8677 -1.9894 -2.1474 -1.8747
1.9687 2.0899 1.8576 2.0545
x NxK matrix of data.
e Lx1 vector, quantile levels or probabilities.
y LxK matrix, quantiles.