Table of Contents
Understanding the Repeated Measures ANOVA
The repeated measures ANOVA (RMANOVA) stands as a cornerstone statistical technique in experimental research. It is specifically designed to evaluate mean differences across three or more dependent groups, meaning the same subjects are measured under every experimental condition. This methodology, commonly referred to as a within-subjects design, offers a significant advantage over independent designs, such as the one-way ANOVA, because it inherently controls for individual participant variability. By accounting for these baseline differences, the RMANOVA substantially increases the analysis’s statistical power, allowing researchers to more accurately isolate whether observed variations are truly attributable to the treatment effect or merely random chance.
Developing a comprehensive, intuitive understanding of how statistical models function requires mastering the underlying manual calculations. Calculating an ANOVA by hand is an essential exercise for any statistician or researcher, as it demystifies the process of variance partitioning—the fundamental concept behind all ANOVA models. This detailed tutorial provides a step-by-step arithmetic guide to performing a one-way repeated measures ANOVA computation manually. We aim to translate the theoretical framework into an actionable sequence of calculations necessary to fully understand this powerful analytical tool.
Designing the Experiment: A Clinical Scenario
To illustrate the necessary computations, we will utilize a typical clinical research scenario. Imagine a study where investigators are keen to compare the effectiveness of different pharmacological interventions. In this specific example, researchers hypothesize that three distinct pharmaceutical drugs will result in varying effects on human reaction time. To ensure rigorous control and maximize efficiency, five individual patients were recruited, and their reaction times (measured in seconds) were systematically recorded after the administration of each of the three drugs sequentially. The critical design element here is that the identical set of five patients provided data for all three drug conditions, confirming the appropriate application of the within-subjects design methodology.
The core objective of this particular statistical investigation is to determine if a statistically significant difference exists among the population mean reaction times observed under the influence of Drug 1, Drug 2, and Drug 3. The raw data collected from this hypothetical experiment serves as the input for all subsequent calculations and is clearly presented in the foundational table below. Understanding the structure of this data—repeated measurements on the same subjects across multiple levels of the independent variable (the drug type)—reinforces why the one-way repeated measures ANOVA is the correct analytical path forward for deriving the crucial F-ratio.

Phase I: Partitioning Total Variance (Sums of Squares)
The essence of ANOVA lies in meticulously partitioning the total observed variability within the dataset into components traceable to specific sources. We initiate this complex process by calculating the Sum of Squares (SS), which serves as the fundamental measure of dispersion. For the RMANOVA, we must first determine three primary sums of squares: the Total (SST), the Between-Groups (SSB, or Treatment), and the Subject (SSS). Any remaining variability not accounted for by these components is captured by the Error Sum of Squares (SSE).
The first required calculation is the Total Sum of Squares (SST). SST quantifies the overall variability across all individual observations, without regard for grouping or subject identity. It effectively sets the upper boundary for the variance that the model must explain. The standard formula relates the total variance of the dataset ($s^2_{total}$) to the total number of observations ($n_{total}$):
SST = s2total(ntotal-1)
where:
- s2total: The variance calculated across the entire combined dataset.
- ntotal: The total count of all data points (in our case, 15 observations).
Applying the raw data from our drug study, the total sum of squares calculation yields: (64.2667)(15-1) = 899.7.
Following SST, we must isolate the Between Sum of Squares (SSB), also frequently termed the Sum of Squares for Treatment. SSB measures the systematic variability that exists exclusively between the mean scores of the different treatment groups (the three drugs). A large SSB value suggests that the experimental intervention has produced a substantial, measurable effect. This calculation requires summing the squared differences between the mean of each group and the overall grand mean, weighted by the group size:
SSB = Σnj(xj – xtotal)2
where:
- Σ: The summation operator, indicating the sum across all groups.
- nj: The number of observations in the jth group (n=5 for each drug).
- xj: The mean reaction time for the jth drug group.
- xtotal: The mean of the entire dataset, known as the grand mean.
When applying the formula to the reaction time data, the resulting calculation is: (5)(26.4-22.533)2 +(5)(25.6-22.533)2 + (5)(15.6-22.533)2 = 362.1.
Phase II: Accounting for Subject Variability
The primary statistical benefit of the repeated measures design is the inherent ability to separate and remove variance caused by stable, individual differences among the participants. This crucial component is quantified by the Subject Sum of Squares (SSS). By successfully calculating SSS, we statistically adjust for the fact that some patients possess consistently faster or slower reaction times across all three drug conditions compared to the average participant. This process of removing individual baseline variance significantly refines the estimation of the true treatment effect. The formula for SSS involves the squared sum of each patient’s total score ($r^2_k$), the grand total ($N$), the number of patients ($r$), and the number of groups ($c$):
SSS =(Σr2k/c) – (N2/rc)
where:
- Σ: The summation symbol.
- r2k: The squared sum of scores achieved by the kth patient across all treatments.
- N: The grand total of all scores across the entire dataset.
- r: The total number of patients (subjects).
- c: The total number of groups (treatments).
Substituting the aggregated patient totals into the formula yields the Subject Sum of Squares: ((742 + 422 + 622 + 922 + 682)/3) – (3382/(5)(3)) = 441.1. This large value indicates that individual differences significantly contributed to the overall variance, highlighting the importance of the repeated measures design.
The final Sum of Squares required is the Error Sum of Squares (SSE), which represents the residual, unexplained variability—the random fluctuation within the data that cannot be attributed either to the treatment (SSB) or to stable individual differences (SSS). This error term is indispensable, as it forms the denominator in the final F-ratio calculation. Since the total variability must mathematically equal the sum of its partitioned components (SST = SSB + SSS + SSE), we can most easily calculate SSE through subtraction:
SSE = SST – SSB – SSS
Utilizing our previously determined values, the Error Sum of Squares is calculated as: 899.7 – 362.1 – 441.1 = 96.5. This measure of unexplained noise is critical for the subsequent calculation of the Mean Square Error, which dictates the precision and magnitude of our statistical test.
Phase III: Finalizing the ANOVA Summary Table
Once all Sums of Squares are computed, the subsequent vital phase involves determining the appropriate Degrees of Freedom (df) for each variance source, which then allows for the calculation of the Mean Squares (MS). The Mean Square represents the average variability attributable to that source, obtained by dividing the Sum of Squares (SS) by its corresponding df. This normalization process standardizes the variance measures, making them comparable for the final F-test statistic.
The necessary Degrees of Freedom are derived from the number of groups ($c=3$) and the number of participants ($r=5$). The degrees of freedom for the treatment effect (Between) is calculated as the number of groups minus one ($c-1 = 2$). The degrees of freedom for the Subject effect is the number of participants minus one ($r-1 = 4$). Crucially, the Error degrees of freedom is determined by multiplying the Between df by the Subject df ($2 times 4 = 8$).
We can now compile all computed values—SS, df, and MS—into the standard ANOVA summary table format:
| Source | Sum of Squares (SS) | df | Mean Squares (MS) | F |
|---|---|---|---|---|
| Between (Treatment) | 362.1 | 2 | 181.1 | 15.006 |
| Subject | 441.1 | 4 | 110.3 | |
| Error | 96.5 | 8 | 12.1 |
The final element required for the table is the F test statistic, which is the ratio of the systematic variability due to the treatment (MS Between) divided by the unexplained variability (MS Error). This ratio effectively quantifies the size of the treatment effect relative to the random experimental noise. The complete calculations for the Mean Squares and F-ratio are summarized below:
- df between: #groups – 1 = 3 – 1 = 2
- df subject: #participants – 1 = 5 – 1 = 4
- df error: df between × df subject = 2 × 4 = 8
- MS between: SSB / df between = 362.1 / 2 = 181.1
- MS subject: SSS / df subject = 441.1 / 4 = 110.3
- MS error: SSE / df error = 96.5 / 8 = 12.1
- F: MS between / MS error = 181.1 / 12.1 = 15.006
Interpreting the F-Statistic and Drawing Conclusions
The entire ANOVA calculation culminates in the determination of the F test statistic, which, for this analysis, is calculated as 15.006. This numerical value must be rigorously evaluated against a standard probability distribution (the F distribution) to ascertain if it is large enough to warrant the rejection of the null hypothesis ($H_0$). The null hypothesis states that there are no genuine differences among the population means of the reaction times across the three drug conditions; that is, any observed differences are purely due to chance.
To establish the required threshold for significance, we compare our calculated F-ratio to the tabulated F critical value. This critical value is extracted from the F distribution table based on specific degrees of freedom and a chosen level of risk (alpha). We define the necessary parameters as follows:
- α (Significance Level): Set conventionally at 0.05, representing a 5% risk of Type I error.
- DF1 (Numerator Degrees of Freedom): Corresponds to the degrees of freedom for the treatment effect (df between = 2).
- DF2 (Denominator Degrees of Freedom): Corresponds to the degrees of freedom for the error term (df error = 8).
Upon consulting the F distribution table using $df_1=2$ and $df_2=8$ at the $alpha=0.05$ significance level, we find that the F critical value required to achieve statistical significance is 4.459. This threshold establishes the minimum F-ratio that must be exceeded for the results to be deemed non-random and worthy of reporting.
Since our calculated F test statistic ($15.006$) is markedly larger than the F critical value ($4.459$), we possess sufficient evidence to confidently reject the null hypothesis. This decisive statistical rejection leads to the conclusion that there is a statistically significant difference between the mean reaction times elicited by the three drugs. In practical terms, the researchers can conclude that the type of drug administered has a measurable and non-random impact on patient reaction speed, validating the initial research hypothesis.
Cite this article
Mohammed looti (2025). Repeated Measures ANOVA: A Comprehensive Guide to Calculation and Application. PSYCHOLOGICAL STATISTICS. Retrieved from https://statistics.arabpsychology.com/perform-a-repeated-measures-anova-by-hand/
Mohammed looti. "Repeated Measures ANOVA: A Comprehensive Guide to Calculation and Application." PSYCHOLOGICAL STATISTICS, 8 Nov. 2025, https://statistics.arabpsychology.com/perform-a-repeated-measures-anova-by-hand/.
Mohammed looti. "Repeated Measures ANOVA: A Comprehensive Guide to Calculation and Application." PSYCHOLOGICAL STATISTICS, 2025. https://statistics.arabpsychology.com/perform-a-repeated-measures-anova-by-hand/.
Mohammed looti (2025) 'Repeated Measures ANOVA: A Comprehensive Guide to Calculation and Application', PSYCHOLOGICAL STATISTICS. Available at: https://statistics.arabpsychology.com/perform-a-repeated-measures-anova-by-hand/.
[1] Mohammed looti, "Repeated Measures ANOVA: A Comprehensive Guide to Calculation and Application," PSYCHOLOGICAL STATISTICS, vol. X, no. Y, ص Z-Z, November, 2025.
Mohammed looti. Repeated Measures ANOVA: A Comprehensive Guide to Calculation and Application. PSYCHOLOGICAL STATISTICS. 2025;vol(issue):pages.