# What is the standard error of the within-subject standard deviation, sw?

The question came from Detlef Axmann.

This note explains the formulae for the standard error and 95% confidence interval for the estimated within subject standard deviation, sw. (This is described in a Statistics Note in the BMJ.) We assume that the within-subject standard deviation is the same throughout the range, in order to estimate it. We also assume that within the subject the distribution of observations is Normal, to estimate the standard error.

The within-subject standard deviation is found by dividing a sum of squares by its degrees of freedom, to get the estimate of variance. The square root of this is the estimate of the standard deviation.

Assume that the observations themselves follow a Normal distribution, and are identically distributed about the subject mean, within-subject SD = sigmaw. The within-subject variance is estimated by sw2 = the sum of squares about subject mean divided by the degrees of freedom, d.

The distribution followed by the sum of squares divided by its degrees of freedom is that of a Chi-squared random variable with d degrees of freedom, multiplied by sigmaw2.

The square root of a Chi-squared variable has an approximately Normal distribution, with mean approximately root(n - 1/2) and variance approximately 1/2, provided d is reasonably large.

The distribution followed by the estimated within-subject standard deviation, sw, is the distribution followed by the square root of sigmaw2/d times chi-squared. If we take the square root, this is sigmaw/root(d) times root chi-squared. This is a constant times a chi-squared random variable. Hence its variance is the constant squared times the variance of root chi-squared. Hence the variance of the sample within-subject standard deviation is sigmaw2/d times 1/2, giving sigmaw2/(2d). Hence the standard error of the within-subject standard deviation is the square root of this, sigmaw/root(2d). To estimate this for an estimate, we replace the population value sigmaw by the sample value sw.

If we have n subjects with m observations per subject, we have n(m-1) degrees of freedom. Hence the standard error of sw will be estimated by sw/root(2n(m-1)).

If the sample is large, the 95% confidence limits for sw are the observed value minus and plus 1.96 times this standard error. If the sample is small, we should replace 1.96 by the corresponding value of the t Distribution with n(m-1) degrees of freedom. Large here means more than 30 degrees of freedom. Note that the assumption of Normal distribution is required whatever the sample size, because the formula for the standard error depends on it. Also, this formula will break down at small degrees of freedom, because the approximation of root Chi-squared to a Normal distribution will not be so good.

There is an alternative way to find a confidence interval which does not use a standard error. For a Normal population, a sample variance follows a Chi-squared distribution multiplied by the the population variance and divided by the degrees of freedom. Find the 2.5% and 97.5% points of Chi-squared with the d.f. for the estimate. Multiply these by the sample variance and divide by the d.f., d. This gives the 95% CI for the variance. Now take the square roots. This gives the CI for the standard deviation. This is another large-sample approximation.