Welcome to the Repeated Measurement ANOVA Workflow repository! This project provides a comprehensive R-based workflow for conducting repeated measures ANOVA using the ez
package. It integrates data wrangling via tidyverse
and visualization through ggplot2
. This repository serves as a guide for importing data, transforming it to long format, performing statistical analysis, and creating graphical summaries.
You can find the latest releases here. Make sure to download and execute the files to get started!
- Introduction
- Installation
- Usage
- Workflow Overview
- Data Import
- Data Transformation
- Statistical Analysis
- Graphical Summary
- Example Dataset
- Contributing
- License
- Acknowledgments
Repeated measures ANOVA is a statistical technique used when the same subjects are measured multiple times. This method helps in understanding how different conditions affect the same subjects over time. The ez
package simplifies this process in R, making it easier to conduct analyses and interpret results.
To use this workflow, you need to have R and RStudio installed on your computer. Follow these steps to set up the necessary packages:
-
Install R from CRAN.
-
Install RStudio from RStudio.
-
Open RStudio and run the following commands to install the required packages:
install.packages(c("ez", "tidyverse", "ggplot2"))
You can also clone this repository to your local machine using the following command:
git clone https://github.com/Angellrdz/repeated-measurement.git
To get started with the repeated measurement ANOVA workflow, follow these steps:
- Load the necessary libraries.
- Import your dataset.
- Transform the data to long format.
- Conduct the repeated measures ANOVA.
- Create visualizations to summarize the results.
For detailed instructions, refer to the sections below.
The workflow consists of several key steps:
- Data Import: Load your dataset into R.
- Data Transformation: Reshape the data to long format using
tidyverse
. - Statistical Analysis: Use the
ez
package to conduct repeated measures ANOVA. - Graphical Summary: Visualize the results using
ggplot2
.
To import your dataset, you can use the read_csv
function from the tidyverse
. Here’s an example:
library(tidyverse)
data <- read_csv("path/to/your/data.csv")
Make sure to replace "path/to/your/data.csv"
with the actual path to your dataset.
Once you have imported your data, you may need to transform it to long format. This can be done using the pivot_longer
function from the tidyverse
. Here’s how:
long_data <- data %>%
pivot_longer(cols = starts_with("measurement"),
names_to = "condition",
values_to = "value")
This will reshape your data, making it suitable for repeated measures ANOVA.
With your data in long format, you can conduct the repeated measures ANOVA using the ezANOVA
function from the ez
package. Here’s an example:
library(ez)
anova_results <- ezANOVA(data = long_data,
dv = value,
wid = subject_id,
within = condition)
This will return the ANOVA results, including F-values and p-values.
Visualizing your results can help in understanding the data better. Use ggplot2
to create plots. Here’s a simple example:
library(ggplot2)
ggplot(long_data, aes(x = condition, y = value)) +
geom_boxplot() +
theme_minimal() +
labs(title = "Repeated Measures ANOVA Results",
x = "Condition",
y = "Value")
This code will generate a boxplot of your results.
For testing purposes, you can use the example dataset provided in this repository. Download it from the Releases section and load it into R as shown in the Data Import section.
Contributions are welcome! If you would like to improve this workflow or add new features, please fork the repository and submit a pull request. Ensure that your code follows the style guidelines and includes appropriate documentation.
This project is licensed under the MIT License. See the LICENSE file for details.
Thanks to the developers of the ez
, tidyverse
, and ggplot2
packages for their excellent work in the R community. Their contributions make data analysis accessible and efficient.
For the latest releases, visit here. Make sure to download and execute the files to get started!