# Single-Factor Repeated

Measures ANOVA in 4

Steps in Excel

This is one of the following four articles on Repeated-Measures ANOVA

Single-Factor Repeated-Measures ANOVA in 4 Steps in Excel

Sphericity Testing For Repeated-Measures ANOVA in 9 Steps in Excel

Effect Size For Repeated-Measures ANOVA in Excel

Friedman Testing For Repeated-Measures ANOVA in 3 Steps in Excel

## Overview

Repeated-measures ANOVA is very similar to single-factor ANOVA except that the sample groups consists of measures taken on the same group of subjects at different time periods or under different conditions. Single-factor ANOVA requires that data sample points in any sample group be completely independent of data points of any other sample points. Sample groups in a repeated-measure ANOVA test are related to each other because each sample group consists of measures taken on the same group of subjects as all other sample groups.

An easy way conceptualize repeated-measure ANOVA is to view it as an extension of the paired T-test. The most common use of the paired T-test is to determine whether a significant difference exists between before and after-measurements taken on a group of subjects. If an additional measurement was taken on each subject at an intermediate time period, three sample groups (before, middle, after) of data measurements taken on the same subjects would be produced.

The main uses of repeated-measure ANOVA are the following:

1) Taking the same measurement on subjects of the same group at different time periods to determine if there is any significant difference in that measure at different points in time.

2) Taking the same measurement on subjects of the same group in different conditions to determine if there is a significant difference in that measure in different conditions. Conditions are sometimes referred to as *treatments*.

Repeated-measures ANOVA removes most or all of the variance between the subjects leaving only the between-group variance and error (unexplained) variance. To illustrate that point, imagine that repeated-measures ANOVA was performed on twenty subjects who were undergoing a training program. All of the subjects took the same test at three points in time: at the beginning of the training, in the middle of the training, and at the end of the training. The objective of the repeated-measures ANOVA test is to determine whether the average test score had changed at any point in the training.

ANOVA is an omnibus test, meaning that it only indicates that one sample group comes from a different population than the other sample groups. ANOVA by itself does not indicate which specific sample groups are different. *Post hoc* testing is used to determine where sample differences are significant.

The differences in abilities of the individual subjects will likely generate a significant amount of variation in the test scores for each of the three sample groups. Each sample group contains the test scores of all tests taken at one of the three points in time. Variation resulting from ability differences of each individual needs to be removed in order to determine whether there are any real differences in average test scores in any of the three time periods. Repeated-measures ANOVA removes variation attributed to the difference among subjects leaving only the between-group variance and error (unexplained) variance.

SS_{within} = Variation within groups

SS_{error} = Unexplained variation

SS_{subjects} = Variation attributed to individual differences between test subjects

__ Single-Factor ANOVA__ (requires all data points in a sample groups to be totally independent of each other)

SS_{error} = SS_{within}

MS_{between} = SS_{between} / df_{between}

MS_{within} = SS_{within} / df_{within}

F Value = MS_{between} / MS_{within}

p Value = F.DIST.RT(F Value, df_{between}, df_{within})

__ Repeated-measures ANOVA__ (data points in different sample group are all taken from the same group of subjects and are therefore not independent of each other)

SS_{error} = SS_{within} - SS_{subjects}

SS stand for “sum of squares,” which is how variance is calculated.

Note that the variance attributed to error (SS_{error}) is now smaller as a result of removing variance associated with differences among individual subjects (SS_{subjects}).

MS_{between} = SS_{between} / df_{between}

MS_{error} = SS_{error} / df_{error}

F Value = MS_{between} / MS_{error}

p Value = F.DIST.RT(F Value, df_{between}, df_{error})

The F Value for repeated-measures ANOVA will be significantly larger than the F Value of the test if it were performed as single-factor ANOVA. This causes the p Value to be smaller for repeated-measures ANOVA thus making repeated-measures ANOVA the more powerful than single-factor ANOVA would be if applied to the same data (which it should not be because the data in all sample groups are taken from the same subjects are therefore not independent of each other).

df_{error}, which is calculated by (n-1)(k-1,) will be slightly less than df_{within} but the F value of repeated-measures ANOVA is increased significantly more. This ultimately reduces the p Value of repeated-measures ANOVA so that it is less than the p Value of the comparable single-factor ANOVA thus making repeated-measures ANOVA the more sensitive (powerful) test.

## Null and Alternative Hypotheses for Repeated-Measures ANOVA

The Null Hypothesis for repeated-measures ANOVA is exactly like that of single-factor ANOVA and states that the sample groups *ALL* come from the same population. This would be written as follows:

Null Hypothesis = H_{0}: µ_{1} = µ_{2} = … = µ_{k} (k equals the number of sample groups)

Note that Null Hypothesis is not referring to the sample means, s_{1} , s_{2} , … , s_{k}, but to the population means, µ_{1} , µ_{2} , … , µ_{k}.

The Alternative Hypothesis for ANCOVA states that *at least one* sample group is likely to have come from a different population. Like single-factor ANOVA, repeated-measure ANOVA is an omnibus test that does not clarify which groups are different or how large any of the differences between the groups are. This Alternative Hypothesis only states whether *at least one* sample group is likely to have come from a different population.

Alternative Hypothesis = H_{0}: µ_{i} ? µ_{j} for some i and j

## Single-Factor Repeated-Measures ANOVA (Within-Subjects) Example in Excel

A company implemented a four-week training program to reduce clerical errors. Five employees underwent this training program. The number of clerical errors that each trainee committed during each week as the training progressed was recorded. These data are shown as follows:

*(Click On Image To See a Larger Version)*

Single-factor repeated-measures ANOVA (within subjects) will be performed on this data to determine whether the average number clerical errors changed during any week of the training after removing the variation in clerical errors due to individual differences between trainees (subjects).

Each of the subjects who underwent the training can be described by the following two variables used in repeated-measures ANOVA:

Independent Variable – This is the categorical variable of Training Method type. The overall objective of the repeated-measures ANOVA is to determine if levels of the factor of training program type produced significantly different sales increases.

Dependent Variable – This continuous variable is the monthly sales increase for each salesperson who underwent either of the two training programs. Note that values of this variable are colored black.

Repeated-measures ANOVA can be performed in Excel in four steps. Before performing these steps, repeated-measures ANOVA’s required assumptions will be listed below as follows:

### Repeated-Measures ANOVA’s Required Assumptions

#### Repeated-Measures ANOVA Has the Following Same Required Assumptions as Single-Factor ANOVA

Like single-factor ANOVA, repeated-measures ANOVA has the following required assumptions whose validity should be confirmed before this test is applied:

**1) Sample Data Are Continuous** Sample group data (the dependent variable’s measured value) can be ratio or interval data, which are the two major types of continuous data. Sample group data cannot be nominal or ordinal data, which are the two major types of categorical data.

**2) Independent Variable is Categorical** The determinant of which group each data observation belongs to is a categorical, independent variable. Repeated-measures ANOVA uses a single categorical variable that has at least two levels. All data observations associated with each variable level represent a unique data group and will occupy a separate column on the Excel worksheet.

**3) Extreme Outliers Removed If Necessary** Repeated-measures ANOVA is a parametric test that relies upon calculation of the means of sample groups. Extreme outliers can skew the calculation of the mean. Outliers should be identified and evaluated for removal in all sample groups. Occasional outliers are to be expected in normally-distributed data but all outliers should be evaluated to determine whether their inclusion will produce a less representative result of the overall data than their exclusion.

**4) Normally-Distributed Data In All Sample Groups** Repeated-measures ANOVA is a parametric test having the required assumption the dependent-variable data from each sample group come from a normally-distributed population. Each sample group’s dependent-variable data should be tested for normality. Normality testing becomes significantly less powerful (accurate) when a group’s size fall below 20. An effort should be made to obtain group sizes that exceed 20 to ensure that normality tests will provide accurate results. Like single-factor ANOVA, repeated-measures ANOVA is relatively robust to minor deviation from sample group normality.

#### Repeated-measures ANOVA Has the Following Additional Require Assumption

**5) Sphericity In All Sample Groups** Single-factor ANOVA requires that sample groups are obtained from populations that have similar variances. Repeated-measures ANOVA has a similar but more rigorous requirement called Sphericity. Sphericity exists when the variance of the differences of all combinations of groups is equal. Sample groups represent measurements taken from the same set of subjects under different conditions or at different times. The differences referred to by Sphericity are the differences between data valuess in different sample groups that are taken from the same subject.

Violation of Sphericity makes the test more likely to perform a Type 1 error, i.e., a false positive. If the requirement of Sphericity is violated, a correction can be applied to the df_{between} and df_{error} which will increase the test’s p Value making the test less likely to report a false positive (making the test more conservative). Sphericity testing and any necessary df adjustment will be explained and demonstrated in the blog article following this one.

Variance testing becomes significantly less powerful (accurate) when a group’s size fall below 20. An effort should be made to obtain group sizes that exceed 20 to ensure that variance tests will provide accurate results.

__Single-Factor Repeated-Measures ANOVA in Excel - The 4 Steps __

**Step 1) Run Single-Factor ANOVA on the Sample Groups**

**Step 2) Calculate Subject Means, Group Means, and the Grand Mean**

**Step 3) Calculate SS**_{subjects}**, SS**_{error}**, and df**_{error}

**Step 4) Create an Updated ANOVA Table for Repeated-Measure ANOVA**

Here is a detailed description of the performance of each step:

**Step 1) Run Single-Factor ANOVA on the Sample Groups**

After the data is correctly arranged on the Excel worksheet, use the Excel data analysis tool **ANOVA: Single-Factor** to perform single-factor ANOVA. This dialogue box will appear and should be filled as follows:

*(Click On Image To See a Larger Version)*

Running the Single-Factor ANOVA tool in Excel on the above data produces the following output:

*(Click On Image To See a Larger Version)*

The single-factor ANOVA output is shown above. The p Value of 0.0767 indicates that single-factor ANOVA did not detect a significant difference between the group means if a 95-percent confidence level is required (alpha is set at 0.05). Keep in mind that Single-Factor ANOVA by itself is not an appropriate test to run on this data because the data in the different sample groups are not independent as required by single-factor ANOVA because the data in the different sample groups are all taken from the same set of subjects.

**Step 2) Calculate Subject Means, Group Means, and the Grand Mean**

*(Click On Image To See a Larger Version)*

**Step 3) Calculate SS**_{subjects}**, SS**_{error}**, and df**_{error}

*(Click On Image To See a Larger Version)*

*(Click On Image To See a Larger Version)*

SS_{subjects} = 13,358.70

SS_{error} = 7,809.30

df_{error} = 12

When the variance attributed to differences between the test subjects (SS_{subjects}) is removed from the within-group variance (SS_{within}), only the much smaller unexplained variance (SS_{error}) is left. This makes the test more powerful by dramatically increasing the F Value, which reduces the p Value.

**Step 4) Create an Updated ANOVA Table for Repeated-Measure ANOVA**

*(Click On Image To See a Larger Version)*

Note that the p Value has dropped from 0.0767 single-factor ANOVA to 0.0123 in repeated-measure ANOVA. Repeated-measures ANOVA detected a significant difference between the sample group averages that single-factor ANOVA did not..

**Sphericity Testing**

Sphericity testing should now be conducted. Sphericity exists when the variances of the differences between data pairs from the same subjects are the same across all possible combinations of sample groups. Two hypothesis tests are used to determine if Sphericity exists. The weaker but more popular of the two Sphericity hypothesis tests is Mauchly’s test. The more powerful but less frequently employed Sphericity test is called John, Nagao, and Sugiura’s Test of Sphericity. Both of these tests will be demonstrated in detail on the data used in this example in the next blog article.

If the Null Hypothesis of either Mauchly’s Sphericity Test or John, Nagao, and Sugiura’s Test of Sphericity can be rejected, then a correction should be applied to df_{between} and df_{error} that will ultimately make the test more conservative and less powerful by increasing the final p Value of the repeated-measures ANOVA.

If the Sphericity requirement has been violated, then the degree to which Sphericity is violated needs to be calculated. The statistic that describes how much Sphericity is violated is called Epsilon (?). Epsilon is a number between 1 and 0. The further from 1 that Epsilon is, the greater is the violation of Sphericity.

Sphericity can only be estimated because the available data are sample data and not population data. There are two methods commonly used to estimate Epsilon: the Geisser-Greenhouse procedure and the Huynd-Feldt procedure. The estimate of Sphericity (Epsilon) that each of these procedures calculates is used to correct df_{between} and df_{error} in a way that makes test less powerful by increasing the final p value.

The blog article following this one will provided detailed instructions on how to perform the Geisser-Greenhouse procedure and the Huynd-Feldt procedure in Excel on the data used in this example and make then corrections to the degrees of freedom.

## Calculating Effect Size in Repeated-Measures ANOVA

Effect size is a way of describing how effectively the method of data grouping allows those groups to be differentiated. A blog article following this one will provide detailed instructions on how to calculated effect size for repeated-measures ANOVA with the data used in this example.

**Excel Master Series Blog Directory**

**Click Here To See a List Of All Statistical Topics And Articles In This Blog**

**You Will Become an Excel Statistical Master!**

## No comments:

## Post a Comment