# Repeated Measures ANOVA Calculator

Within-subjects design, the same subjects show up in each group, or exposed to every treatment.

The tool ignores empty cells or non-numeric cells.

## One-way repeated measures ANOVA

The one-way repeated measures ANOVA checks if the difference between the averages of two or more dependent groups is significant.

While on one-way ANOVA each subject appears only in one group, on one-way repeated measures ANOVA each subject appears in every group. A one-way repeated measures ANOVA contains only one categorical variable, each group/treatment is one value of the categorical variable.

For two categorical variables, use two-way ANOVA calculator The paired t-test is a special case of repeated measures ANOVA with two groups.

If you use a two-way mix model ANOVA with no repeat, with subject as the random factor, and group as the fixed factor

#### Targets

The two way ANOVA test checks if the difference between the averages of two or more dependent groups is significant.

When performing ANOVA test, we try to determine if the difference between the averages reflects a real difference between the groups, or is due to the random noise inside each group.The F statistic represents the ratio of the variance between the groups and the variance inside the groups. Unlike many other statistic tests, the smaller the F statistic the more likely the averages are equal.

**Right-tailed**F test, for ANOVA test you can use only the right tail. Why?

_{0}: μ

_{1}= ... = μ

_{k}

_{1}: not(μ

_{1}= ... = μ

_{k})

F = | MS_{Treatment} |

MS_{Error} |

### How to use the repeated measures ANOVA calculator?**Significance level (α)**: A p-value less than the significance level is statistically significant.

Researchers usually use 0.05, but if the price of a mistake is big, they may use a smaller value like 0.01.

**Correction method** - correct the significance level(α) for the multiple comparisons.

**No correction** - use the significance level you entered for the repeated measures ANOVA, without a correction.

**Bonferroni correction**

**Sidak correction****Sphericity Correction** - the repeated measures ANOVA calculator checks the Sphericity assumption using the Mauchly's test.

**Automatic** - use the Greenhouse-Geisser correction only if the Mauchly's test rejected the Sphericity assumption.

**Greenhouse-Geisser** - always use the Greenhouse-Geisser correction even if the Sphericity assumption could not be rejected (i.e., Mauchly's test is not significant, p > 0.05).

**Hyunh-Feldt** - always use the Greenhouse-Geisser correction even if the Sphericity assumption could not be rejected.

**No correction** - don't use any Sphericity correction, even if the Mauchly's test rejected the Sphericity assumption.**Outliers:** extreme values. relevant only if you entered raw data.

**included** - the calculator will calculate the outliers but will include them in the calculation.

**Excluded** - The calculator will exclude the outliers before calculating the average and the standard deviation.**Advanced fields - for sample size**

When planning the experiment, you should choose the effect size that the test should identify. You should choose the sample size before conducting the research. We added this field to alert users that didn't calculate the sample size, or did it incorrectly.

If you use the calculator for homework you may ignore these fields.

**Effect** - If you don't know the required effect size, you may use the 'effect' field. The default is 'Medium', if you change the value, it will change 'effect type' to 'Standardized effect size' and fill the proper value per Cohen's suggestion in the 'effect size' field. (0.2: Small, 0.5: medium, 0.8: large) The calculator will not use this field when pressing the 'calculate' button.

**Effect type**

**f** - effect size.

**f**^{2} - effect size.

**η**^{2} - ETA squared = SSB / (SSB + SSE)

**Effect size** - the value that you want the test to be able to identify. You need a larger sample size to be able to identify a smaller effect size.

**Rounding** - how to round the results?

When a resulting value is larger than one, the tool rounds it, but when a resulting value is less than one the tool displays the significant figures.**How to enter data?**

**Enter data in table** - enter one value in each cell.

**Enter data in columns** - each column is one group or treatment.

The order in the column represent the subject, for example the second value in each column represent subject #2.

**Enter data from excel** - copy the *raw data* with the *group header* and without the subjects left column, and paste in the calculator. you may copy from Excel or Google sheets, or any tool that separates data with tab and line feed. copy the entire block, include the header .

## Assumptions

- The dependent variable is continuous (ratio or interval)
- One categorical independent variable
- Each subject appears in each group/treatment
- The residuals distribution is normal
- Sphericity - equality of variances of the differences between the groups

## Required Sample Data

Sample data from all compared groups

## Parameters

**a** - the number of subjects, number of rows.

**b** - the number of groups, number of columns.

**n** - overall sample side, n = a * b.

**Ȳ**_{i} - average of all the observations of subject i of variable A - subjects (row i).

**Ȳ**_{j} - average of all the observations of group j of variable B - treatments/groups (column j).

**Ȳ** - overall average (ΣY_{i,j} / n, i=1 to a, j=1 to b.

## Results calculations

### Sum of squares

The sum of squares accumulates the squared differences related to the effect we try to estimate.

**SS**_{A} - the squared differences related to the effect of variable A. You compare the average of every category to the total average. The same value as the sum of squares between groups in one way ANOVA.

**SS**_{B} - the same as SS_{A}, for variable B.

and compare to the total average.

**A effect** = Ȳ_{i} - Ȳ

**B effect** = Ȳ_{j} - Ȳ

**Error** = Cell average - A effect - B effect - Total average.

= Ȳ_{i,j} - (Ȳ_{i} - Ȳ) - (Ȳ_{j} - Ȳ) - Ȳ.

= Ȳ_{i,j} - Ȳ_{i} - Ȳ_{j} + Ȳ.

Take the square of each difference

(Ȳ_{i,j} - Ȳ_{i} - Ȳ_{j} + Ȳ)^{2}.

Count the square differences of each value in the cell.

**SS**_{E}=Σ_{i}^{a}Σ_{j}^{b}n_{i,j}(Ȳ_{i,j} - Ȳ_{i} - Ȳ_{j} + Ȳ)^{2}

Example: Compare the blood pressure results over time, check each subject's blood pressure before treatment, after one week and after two weeks.

Treatments/Groups: Before treatment, after 1 week, after 2 weeks.

Multiple measures of each subject

### ANOVA table

Source Degrees of

Freedom (DF) Sum of Squares (SS) Mean Square (MS) F statistic p-value ** A - Subjects (rows)**

Between the subjectsDF_{A} = a - 1 SS_{A} = Σ_{i}^{a}b(Ȳ_{i}-Ȳ)^{2} MS_{A} = SS_{A} / DF_{A} F_{A} = MS_{A} / MS_{E} P(x > F_{A}) ** B - Treatments (Columns)**

Between the treatmentsDF_{B} = b - 1 SS_{B} = Σ_{j}^{b}a(Ȳ_{j}-Ȳ)^{2} MS_{B} = SS_{B} / DF_{B} F_{B} = MS_{B} / MS_{E} P(x > F_{B}) ** Error**

Within the cellsDF_{E} = n - a - b + 1 SS_{E}=Σ_{i}^{a}Σ_{j}^{b}(Y_{i,j} - Ȳ_{i} - Ȳ_{j} + Ȳ)^{2} MS_{E} = SS_{E} / DF_{E} **Total**

All the deviations from the averageDF_{T} = n - 1 SS_{T}=Σ_{i}^{a}Σ_{j}^{b}(Y_{i,j} - Ȳ)^{2}

SS_{T}=Sample Variance*(n-1)

SS_{T}=SS_{A}+SS_{B}+SS_{E} MS_{E} = S^{2} = SS_{T} / (n - 1)

### Sum of squares diagram

In the following diagram you may see the differences per each observation Y_{i,j} that used to calculate the sum of squares.

A - Treatments effect: Ȳ_{i} - Ȳ.

B - Subjects effect: Ȳ_{j} - Ȳ.

Error: Y_{i,j} - Ȳ_{i} - Ȳ_{j} + Ȳ.

Total effect: Y_{i,j} - Ȳ.

**Significance level (α)**: A p-value less than the significance level is statistically significant.Researchers usually use 0.05, but if the price of a mistake is big, they may use a smaller value like 0.01.

**Correction method**- correct the significance level(α) for the multiple comparisons.**No correction**- use the significance level you entered for the repeated measures ANOVA, without a correction.**Bonferroni correction****Sidak correction****Sphericity Correction**- the repeated measures ANOVA calculator checks the Sphericity assumption using the Mauchly's test.**Automatic**- use the Greenhouse-Geisser correction only if the Mauchly's test rejected the Sphericity assumption.**Greenhouse-Geisser**- always use the Greenhouse-Geisser correction even if the Sphericity assumption could not be rejected (i.e., Mauchly's test is not significant, p > 0.05).**Hyunh-Feldt**- always use the Greenhouse-Geisser correction even if the Sphericity assumption could not be rejected.**No correction**- don't use any Sphericity correction, even if the Mauchly's test rejected the Sphericity assumption.**Outliers:**extreme values. relevant only if you entered raw data.**included**- the calculator will calculate the outliers but will include them in the calculation.**Excluded**- The calculator will exclude the outliers before calculating the average and the standard deviation.**Advanced fields - for sample size**When planning the experiment, you should choose the effect size that the test should identify. You should choose the sample size before conducting the research. We added this field to alert users that didn't calculate the sample size, or did it incorrectly.

If you use the calculator for homework you may ignore these fields.

**Effect**- If you don't know the required effect size, you may use the 'effect' field. The default is 'Medium', if you change the value, it will change 'effect type' to 'Standardized effect size' and fill the proper value per Cohen's suggestion in the 'effect size' field. (0.2: Small, 0.5: medium, 0.8: large) The calculator will not use this field when pressing the 'calculate' button.**Effect type****f**- effect size.**f**- effect size.^{2}**η**- ETA squared = SSB / (SSB + SSE)^{2}**Effect size**- the value that you want the test to be able to identify. You need a larger sample size to be able to identify a smaller effect size.**Rounding**- how to round the results?When a resulting value is larger than one, the tool rounds it, but when a resulting value is less than one the tool displays the significant figures.

**How to enter data?****Enter data in table**- enter one value in each cell.**Enter data in columns**- each column is one group or treatment.The order in the column represent the subject, for example the second value in each column represent subject #2.

**Enter data from excel**- copy the*raw data*with the*group header*and without the subjects left column, and paste in the calculator. you may copy from Excel or Google sheets, or any tool that separates data with tab and line feed. copy the entire block, include the header .## Assumptions

- The dependent variable is continuous (ratio or interval)
- One categorical independent variable
- Each subject appears in each group/treatment
- The residuals distribution is normal
- Sphericity - equality of variances of the differences between the groups

## Required Sample Data

Sample data from all compared groups

## Parameters

**a**- the number of subjects, number of rows.

**b**- the number of groups, number of columns.

**n**- overall sample side, n = a * b.

**Ȳ**- average of all the observations of subject i of variable A - subjects (row i).

_{i}**Ȳ**- average of all the observations of group j of variable B - treatments/groups (column j).

_{j}**Ȳ**- overall average (ΣY

_{i,j}/ n, i=1 to a, j=1 to b.

## Results calculations

### Sum of squares

The sum of squares accumulates the squared differences related to the effect we try to estimate.**SS**- the squared differences related to the effect of variable A. You compare the average of every category to the total average. The same value as the sum of squares between groups in one way ANOVA.

_{A}**SS**- the same as SS

_{B}_{A}, for variable B.

and compare to the total average.

**A effect**= Ȳ

_{i}- Ȳ

**B effect**= Ȳ

_{j}- Ȳ

**Error**= Cell average - A effect - B effect - Total average.

= Ȳ

_{i,j}- (Ȳ

_{i}- Ȳ) - (Ȳ

_{j}- Ȳ) - Ȳ.

= Ȳ

_{i,j}- Ȳ

_{i}- Ȳ

_{j}+ Ȳ.

Take the square of each difference

(Ȳ

_{i,j}- Ȳ

_{i}- Ȳ

_{j}+ Ȳ)

^{2}.

Count the square differences of each value in the cell.

**SS**=Σ

_{E}_{i}

^{a}Σ

_{j}

^{b}n

_{i,j}(Ȳ

_{i,j}- Ȳ

_{i}- Ȳ

_{j}+ Ȳ)

^{2}

Example: Compare the blood pressure results over time, check each subject's blood pressure before treatment, after one week and after two weeks.

Treatments/Groups: Before treatment, after 1 week, after 2 weeks.

Multiple measures of each subject

### ANOVA table

Source | Degrees of Freedom (DF) | Sum of Squares (SS) | Mean Square (MS) | F statistic | p-value |
---|---|---|---|---|---|

A - Subjects (rows)Between the subjects | DF_{A} = a - 1 | SS_{A} = Σ_{i}^{a}b(Ȳ_{i}-Ȳ)^{2} | MS_{A} = SS_{A} / DF_{A} | F_{A} = MS_{A} / MS_{E} | P(x > F_{A}) |

B - Treatments (Columns)Between the treatments | DF_{B} = b - 1 | SS_{B} = Σ_{j}^{b}a(Ȳ_{j}-Ȳ)^{2} | MS_{B} = SS_{B} / DF_{B} | F_{B} = MS_{B} / MS_{E} | P(x > F_{B}) |

ErrorWithin the cells | DF_{E} = n - a - b + 1 | SS_{E}=Σ_{i}^{a}Σ_{j}^{b}(Y_{i,j} - Ȳ_{i} - Ȳ_{j} + Ȳ)^{2} | MS_{E} = SS_{E} / DF_{E} | ||

TotalAll the deviations from the average | DF_{T} = n - 1 | SS_{T}=Σ_{i}^{a}Σ_{j}^{b}(Y_{i,j} - Ȳ)^{2}SS _{T}=Sample Variance*(n-1)SS _{T}=SS_{A}+SS_{B}+SS_{E} | MS_{E} = S^{2} = SS_{T} / (n - 1) |

### Sum of squares diagram

In the following diagram you may see the differences per each observation Y_{i,j}that used to calculate the sum of squares.

A - Treatments effect: Ȳ

_{i}- Ȳ.

B - Subjects effect: Ȳ

_{j}- Ȳ.

Error: Y

_{i,j}- Ȳ

_{i}- Ȳ

_{j}+ Ȳ.

Total effect: Y

_{i,j}- Ȳ.