r – Post-hoc tests for repeated measures ANOVA with aligned rank transformed (ART) data: A Step-by-Step Guide
Image by Elmeria - hkhazo.biz.id

r – Post-hoc tests for repeated measures ANOVA with aligned rank transformed (ART) data: A Step-by-Step Guide

Posted on

Are you struggling to perform post-hoc tests for repeated measures ANOVA with aligned rank transformed (ART) data in R? Look no further! In this article, we’ll take you through a comprehensive guide on how to conduct post-hoc tests with ART data using R. We’ll cover the basics of ART, why we need post-hoc tests, and provide a step-by-step procedure on how to perform these tests using R.

What is Aligned Rank Transformation (ART)?

Aligned Rank Transformation (ART) is a non-parametric method for analyzing repeated measures data. It’s an extension of the classical Friedman test, which is used to compare the distribution of a continuous outcome variable across multiple related groups. ART is more powerful than the Friedman test and can handle more complex designs, making it a popular choice for researchers.

Why do we need post-hoc tests?

When performing an ANOVA, we’re often interested in identifying which specific groups or conditions are significantly different from one another. Post-hoc tests help us to do just that. They allow us to compare the means of specific groups or conditions, taking into account the family-wise error rate (FWER) to avoid false positives. In the context of ART, post-hoc tests help us to identify which specific aligned ranks are significantly different from one another.

Preparing your data

Before we dive into the post-hoc tests, let’s make sure our data is in order. For this example, we’ll use a sample dataset called ‘data’ with three columns: ‘Subject’, ‘Condition’, and ‘Outcome’. The ‘Subject’ column represents the individual subjects in our study, the ‘Condition’ column represents the different conditions or groups we’re comparing, and the ‘Outcome’ column represents the continuous outcome variable we’re interested in.

data
   Subject Condition Outcome
1       1       A     10.2
2       1       B     12.1
3       1       C     11.5
4       2       A     11.8
5       2       B     10.9
6       2       C     12.8
7       3       A     10.5
8       3       B     12.5
9       3       C     11.2
10      4       A     11.2
11      4       B     10.8
12      4       C     12.5
...

Performing the ANOVA with ART

To perform the ANOVA with ART, we’ll use the ‘art’ package in R. First, we need to install and load the package:

install.packages("art")
library(art)

Next, we’ll perform the ANOVA with ART:

art_model <- art(Outcome ~ Condition | Subject, data = data)
summary(art_model)

The output will show the results of the ANOVA, including the p-value and F-statistic.

Post-hoc tests with ART

Now that we have our ANOVA results, it’s time to perform the post-hoc tests. There are several options for post-hoc tests with ART, including the ’emmeans’ package and the ‘phia’ package. For this example, we’ll use the ’emmeans’ package.

Installing and loading the ’emmeans’ package

install.packages("emmeans")
library(emmeans)

Performing the post-hoc tests

To perform the post-hoc tests, we’ll use the ’emmeans’ function:

posthoc <- emmeans(art_model, pairwise ~ Condition, adjust = "bonferroni")
summary(posthoc)

The output will show the results of the post-hoc tests, including the estimated marginal means, standard errors, and p-values for each pairwise comparison. The ‘adjust = “bonferroni”‘ argument is used to apply the Bonferroni correction to the p-values to control for the family-wise error rate.

Interpreting the results

The output from the post-hoc tests will show which specific pairwise comparisons are significant. For example, if the output shows a significant difference between Condition A and Condition B, we can conclude that the aligned ranks for Condition A are significantly different from the aligned ranks for Condition B.

Condition Condition Estimate SE df t.ratio p.value
A B -1.23 0.45 12 -2.73 0.019
A C -2.56 0.63 12 -4.03 < 0.001
B C -1.33 0.51 12 -2.61 0.021

In this example, the output shows significant differences between Condition A and Condition C, as well as between Condition B and Condition C. The p-values have been adjusted using the Bonferroni correction.

Conclusion

In this article, we’ve covered the basics of Aligned Rank Transformation (ART) and how to perform post-hoc tests with ART data using R. We’ve provided a step-by-step guide on how to prepare your data, perform the ANOVA with ART, and conduct post-hoc tests using the ’emmeans’ package. By following these steps, you’ll be able to identify which specific pairwise comparisons are significant, taking into account the family-wise error rate.

Further reading

We hope this article has been helpful in guiding you through the process of performing post-hoc tests with ART data in R. Happy coding!

Frequently Asked Question

Get to know the ins and outs of r Post-hoc tests for repeated measures ANOVA with aligned rank transformed (ART) data!

What is the purpose of using aligned rank transformed (ART) data in repeated measures ANOVA?

The primary purpose of using aligned rank transformed (ART) data is to overcome the limitations of traditional repeated measures ANOVA, which assumes normality and homogeneity of variance. ART data helps to normalize the residuals, making it more suitable for non-parametric and robust analysis. This approach is particularly useful when working with datasets that exhibit non-normality or unequal variances.

Which R packages can be used for post-hoc tests with aligned rank transformed (ART) data?

Several R packages can be used for post-hoc tests with aligned rank transformed (ART) data, including ARTool, agricolae, and PMCMRplus. These packages provide a range of functions and methods for conducting post-hoc tests, such as pairwise comparisons and multiple comparisons, on ART data.

How do I interpret the results of post-hoc tests with aligned rank transformed (ART) data?

When interpreting the results of post-hoc tests with aligned rank transformed (ART) data, it’s essential to consider the ranks and p-values. Specifically, look for significant p-values (typically < 0.05) and examine the ranks to determine which groups differ significantly. You can also use visualization tools, such as box plots or violin plots, to explore the distribution of ranks and better understand the results.

What are some common mistakes to avoid when conducting post-hoc tests with aligned rank transformed (ART) data?

Some common mistakes to avoid when conducting post-hoc tests with aligned rank transformed (ART) data include not checking for normality and homogeneity of variance, using the wrong type of post-hoc test, and not adjusting for multiple comparisons. It’s also essential to ensure that the ART transformation is applied correctly and that the data meet the assumptions of the test.

Can I use aligned rank transformed (ART) data for other types of statistical analyses beyond repeated measures ANOVA?

Yes, aligned rank transformed (ART) data can be used for other types of statistical analyses beyond repeated measures ANOVA, such as linear regression, generalized linear models, and time series analysis. The ART transformation can be applied to various types of data to improve normality and stabilize variance, making it a versatile tool for robust statistical analysis.