org.jfree.data.statistics
Class BoxAndWhiskerCalculator
java.lang.Object
org.jfree.data.statistics.BoxAndWhiskerCalculator
A utility class that calculates the mean, median, quartiles Q1 and Q3, plus
a list of outlier values...all from an arbitrary list of
Number
objects.
calculateBoxAndWhiskerStatistics
public static BoxAndWhiskerItem calculateBoxAndWhiskerStatistics(List values)
Calculates the statistics required for a
BoxAndWhiskerItem
.
Any items in the list that are not instances of the
Number
class are ignored. Likewise,
null
values are ignored.
values
- a list of numbers (a null
list is not
permitted).
- Box-and-whisker statistics.
calculateQ1
public static double calculateQ1(List values)
Calculates the first quartile for a list of numbers in ascending order.
values
- the numbers in ascending order.
calculateQ3
public static double calculateQ3(List values)
Calculates the third quartile for a list of numbers in ascending order.
values
- the list of values.