Following the general formula for a confidence interval, the formula for a confidence interval on a linear combination of means is:

L ± t s

where L is the linear combination of the sample means, t depends on the level of confidence desired and the degrees of freedom, and S

The formula for S

which is the same as the formula for σ

where is the sample variance of the ith group and k is the number of groups. This formula assumes homogeneity of variance and that the k sample sizes are equal.