Hello @bmcohen36,
@bmcohen36 wrote:
... using 4 data points: -53.8, -41.2, -27.0, and -26.5. I would have expected the box would extend from the 2nd value to the 3rd value (...) With only 4 values, I would expect the median would divide the box evenly.
In addition to the five quantile definitions offered by SAS there are (at least) four more available in other common statistical software packages. Of course, they can be implemented in SAS by programming: see Rick Wicklin's blog article "Sample quantiles: A comparison of 9 definitions" and the accompanying PROC IML code.
However, none of those nine definitions matches your expectations, even though defining the first, second and third quartile of your example data as x 0.25 =-41.2, x 0.5 =(-41.2-27.0)/2 and x 0.75 =-27.0, respectively, would satisfy the criterion
at least 100p percent of the sample values are less than or equal to x p and
at least 100(1-p) percent of the sample values are greater than or equal to x p
which is sometimes used to characterize sample p-quantiles x p (0<p<1). Note that, by this characterization, all values in the interval [-53.8, -41.2] qualify as a first quartile and similarly all values in [-41.2, -27.0] as a median and all values in [-27.0, -26.5] as a third quartile. Hence, your definition would pick the upper interval endpoint for the first quartile, the midpoint of the interval for the median and the lower interval endpoint for the third quartile to make the definition unique. The default quantile definition in SAS, however, consistently uses the interval midpoints in these cases.
... View more