Repeated-Measures ANOVA

In this blog post, we will explore one-way repeated-measures ANOVA, its assumptions, and the non-parametric alternative, the Friedman test. We will guide you through performing these analyses in R, jamovi, and SPSS, while demonstrating how to interpret and report the results, including post hoc analysis and effect sizes. By the end of this post, you will be equipped with the knowledge and skills to confidently apply these techniques to your own research in the field of kinesiology.

Repeated-measures ANOVA
Friedman test
Assumptions
Effect size
Post hoc analysis
Kinesiology research
Author
Affiliation

Cal State Northridge

Published

April 16, 2023

Learning Objectives

Here are the learning objectives for this blog post on one-way repeated-measures ANOVA:

  1. Understand the concept and application of one-way repeated-measures ANOVA.
  2. Learn the assumptions of one-way repeated-measures ANOVA and the importance of checking them.
  3. Gain knowledge of the non-parametric equivalent of repeated-measures ANOVA, the Friedman test.
  4. Learn how to perform one-way repeated-measures ANOVA in R, jamovi, and SPSS.
  5. Understand how to interpret the results of one-way repeated-measures ANOVA, including post hoc analysis, effect sizes, and generalized eta-squared.
  6. Know how to perform the Friedman test in R, jamovi, and SPSS, as well as interpret its results.
  7. Develop skills in reporting the results of one-way repeated-measures ANOVA and the Friedman test in APA style.

By the end of this blog post, readers should be able to confidently perform and interpret one-way repeated-measures ANOVA and the Friedman test using various statistical software, and effectively communicate their findings in accordance with APA guidelines.

1 Sample data

This dataset consists of 45 participants divided into three exercise programs (A, B, and C). Each participant’s flexibility was measured at three time points (Time1, Time2, and Time3). Additionally, the dataset includes information about each participant’s gender (Male or Female).

Download1 the dataset: flexibility.csv

Code
# Load required packages
if (!require("pacman")) install.packages("pacman")
Loading required package: pacman
Code
pacman::p_load("tidyverse", "dplyr", "psych", "knitr", "kableExtra")


# Read the dataset
data <- read.csv("../data/flexibility.csv", header = TRUE)

# Convert Group and Gender to factors
data$Group <- as.factor(data$Group)
data$Gender <- as.factor(data$Gender)

# Compute the descriptives table
descriptives <- data %>%
  select(Group, Gender, Flex_Time1, Flex_Time2, Flex_Time3) %>%
  group_by(Group, Gender) %>%
  psych::describe() %>%
  select(-n, -se)

# Print the descriptives table in a nice format
kable(descriptives)
vars mean sd median trimmed mad min max range skew kurtosis
Group* 1 2.000000 0.8257228 2 2.000000 1.4826 1 3 2 0.0000000 -1.5659259
Gender* 2 1.555556 0.5025189 2 1.567568 0.0000 1 2 1 -0.2161948 -1.9961481
Flex_Time1 3 27.511111 5.1769692 27 27.216216 5.9304 20 39 19 0.4549922 -0.8968789
Flex_Time2 4 30.022222 5.2418287 29 29.756757 5.9304 22 41 19 0.4228177 -0.9456558
Flex_Time3 5 33.022222 5.2418287 32 32.756757 5.9304 25 44 19 0.4228177 -0.9456558

2 Intro to one-way \(r\)ANOVA

As a kinesiology student, you’re likely to encounter various statistical methods in your coursework and research. One powerful statistical tool that can help you make meaningful inferences from your data is the Repeated-measures ANOVA. In this blog post, we will explore the application of this technique using a dataset from a hypothetical flexibility training study, designed for master level kinesiology students.

The dataset provided includes information on 45 participants, who are divided into three different groups (A, B, and C). Each group undergoes a different flexibility training program, with the goal of determining which program is most effective in improving flexibility. Participants’ flexibility is measured at three different time points (Flex_Time1, Flex_Time2, and Flex_Time3) to evaluate the progress over time. Additionally, the dataset includes the gender of each participant.

Our objective is to use Repeated-measures ANOVA to analyze the data and gain insights into the effectiveness of the different training programs, as well as to examine how the results may vary by gender. By the end of this blog post, you will have a solid understanding of how to apply Repeated-measures ANOVA to kinesiology research and how to interpret the results to make evidence-based decisions.

Stay tuned as we dive into the details of Repeated-measures ANOVA, and learn how to make the most of this powerful statistical tool for your kinesiology research!

3 Assumptions

One-way Repeated-measures ANOVA makes several assumptions that need to be met for the results to be valid and reliable. Here are the main assumptions for this statistical test:

  1. Normality: The assumption of normality requires that the differences between the repeated measurements (or the residuals) follow a normal distribution within each group. It is important to note that the normality assumption applies to the differences, not the raw data.

  2. Sphericity: Sphericity is an assumption specific to Repeated-measures ANOVA. It requires that the variances of the differences between all possible pairs of within-subject conditions are equal. In other words, the variances of the differences should be homogeneous across all pairs of repeated measurements. If sphericity is violated, you may need to use a Greenhouse-Geisser or Huynh-Feldt correction to adjust the degrees of freedom for your analysis.

  3. Independence of observations: The independence of observations assumption requires that the observations within each group are independent of one another. This means that there should be no systematic relationship between the measurements, other than the effect of the independent variable. In the case of Repeated-measures ANOVA, it’s assumed that the repeated measurements within each subject are correlated, but the subjects themselves are independent of one another.

  4. No univariate or multivariate outliers: The presence of univariate or multivariate outliers can influence the results of a Repeated-measures ANOVA, leading to biased estimates or increased risk of Type I or Type II errors. It’s essential to check for and address any outliers before conducting the analysis.

It is important to check these assumptions before conducting a one-way Repeated-measures ANOVA, as violations can lead to incorrect conclusions. If any of the assumptions are not met, you may need to consider alternative statistical tests, data transformations, or nonparametric methods to analyze your data.

4 Equation

The Repeated-measures ANOVA equation can be represented as follows:

\[ F = \frac{MS_{\text{treatment}}}{MS_{\text{error}}} \]

Where:

  • \(F\): F-statistic

  • \(MS_{\text{treatment}}\): Mean square of the treatment (between-group) effect

  • \(MS_{\text{error}}\): Mean square of the error (within-group) effect

4.1 Calculate the sum of squares:

\[ MS_{\text{treatment}} = \frac{SS_{\text{treatment}}}{df_{\text{treatment}}} \]

\[ MS_{\text{error}} = \frac{SS_{\text{error}}}{df_{\text{error}}} \]

\({SS_{\text{treatment}}}\)

\[ SS_{\text{treatment}} = \sum_{i=1}^k n_i (\bar{Y}_{i\cdot} - \bar{Y}_{\cdot\cdot})^2 \]

\({SS_{\text{error}}}\)

\[ SS_{\text{error}} = \sum_{i=1}^k \sum_{j=1}^{n_i} (Y_{ij} - \bar{Y}_{i\cdot})^2 \]

Where:

  • \(SS_{\text{treatment}}\): Sum of squares of the treatment (between-group) effect
  • \(k\): Number of groups
  • \(n_i\): Number of observations in group i
  • \(\bar{Y}_{i\cdot}\): Mean of group i
  • \(\bar{Y}_{\cdot\cdot}\): Grand mean (mean of all observations)
  • \(SS_{\text{error}}\): Sum of squares of the error (within-group) effect
  • \(Y_{ij}\): Observation j in group i

5 F Distribution

The F distribution Furtado (2023), also known as the Fisher-Snedecor distribution, is a continuous probability distribution that is widely used in statistical hypothesis testing, particularly in the analysis of variance (ANOVA). It is named after Ronald A. Fisher and George W. Snedecor, two prominent statisticians who contributed significantly to its development.

The F distribution has two important parameters: degrees of freedom for the numerator (df1) and degrees of freedom for the denominator (df2). These parameters define the shape of the distribution. Some key characteristics of the F distribution are:

  1. It is always non-negative, as it represents the ratio of two chi-square distributions.

  2. It is asymmetric and positively skewed, with a longer tail on the right side.

  3. The peak of the distribution shifts to the right as the degrees of freedom increase.

  4. As both degrees of freedom approach infinity, the F distribution converges to a normal distribution.

Code
# Load required packages quietly
if (!require("pacman")) install.packages("pacman", quiet = TRUE)
suppressMessages(pacman::p_load("ggplot2", "ggthemes"))

# Set the parameters for the F distribution
df1 <- 10  # degrees of freedom for the numerator
df2 <- 20  # degrees of freedom for the denominator

# Create a function to calculate the probability density function (pdf) of the F distribution
f_pdf <- function(x) {
  df(x, df1, df2)
}

# Define the range of x values to plot
x_range <- seq(0, 5, length.out = 1000)

# Plot the F distribution using ggplot2
suppressWarnings(
  ggplot(data.frame(x = x_range, y = f_pdf(x_range)), aes(x = x, y = y)) +
    geom_line(color = "blue", size = 1) +
    ggtitle(paste("F Distribution with df1 =", df1, "and df2 =", df2)) +
    xlab("F value") +
    ylab("Probability Density") +
    theme_minimal()
)

6 Measure of effect size

Generalized eta-squared (η²_G) is an effect size measure that can be used across various types of ANOVA designs, including one-way Repeated-measures ANOVA. Generalized eta-squared is particularly useful because it takes into account both the between-subjects and within-subjects variability in the data, providing a standardized measure of effect size that is comparable across different study designs.

For a one-way Repeated-measures ANOVA, the generalized eta-squared is calculated as follows:

\[ \eta^2_G = \frac{SS_{\text{treatment}}}{SS_{\text{treatment}} + SS_{\text{error}}} \]

Where,

\(SS_{\text{treatment}}\) is the sum of squares of the treatment (between-group) effect, and \(SS_{\text{error}}\) is the sum of squares of the error (within-group) effect.

Note that the formula for generalized eta-squared is similar to the formula for partial eta-squared (η_p²) in a Repeated-measures ANOVA. In fact, for a one-way Repeated-measures ANOVA, the generalized eta-squared and partial eta-squared will be the same.

Generalized eta-squared (η²_G) is an effect size measure used to interpret the strength of the relationship between the independent variable(s) and the dependent variable in various types of ANOVA designs, including one-way Repeated-measures ANOVA.

To interpret the generalized eta-squared, consider the following:

  1. Magnitude: Generalized eta-squared ranges from 0 to 1, with larger values indicating a stronger relationship between the independent variable(s) and the dependent variable. A value of 0 implies no relationship, while a value of 1 implies a perfect relationship.

  2. Percentage: You can interpret generalized eta-squared as a percentage by multiplying the value by 100. For example, if η²_G is 0.10, it means that 10% of the total variability in the dependent variable can be accounted for by the independent variable(s), after considering both within-subjects and between-subjects variability.

  3. Effect size interpretation: There are no strict cutoffs for determining small, medium, or large effect sizes for generalized eta-squared, as these may vary depending on the research field and context. However, some researchers use Cohen’s guidelines for partial eta-squared as a rough reference:

  • Small effect: 0.01 or 1%
  • Medium effect: 0.06 or 6%
  • Large effect: 0.14 or 14%

Keep in mind that these guidelines should be used with caution and always interpreted within the context of the specific research question and domain.

When interpreting generalized eta-squared, it is essential to consider the context of your study and the practical significance of your findings. Additionally, it is crucial to evaluate the effect size alongside other relevant statistical information, such as p-values and confidence intervals, to draw meaningful conclusions from your analysis.

7 Post-hoc analysis

Once you have conducted a one-way Repeated Measures ANOVA and found a statistically significant main effect of the within-subject factor, it is essential to perform post hoc analyses to determine which specific pairwise comparisons between the levels of the factor are significantly different. Post hoc tests are necessary because the Repeated Measures ANOVA itself does not provide information about which pairs of measurements differ significantly.

7.0.1 Bonferroni Correction

A common approach to post hoc analysis is to use pairwise t-tests with a Bonferroni correction to account for multiple comparisons. The Bonferroni correction adjusts the significance level (α) by dividing it by the number of pairwise comparisons made. For example, if you are making three pairwise comparisons and using an α level of 0.05, the adjusted α level would be 0.05/3 = 0.0167. Pairwise comparisons with p-values less than the adjusted α level are considered statistically significant.

7.0.2 Tukey’s Honestly Significant Difference (HSD)

Tukey’s HSD test is another popular post hoc test for multiple comparisons. It controls for familywise error rate and is more powerful than the Bonferroni correction. Tukey’s HSD calculates a critical value, which is used to determine if the differences between means are significantly greater than the expected variability due to chance. This test is particularly useful when there are more than two levels of the within-subject factor, as it provides a balance between maintaining a reasonable Type I error rate and having sufficient power to detect true differences between the levels.

When performing post hoc analyses for one-way Repeated Measures ANOVA, it is essential to select a method that controls for multiple comparisons to reduce the risk of Type I errors. The choice of post hoc test will depend on factors such as the number of levels of the within-subject factor and the specific research question. Regardless of the method chosen, it is crucial to interpret the results in the context of the overall study design and research objectives.

8 Result interpretation

After completing the data analysis for your one-way Repeated Measures ANOVA, interpreting the results involves a step-by-step process of examining the various components of your output. Here’s a general outline of how you might interpret the results:

  1. Examine the omnibus test: The first step is to look at the overall Repeated Measures ANOVA test results, which will provide you with an F-value, degrees of freedom, and a p-value. If the p-value is less than your chosen significance level (e.g., α = 0.05), you can conclude that there is a statistically significant main effect of the within-subject factor on the dependent variable.

  2. Check the assumptions: Before interpreting the results further, ensure that the assumptions of Repeated Measures ANOVA have been met, including normality, sphericity, independence of observations, and the absence of univariate or multivariate outliers. If any of these assumptions are violated, you may need to consider alternative statistical techniques or data transformations.

  3. Effect size: Calculate and interpret the effect size, such as generalized eta-squared (η²_G), to quantify the strength of the relationship between the independent variable(s) and the dependent variable. This will help you understand the practical significance of your findings, in addition to the statistical significance.

  4. Post hoc analysis: If you found a significant main effect, perform post hoc analyses to identify which specific pairwise comparisons between the levels of the within-subject factor are significantly different. Choose an appropriate post hoc test (e.g., Bonferroni-corrected pairwise t-tests or Tukey’s HSD) that controls for multiple comparisons.

  5. Interpret pairwise comparisons: Examine the results of the post hoc tests, focusing on the differences between means, the confidence intervals, and the adjusted p-values. Discuss which specific pairwise comparisons are statistically significant and how these findings relate to your research question.

  6. Report the results: In your write-up, clearly report the test statistics (F-value, degrees of freedom, and p-value), effect size, and post hoc analysis results, along with a summary of your interpretations. Be sure to include any relevant figures or tables that help visualize your findings.

  7. Discuss the implications: Finally, consider the broader implications of your results in the context of your research question, the existing literature, and potential future research directions. Reflect on the limitations of your study, such as sample size or potential confounding variables, and discuss how these may have influenced your findings.

9 One-way rANOVA example

Using the sample dataset provided earlier, we will now perform a one-way rANOVA to determine if there is a significant difference in flexibility among the three observations (time1, time2, time3).

9.1 Research question

How does the flexibility of participants change over the course of the exercise intervention across the three time periods (baseline, midpoint, and endpoint)?

This research question focuses on the differences in the mean scores of the dependent variable (e.g., performance, response, or outcome) over the three time periods. By conducting a one-way Repeated Measures ANOVA, you can determine whether there are statistically significant differences in the mean scores across the time periods. If a significant main effect is found, you can then perform post hoc analyses to identify which specific pairwise comparisons between the time periods are significantly different.

9.2 Hypothesis Statements

\[ \textbf{Null Hypothesis (H0):} \enspace \mu_{1} = \mu_{2} = \mu_{3} \]

This null hypothesis states that there is no significant difference in the means of the dependent variable across the three time periods (i.e., the means are equal).

\[ \textbf{Alternative Hypothesis (H1):} \enspace \mu_{1} \neq \mu_{2} \text{ or } \mu_{1} \neq \mu_{3} \text{ or } \mu_{2} \neq \mu_{3} \]

This alternative hypothesis states that at least one pair of means is significantly different across the three time periods, suggesting that there is an effect of time on the dependent variable.

9.3 Analyzing with jamovi

Here are the steps to conduct a one-way repeated measures ANOVA in jamovi:

  1. You need one continuous outcome variable for each measurement occasion.
  2. Select Analyses -> ANOVA -> Repeated Measures ANOVA.
  3. In the box Repeated Measures Factors: write the name of your outcome variable (e.g. My_scale) and name the levels for each measurement occasion (e.g. Pre, Post and 12 month follow-up).
  4. Drag and drop your outcome variables to their respective cells in Repeated Measures Cells.
  5. Check that the variances at the different steps of the repetition factor are the same (Sphericity). To do so, open the Assumption Checks drop-down menu and set the Sphericity tests tick box.
  6. If the F test is significant, click on Post Hoc Tests and choose either the Bonferroni or the Tukey test.
  7. Click on Estimated Margin Means and move Time under Term 1. Then, under Output, check Marginal Means Plot. Then, under Plot, choose Standard Error for Error Bars.
  8. The results are shown in the right pane.

9.4 Analyzing with SPSS

To conduct a one-way Repeated Measures ANOVA in SPSS, follow these steps:

  1. Install and open SPSS: If you haven’t already, download and install IBM SPSS Statistics. Once installed, open the application.

  2. Import your dataset: Click on ‘File’ > ‘Open’ > ‘Data...’ and navigate to your dataset file (e.g., CSV or Excel file). Select the file and click ‘Open’ to import your data into SPSS. Alternatively, you can copy your dataset from a spreadsheet program (e.g., Excel) and paste it directly into the SPSS Data View.

  3. Data preparation: Ensure that your dataset is structured in a wide format, with each time period represented by a separate column. The columns should be coded as ‘Scale’ variables. If needed, you can change the variable type by right-clicking the column header and selecting ‘Variable Type...’ > ‘Scale’ from the dropdown menu.

  4. Conduct the Repeated Measures ANOVA: Click on ‘Analyze’ > ‘General Linear Model’ > ‘Repeated Measures...’. A new window will open.

  5. Specify the within-subject factor: In the ‘Within-Subject Factor Name’ box, type the name of the factor (e.g., ‘Time’) and specify the number of levels (e.g., 3 for three time periods). Click ‘Add’. Next, click ‘Define’ to open the ‘Repeated Measures Define Factorial’ dialog box.

  6. Select the variables: In the ‘Repeated Measures Define Factorial’ dialog box, select the variables representing each time period from the left-hand column and click the arrow button to move them to the ‘Within-Subjects Variables’ box. Make sure the variables are in the correct order, corresponding to their respective time periods.

  7. Choose additional options: In the ‘Repeated Measures Define Factorial’ dialog box, you can select additional options such as:

  • ‘Descriptive Statistics’: To display the means, standard deviations, and sample sizes for each time period.

  • ‘Estimates of effect size’: To display effect size measures, like partial eta-squared.

  • ‘Homogeneity tests’: To test the assumption of sphericity by displaying the results of Mauchly’s test.

  1. Run the analysis: Click ‘OK’ to run the analysis. The results will be displayed in the SPSS Output Viewer.

  2. Interpret the results: Examine the output, focusing on the F-value, degrees of freedom, p-value, and effect size for the within-subject factor. If the p-value is less than your chosen significance level (e.g., α = 0.05), there is a significant main effect.

  3. Post hoc analysis: If you found a significant main effect, you may want to perform post hoc tests to determine which specific pairwise comparisons are significantly different. To do this, click on ‘Analyze’ > ‘Compare Means’ > ‘Paired-Samples T Test...’. Select the pairs of variables representing each pairwise comparison and click the arrow button to move them to the ‘Pair 1’ box. Click ‘OK’ to run the analysis. Remember to apply a correction for multiple comparisons, such as the Bonferroni correction, when interpreting the results.

  4. Export the results: To save your results, you can either copy the output tables and paste them into your preferred document editor or presentation software, or you can save the entire output as a separate file by clicking ‘File’ > ‘Save’ or ‘Export...’ in the Output Viewer.

  5. Interpret the post hoc results: Examine the output of the paired-samples t-tests, focusing on the t-value, degrees of freedom, and p-value for each pairwise comparison. Apply the chosen correction method for multiple comparisons (e.g., Bonferroni) to the p-values. If the corrected p-value for a pairwise comparison is less than your chosen significance level (e.g., α = 0.05), there is a significant difference between the means of the dependent variable for that specific pair of time periods.

  6. Report your findings: In your research report or presentation, summarize the results of the Repeated Measures ANOVA and the post hoc tests. Describe the main effect of time on the dependent variable, as well as any significant pairwise differences between time periods. Include the relevant statistics (e.g., F-value, degrees of freedom, p-value, effect size) to support your conclusions. Make sure to discuss your results in the context of your research question and the broader implications of your findings.

SPSS Syntax

To analyze this data using SPSS, you would first need to input the data into SPSS. Assuming you have the data in a spreadsheet format, you can copy and paste it into SPSS Data View or import it using the ‘File’ > ‘Open’ > ‘Data...’ option.

Once you have the data in SPSS, you can use the following syntax to perform a one-way repeated measures ANOVA. Save this code in a text editor (e.g., Notepad), then replace the placeholders for the dataset name and path with the appropriate information.

* Load the dataset.
* Set the working directory (use your actual data path).
CD 'C:/Your/Data/Path'.

* Import the dataset (use your actual data file name).
GET DATA /TYPE=TXT
  /FILE='YourDataFile.csv'
  /DELCASE=LINE
  /DELIMITERS=','
  /QUALIFIER='"'
  /ARRANGEMENT=DELIMITED
  /FIRSTCASE=2
  /DATATYPEMIN PERCENTAGE=95.0
  /VARIABLES=
  ID F1.0
  Group A1
  Flex_Time1 F2.0
  Flex_Time2 F2.0
  Flex_Time3 F2.0
  Gender A5
  /MAP.
CACHE.
EXECUTE.
DATASET NAME DataSet1 WINDOW=FRONT.

* Conduct the Repeated Measures ANOVA.
GLM Flex_Time1 Flex_Time2 Flex_Time3
  /WSFACTOR = Time 3 Polynomial
  /METHOD = SSTYPE(3)
  /CRITERIA = ALPHA(.05)
  /WSDESIGN = Time
  /DESIGN = Time.

This syntax sets the working directory, imports the dataset, and runs the one-way repeated measures ANOVA on the “Flex_Time1”, “Flex_Time2”, and “Flex_Time3” variables. The within-subject factor is named “Time” with three levels.

To run the syntax, copy and paste it into the SPSS Syntax Editor (accessed by clicking ‘File’ > ‘New’ > ‘Syntax’) and click the green arrow button to execute the commands. The results will appear in the SPSS Output Viewer.

9.5 Interpreting the results

The results of the repeated measures ANOVA can be interpreted as follows:

  1. Within Subjects Effects: The F-statistic for the within-subjects factor “Time” is 4022, with an associated p-value of < .001, indicating a statistically significant effect of Time on flexibility. The generalized eta-squared (η²G) is 0.160, which suggests that approximately 16% of the total variability in flexibility scores can be attributed to the changes across the three time points.

  2. Post hoc comparisons: The post hoc test results provide pairwise comparisons between the time points. All comparisons are statistically significant at the Bonferroni-adjusted alpha level:

    • Time 1 vs. Time 2: The mean difference is -2.51, indicating that flexibility scores are, on average, 2.51 units lower at Time 1 compared to Time 2. The p-value is < .001, suggesting a statistically significant difference between Time 1 and Time 2.

    • Time 1 vs. Time 3: The mean difference is -5.51, indicating that flexibility scores are, on average, 5.51 units lower at Time 1 compared to Time 3. The p-value is < .001, suggesting a statistically significant difference between Time 1 and Time 3.

    • Time 2 vs. Time 3: The mean difference is -3.00, indicating that flexibility scores are, on average, 3.00 units lower at Time 2 compared to Time 3. The p-value is < .001, suggesting a statistically significant difference between Time 2 and Time 3.

In summary, the repeated measures ANOVA shows a statistically significant effect of Time on flexibility scores, with flexibility increasing across the three time points. All pairwise comparisons between time points are statistically significant, with flexibility scores consistently increasing from Time 1 to Time 3.

9.6 APA Style

The results for this analysis can be written following the APA Style as shown below.

The results of the one-way repeated measures ANOVA revealed a significant effect of time on flexibility, F(2, 88) = 4022, p < .001, η²G = .160. Post hoc tests with Bonferroni correction demonstrated significant differences between all pairwise comparisons. Flexibility scores were significantly lower at Time 1 compared to Time 2 (M difference = -2.51, SE = 0.0754, p < .001) and Time 3 (M difference = -5.51, SE = 0.0754, p < .001). Additionally, flexibility scores were significantly lower at Time 2 compared to Time 3 (M difference = -3.00, SE = 1.49e-8, p < .001). Overall, flexibility scores increased consistently across the three time points.

10 Nonparametric

The nonparametric equivalent of the repeated measures ANOVA (rANOVA) is the Friedman test. The Friedman test is a rank-based test that is used when the assumptions of a parametric rANOVA are not met, such as when the data is not normally distributed or when the sphericity assumption is violated.

The Friedman test is suitable for analyzing data from repeated measures designs with a single within-subjects factor (e.g., time). It tests the null hypothesis that there are no differences between the time points or conditions. The test compares the mean ranks of the related groups rather than the raw scores.

Here are the steps to run the Friedman test in jamovi, SPSS, and R:

jamovi:

  1. Open jamovi and import your dataset (.csv or .sav format).
  2. Click on the “ANALYSES” tab at the top of the window.
  3. Go to “ANOVA” > “Friedman Test”.
  4. Drag the repeated measures variables (e.g., Flex_Time1, Flex_Time2, Flex_Time3) into the “Repeated Measures” box.
  5. The results will automatically be displayed in the “Results” panel. You can view the Friedman test statistic, degrees of freedom, and p-value.

SPSS:

  1. Open SPSS and import your dataset (.sav format).
  2. Click on “Analyze” in the top menu.
  3. Go to “Nonparametric Tests” > “Related Samples”.
  4. In the “Related Samples” dialog box, select the Friedman test by checking the box next to “Friedman”.
  5. Move the repeated measures variables (e.g., Flex_Time1, Flex_Time2, Flex_Time3) into the “Test Variables” list.
  6. Click “OK” to run the test.
  7. The output window will display the Friedman test results, including the test statistic, degrees of freedom, and p-value.

For post hoc pairwise comparisons, you can perform the Wilcoxon signed-rank test in both jamovi and SPSS. Remember to adjust the significance level for multiple comparisons, such as using the Bonferroni correction.

R:

Here are the steps to conduct the Friedman test in R within a single code environment:

# Import data
data <- read.csv("your_data_file.csv")

# Install and load required packages
if (!requireNamespace("tidyverse", quietly = TRUE)) {
  install.packages("tidyverse")
}
library(tidyverse)

# Reshape data to long format
data_long <- data %>%
  pivot_longer(cols = starts_with("Flex_Time"),
               names_to = "Time",
               values_to = "Value")

# Conduct Friedman test
friedman_test <- friedman.test(Value ~ Time | ID, data = data_long)

# Print results
print(friedman_test)

Image credit

Illustration by Elisabet Guba from Ouch!

References

Furtado, O. (2023, April 8). RandomStats - One-Way ANOVA [Blog]. RandomStats. https://drfurtado.github.io/randomstats/posts/04082023-one-way-anova/

Reuse

Citation

BibTeX citation:
@misc{furtado2023,
  author = {Furtado, Ovande},
  title = {Repeated-Measures {ANOVA}},
  pages = {undefined},
  date = {2023-04-16},
  url = {https://drfurtado.github.io/randomstats/posts/04152023-r_anova},
  langid = {en}
}
For attribution, please cite this work as:
Furtado, O. (2023, April 16). Repeated-Measures ANOVA. RandomStats, undefined. https://drfurtado.github.io/randomstats/posts/04152023-r_anova