Doane’s Rule
A bin-count rule extending Sturges’ formula with a correction determined by sample skewness.
Doane's rule modifies the Sturges count by adding information about asymmetry. Two samples of equal size need not have similarly shaped distributions, and their histograms need not have the same resolution.
k ≈ 1 + log2(n) + log2(1 + |g1|/σg)
σg = √[6(n−2)/((n+1)(n+3))]g1 is sample skewness defined through the standardized third central moment. σg is its approximate standard error within this rule. At zero skewness the additional logarithmic term vanishes, recovering Sturges. Larger absolute skewness may increase the proposed number of bins.
Reading a numerical result
For n=100 and g1=1.2, σg≈0.238. Sturges gives about 7.64 bins, while the added term log2(1+1.2/0.238) is about 2.60. Doane thus suggests approximately 10.24 bins before rounding. The eventual integer depends on the histogram implementation.
Validity conditions
The formula needs enough observations and variation for a meaningful skewness calculation. Samples with n≤2, constant values or unstable third-moment estimates cannot simply be passed through it. Corrected and uncorrected definitions of sample skewness may also give different counts across software packages.
Freedman–Diaconis and Scott estimate widths, whereas Doane estimates bin count. That distinction matters when converting estimates into actual bin edges.