rstatisticsanovainteractionposthoc

Testing for interactions using the aligned rank transformation test (non-parametric two-way ANOVA)


I am completing an aligned rank transformation as follows, using the ARTool package:

model = art(Proportioncorrect~Trialtype+Method+Trialtype:Method,data=Cummulativecounting)
I have two factors (independent variables), being Method and Trial type My dependent variable is the proportion of correct trials (Proportioncorrect)

Anova(model)

Analysis of Variance of Aligned Rank Transformed Data

Table Type: Anova Table (Type III tests) 
Model: No Repeated Measures (lm)
Response: art(Proportioncorrect)

                   Df Df.res F value     Pr(>F)    
1 Trialtype         1     26 41.1793 8.4687e-07 ***
2 Method            1     26  8.6554  0.0067722  **
3 Trialtype:Method  1     26  5.3010  0.0295733   *
---
Signif. codes:   0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

I want to test for an interaction between these two factors, and so I have tried the following command, which I know is testing contrasts between contrasts:

testInteractions(artlm(model, "Trialtype:Method"), pairwise=c("Trialtype", "Method"),adjust="bonferroni")

F Test:
P-value adjustment method: bonferroni
                                        Value Df Sum of Sq     F  Pr(>F)
Beaconed-Probe : Counting-Not-counting 17.667  1    374.53 5.301 0.02957 *
Residuals                                     26   1837.00
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ‘ ’ 1
However, I want to compare the results for Trial Type across Method.

Thus, I have tried the formula below using the phia package:

(testInteractions(model, pairwise="Method" ,across="Trialtype",adjust="bonferroni")

However, I get this error: Error in terms.default(model) : no terms component nor attribute

Would anybody be kind enough to give me a helping hand?

Here is my raw data:

structure(list(ID = c("P_200214123342", "P_200224092247", "P_200219163622", 
"P_200220130332", "P_200219091823", "P_200225184226", "P_200219123120", 
"P_200219175102", "P_200214103155", "P_200219111605", "P_200217101213", 
"P_200219102411", "P_200221101028", "P_200220145557", "P_200225171612", 
"P_200224092247", "P_200219163622", "P_200220130332", "P_200214123342", 
"P_200219091823", "P_200225184226", "P_200219123120", "P_200219175102", 
"P_200214103155", "P_200219111605", "P_200217101213", "P_200219102411", 
"P_200221101028", "P_200220145557", "P_200225171612"), Trialtype = c("Beaconed", 
"Beaconed", "Beaconed", "Beaconed", "Beaconed", "Beaconed", "Beaconed", 
"Beaconed", "Beaconed", "Beaconed", "Beaconed", "Beaconed", "Beaconed", 
"Beaconed", "Beaconed", "Probe", "Probe", "Probe", "Probe", "Probe", 
"Probe", "Probe", "Probe", "Probe", "Probe", "Probe", "Probe", 
"Probe", "Probe", "Probe"), Proportioncorrect = c(66.666667, 
97.333333, 66.666667, 88, 54.666667, 92, 97.333333, 90.666667, 
96, 90.666667, 96, 90.666667, 96, 96, 93.333333, 29.333333, 16, 
14.666667, 6.666667, 8, 16, 13.333333, 21.333333, 16, 26.666667, 
33.333333, 24, 21.333333, 62.666667, 93.333333), Method = c("Counting", 
"Counting", "Counting", "Counting", "Counting", "Counting", "Counting", 
"Not-counting", "Counting", "Counting", "Counting", "Counting", 
"Counting", "Not-counting", "Not-counting", "Counting", "Counting", 
"Counting", "Counting", "Counting", "Counting", "Counting", "Not-counting", 
"Counting", "Counting", "Counting", "Counting", "Counting", "Not-counting", 
"Not-counting")), row.names = c(NA, -30L), class = "data.frame")

Solution

  • I know this was posted a while ago, but for anyone else who ends up here; I believe what you are looking for is art.con() (look here for more information: https://cran.r-project.org/web//packages/ARTool/vignettes/art-contrasts.html).

    I'm not sure what your experimental design is, however, if you are using Bonferroni to adjust for repeated measures, I realized that your aligned rank transform call doesn't include an Error term to tell ART that you're using a repeated measures design; so, I will assume here that you didn't want a repeated measures design and the Bonferroni corrections in your contrast tests are unnecessary. Therefore, I think all you need to do is simply:

    art.con(m, "trialType:Method")
    

    Additionally, you can add adjust = "bonf" if you want to include Bonferroni corrections in your contrast tests.

    Finally, your post mentions the contrast of contrasts, and if you still want to perform that test, you need only add interaction = TRUE to your function call:

    art.con(m, "trialType:Method", interaction = TRUE))