# use corrected or uncorrected variance when calculating skewness & kurtosis?

In several online sources, e.g. NIST engineering statistics handbook I have read that for the calculation of skewness & kurtosis I should use N in the denominator instead of (N-1) when calculating the variance.

However the programming language I work with (IDL) has (N-1) there (see moment function of IDL). This seems copied from Numerical Recipes, pp 722-724.

Which is correct? Just to be sure before I submit an error report.

Wouldn't the unbiased estimators be even more complicated?

• Do you really need an unbiased estimate? Or are you computing these measures for some other purpose, such as describing data or testing the shape of their distribution?
– whuber
Jul 25, 2016 at 12:57
• I don't need an unbiased estimate. But when submitting an error report it would be useful to have a confirmation, that what IDL does is neither correct for the biased nor the unbiased form. Jul 25, 2016 at 13:14
• I don't understand what you mean by "neither correct." In what sense could one evaluate "correctness" in the absence of a clearly stated purpose?
– whuber
Jul 25, 2016 at 13:17
• While something being correct depends on the context, some things are wrong in all or at least most practical purposes. A function delivered with a programming language should deliver meaningful results for most practical purposes. - Shouldn't there be a definition for biased and for unbiased estimates? makes 2 correct solutions, all else false (ok, +-3 in case of Kurtosis, makes 4 correct solutions) Jul 25, 2016 at 13:56
• Actually, there are far more "correct" solutions than that. The problem is that bias often is just a small part of the potential error in any estimator. Thus, one cannot maintain that "correct" implies "unbiased." This consideration opens the field to infinitely many possible kurtosis estimators. You're doing well to investigate and understand what your programming language does, but is there any need to go further? Either use what it offers, apply an adjustment to its results, or code your own if you need something different.
– whuber
Jul 25, 2016 at 14:35

Kurtosis is equal to $E(Z^4)$, where $Z = (X-\mu)/\sigma$. (Subtract 3 if you want, it doesn't matter).
If you apply this formula to the empirical probability distribution of the data, where you put $1/n$ probability on each distinct observation $x_i$ (and collate probabilities for the repeats), then you get the following estimate of kurtosis:
$\hat{k} = (1/n) \sum_{i=1}^n \{(x_i - \bar{x})/\hat{\sigma}\}^4$, where $\hat{\sigma}^2 = (1/n) \sum_{i=1}^n (x_i - \bar{x})^2$.
This logic suggests using the $n$ formula for variance rather than the $n-1$ formula.