Hello there,
recently received a customer query regarding the "Which formula does JMP use to calculate the number of bins for the histogram?"
Searched the JMP help menu and community, seems there is no information regarding the rules
while from the internet I did found a few rules e.g. Sturge’s Rule,
K = 1 + 3. 322 logN
where:
K = number of class intervals (bins).
N = number of observations in the set.
log = logarithm of the number.
Wondering anyone knows which rules that JMP is using? any supporting document? thank you
Pin
This Tech Support track from 2016 says that the binning is
Binning is based on a cube-root algorithm from Terrell & Scott with adjustments based on the value ranges to make the edges correspond to round numbers. The adjustments have changed in some versions of JMP and may change in the future.
Terrell, G. R. and Scott, D. W. (1985) "Oversmoothed Nonparametric Density Estimates," Journal of the American Statistical Association, 80, 209-214.
I assume that's still largely true. Maybe @laural_jmp can confirm.
I checked with Paul Vezetti (@paul_vezzetti) for more insight as the Display Team supports the histogram code. Here is Paul's response:
There is no one, simple formula for the number of bars on the histogram. The bars generally match the minor ticks on the axis. Although, that might not always be the case if the ticks are too close together. There is a lot of logic to come up with a reasonable set of bars.
For the most general linear case, the axis will start with a number of bins based on the cubed root of 2 times the number of observations (constrained between 100 and 1000 obs) and the constraining the resultant count to between 6 and 20. There is then a lot of logic within the axis to come up with good major and minor ticks assuming that the user hasn’t specified the tick intervals.
So I don’t think there is an easy answer to this question other than it’s going to bin with the axis and the user can adjust the axis setting to influence the binning.
Xan (@XanGregg) also chimed in with the following:
Sounds right. Fyi, the cube root formula is attributed to:
Terrell & Scott: Oversmooth nonparametric density estimates. JASA, 80:209–214, 1985.
It seems to work well as a starting point and is simpler to compute than more refined rules that rely on IQR or other stats.
I hope all this helps some.
Laura
Thanks, @laural_jmp, @paul_vezzetti, and @XanGregg.
@PIN, make sure our customer knows there are multiple ways to adjust the binning.