Reduce the bogosity of ministat's % difference calculations.
authorcperciva <cperciva@FreeBSD.org>
Sat, 5 Nov 2016 06:33:39 +0000 (06:33 +0000)
committercperciva <cperciva@FreeBSD.org>
Sat, 5 Nov 2016 06:33:39 +0000 (06:33 +0000)
commitf2fa1b708ab8c4de1576c7af013cba1923d32cea
treeecbd0e75459d9d58df2f03595ddbf5f4cc912d79
parent0f62b80bb28b27b93df83d69279eb6a6e7201d3d
Reduce the bogosity of ministat's % difference calculations.

The previous calculation used an approximation which was only valid in
cases where the means being compared were similar; this resulted in very
odd claims being made, e.g. that 0 +/- 0 is a difference of -100% +/- 1%
from 100 +/- 1.

The new calculation scales sample standard deviations by the means, and
yields approximately correct percentage difference bounds providing that
the reference population is bounded away from zero.  (In the case where
the values being compared are not sufficiently bounded away from zero,
the distribution of ratios becomes much harder to calculate, and is not
likely to be useful anyway.)

Note that when ministat is used for its intended purpose of determining
whether two samples are statistically different, this change is unlikely
to have any noticeable effect; in such cases the means will be similar
enough that the correction applied here will be minimal.
usr.bin/ministat/ministat.c