Home / Statistical Tools / Analysis Tools / Summarystats / Math Details
Math Details¶
This page gives the exact formulas Quantum XL uses to compute descriptive statistics. Each equation lists what it computes and where it appears in the output. (Elementary outputs — count, sum, minimum, maximum, range, mode — are omitted.)
Notation¶
| Term | Description |
|---|---|
| \(x_{(1)} \le \dots \le x_{(n)}\) | the data values sorted ascending |
| \(x_i, w_i\) | value and its frequency weight (\(w_i = 1\) when no frequency column is used) |
| \(n\) | effective sample size, \(n = \sum_i w_i\) |
| \(\bar{x}\) | weighted mean, \(\bar{x} = \dfrac{\sum_i w_i x_i}{\sum_i w_i}\) |
| \(M_k\) | weighted central moment sum, \(M_k = \sum_i w_i (x_i - \bar{x})^k\) |
| \(\Phi\) | standard normal cumulative distribution function |
Variance and standard deviation¶
The sample forms use the \(n-1\) (Bessel) denominator; both population and sample versions are reported.
Skewness (Fisher–Pearson standardized, \(G_1\))¶
Requires \(n > 2\); undefined for constant data. This is the bias-adjusted (\(G_1\)) form used by most statistical packages.
Kurtosis (excess, \(G_2\))¶
Excess kurtosis (a normal distribution gives \(0\)). Requires \(n > 3\).
Quantiles, quartiles, and percentiles¶
All percentiles (including the median and quartiles) use the Hyndman–Fan Type 8 estimator:
with the index clamped to \([1, n]\). Median \(= Q(0.5)\), \(Q_1 = Q(0.25)\), \(Q_3 = Q(0.75)\). Frequency-weighted data applies the same rank \(h = (n + \tfrac{1}{3})p + \tfrac{1}{3}\) to a virtual sample of size \(n = \sum_i w_i\), interpolating by cumulative frequency.
Confidence intervals¶
For the mean (t-interval) and the standard deviation (chi-square interval):
where \(\alpha = 1 - \text{(confidence level)}\). See Confidence Interval → Math Details for full detail.
Normality tests¶
Anderson–Darling¶
Quantum XL evaluates a frequency-weighted equivalent of this sum, then applies Stephens' finite-sample correction \(A^{*2} = A^2\left(1 + \tfrac{0.75}{n} + \tfrac{2.25}{n^2}\right)\) and obtains the p-value from Stephens' approximation.
Shapiro–Wilk¶
The constants \(a_i\) are derived from the expected values and covariances of standard-normal order statistics; Quantum XL computes them using Royston's Algorithm AS R94, and obtains the p-value from Royston's transformation.
Kolmogorov–Smirnov (with Lilliefors correction)¶
where \(F_n\) is the empirical (cumulative-frequency) CDF and \(z_{(i)}\) standardizes with the sample mean and standard deviation. Because the parameters are estimated from the data, the p-value uses the Lilliefors correction.
See Also¶
References¶
- Snedecor, G. W., & Cochran, W. G. (1989). Statistical Methods (8th ed.). Ames, IA: Iowa State University Press.
- Joanes, D. N., & Gill, C. A. (1998). Comparing measures of sample skewness and kurtosis. Journal of the Royal Statistical Society: Series D (The Statistician), 47(1), 183–189.
- Hyndman, R. J., & Fan, Y. (1996). Sample quantiles in statistical packages. The American Statistician, 50(4), 361–365.
- Anderson, T. W., & Darling, D. A. (1952). Asymptotic theory of certain goodness-of-fit criteria based on stochastic processes. Annals of Mathematical Statistics, 23(2), 193–212.
- Stephens, M. A. (1974). EDF statistics for goodness of fit and some comparisons. Journal of the American Statistical Association, 69(347), 730–737.
- D'Agostino, R. B., & Stephens, M. A. (Eds.). (1986). Goodness-of-Fit Techniques. New York: Marcel Dekker.
- Shapiro, S. S., & Wilk, M. B. (1965). An analysis of variance test for normality (complete samples). Biometrika, 52(3/4), 591–611.
- Royston, P. (1995). Remark AS R94: A remark on Algorithm AS 181: The W test for normality. Journal of the Royal Statistical Society: Series C (Applied Statistics), 44(4), 547–551.
- Lilliefors, H. W. (1967). On the Kolmogorov–Smirnov test for normality with mean and variance unknown. Journal of the American Statistical Association, 62(318), 399–402.
- Massey, F. J. (1951). The Kolmogorov–Smirnov test for goodness of fit. Journal of the American Statistical Association, 46(253), 68–78.