# Calculating 95% confidence interval for the group means from one-way ANOVAs

Between Subjects ANOVA

A 95% Confidence interval for a group mean is given by

group mean $$\pm$$ t(df[MS(subjects)], 0.025) Sqrt{(MS(subjects)/ng)}

for ng subjects in group g, degrees of freedom, df, and t distribution statistic, t.

Baguley (2012a) suggests alternative approaches which give more informative confidence intervals for group means in between subjects ANOVA (see here which also includes R syntax to produce these confidence intervals as described in Baguley (2012a)). See also the plots for between subject group means at the start of the CBSU Post-Hoc Graduate Statistics talk.

Repeated Measures ANOVA

The most commonly used method for specifying a 95% CI for a group mean from a repeated measures design was proposed by Loftus and Masson (1994). A pdf copy of their paper is here.

A 95% Confidence interval for a group mean is given by

group mean $$\pm$$ t(n,0.025) $$\sqrt{\mbox{MS(W x subjects)/n}}$$

for a within subject factor, W, with n subjects in each group.

The Mean square Error can be used to compute confidence intervals for simple effects to work out the meaning of a significant interaction.

If the group variances are heterogeneous Loftus and Masson advocate using the MS(W x subjects) and its degree of freedom adjusted by the Greenhouse-Geisser correction. This correction is outputted by SPSS in its repeated measures procedure. Applications of both corrected and uncorrected calculation of these confidence intervals for group means from repeated measures ANOVA in SPSS as suggested by Loftus and Masson are illustrated here.

Baguley (2012b) amongst others suggests alternative approaches which give more informative confidence intervals for group means in repeated measures (see here.) These include confidence intervals incorporating the standard error of the *difference* between a pair of means and normalising by subject to give an approach that does not rely on sphericity assumptions (Cousineau (2005) and Morey (2008)). His preferred method uses the normalised subject score

group mean $$\pm$$ t(n-1,1-0.025) Sqrt[(2J)/(4(J-1)) \hat{sigma(g)]

where \hat{sigma(g)} is the standard error of the normalised score = score in group g - subject mean + overall group mean and J is the number of groups.

The former suggests a 95% confidence interval for each group mean as

group mean $$\pm$$ t(ng-1,0.025) (Sqrt{2}/2) (sd(g))/({Sqrt{ng}})

where ng observations are in group g with g-th group standard deviation of sd(g).

The Sqrt{2}/2 = 1/Sqrt{2} multiplier ensures that statistical significance in any pair of group means is suggested by the non-overlapping of confidence intervals associated with a pair of group means (ignoring multiple testing).

Note, however, for large n (>20) $$t_text{ng-1,0.025}$$ is approximately equal to 2 so that plotting

group mean $$\pm$$ Sqrt{2} se(group mean) = group mean $$\pm$$ 1.4 se(group mean)

will equivalently give confidence intervals such that non-overlap suggests a difference between a pair of group means.

Kevin Bird has also written a software package called PSY and some SPSS macros available from here for constructing confidence intervals for contrasts of means from more complex ANOVAs involving two or more factors (either or both between or within factors) using methods outlined in Bird (2004) and Boik (1993). The /EMMEANS subcommand can also test simple effects and produce output for confidence intervals (see here).

References

Baguley, T. (2012a, in press). Serious stats: A guide to advanced statistics for the behavioral sciences. Basingstoke: Palgrave. Available in paperback and due to be published on 8th June 2012.

Baguley, T. (2012b). Calculating and graphing within-subject confidence intervals for ANOVA. *Behavior Research Methods* **44** 158-175.

Bird, K.D. (2004). Analysis of variance via confidence intervals. London: Sage Publications.

Boik, R.J. (1993). The analysis of two-factor interactions in fixed effects linear models. *Journal of Educational Statistics* **18** 1-40.

Cousineau, D. (2005). Confidence intervals in within-subject designs: a simpler solution to Loftus and Masson's method. *Tutorials in Quantitative Methods for Psychology* **1(1)** 42-45. Illustrates using SPSS.

Loftus, G.R. and Masson, M.E.J. (1994). Using confidence intervals in within-subject designs. *Psychonomic Bulletin* **1(4)** 476-490.

Morey, R.D. (2008). Confidence Intervals from Normalized Data: A correction to Cousineau (2005). *Tutorials in Quantitative Methods for Psychology* **4** 61-64. This paper suggests multiplying Cousineau's CIs by Sqrt[(J-1)/J] for J groups.