04 June 2022 1 2K Report

I'm trying to run a robust mixed ANOVA with a between groups factor (2 levels) and a within groups factor (3 levels). I'd ideally like to be able to set and run planned contrasts, have a full set of relevant summary statistics (presumably I'd report summary stats for the trimmed means rather than the original means..), and then calculate effect sizes for the contrasts.

I'm new to R (I attempted to teach it to myself over the weekend) so if you can explain R language stuff at the most basic level imaginable then that would be appreciated..

Following Field (Discovering Statistics using R, 2012 (I'm much better acquainted with his SPSS version of this)) and Wilcox (Introduction to Robust Estimation and Hypothesis Testing, 2013) I've downloaded Rallfun-v40.txt to my working directory from https://dornsife.usc.edu/labs/rwilcox/software and then brought its contents into R using source(file.choose()).

From this I've followed Field's instructions and run the following on my data (converted to wide format such that the columns are betweenL1_withinL1 betweenL1_withinL2 ... betweenL2_withinL3 )

```bwtrim(2, 3, data, tr = .2) # using 20% trimmed means```

And then I've also run the following three lines of code:

```

sppba(2, 3, data, est = mom, nboot = 2000)

sppbb(2, 3, data, est = mom, nboot = 2000)

sppbi(2, 3, data, est = mom, nboot = 2000)

```

The output from bwtrim() is straightforward enough to understand. It gives me test statistics (Q) for both factors and their interaction, each accompanied by a p-value.

I don't really understand what the output from the remaining three lines gives me. The R-documentation tells me "The functions sppba, sppbb, and sppbi compute the main fixed effect, the main within-subjects effect, and the interaction effect only, respectively, using bootstrap."

It seems to return test statistics (psi hat), a p-value, and a table of contrast codes as follows:

```

sppba(2, 3, data, est = mom, nboot = 2000)

$p.value

[1] 0.112

$psihat

[1] -5.577981

$con

[,1]

[1,] 1

[2,] -1

sppbb(2, 3, data, est = mom, nboot = 2000)

$p.value

[1] 0.4562719

$center

[1] 2.9931670 -0.4448510 0.5338472

sppbi(2, 3, data, est = mom, nboot = 2000)

$p.value

[1] 0.58

$psihat

[1] -5.345118 -5.875428 1.012981

$con

[,1] [,2] [,3]

[1,] 1 0 0

[2,] 0 1 0

[3,] 0 0 1

[4,] -1 0 0

[5,] 0 -1 0

[6,] 0 0 -1

```

Can you explain this output to me? What do the three statistics for sppbb and sppbi tell me? Why are there not contrast codes for sppbb? Most importantly... where are the contrasts themselves? Are these the psi hat statistics?! To whatever extent the above code doesn't already do this, can you also give me advice on my initial aim: "to set and run planned contrasts, have a full set of relevant summary statistics (presumably I'd report summary stats for the trimmed means rather than the original means..), and then calculate effect sizes for the contrasts"

Finally, I also ran a robust mixed anova with bootstrapping and a 20% trimmed mean (hopefully I inputted the arguments correctly...) as follows:

bwtrimbt(2, 3, data, tr=0.2,JK=2*3,nboot=2000)

This had the result of making a significant interaction from the original bwtrim() calculation only marginally significant. How would you interpret this? Am I better off using bwtrimbt? The data for each of the columns in my wide format dataset is not normal and the (between) group sizes are n=17 and n=21.

More Sam Leak's questions See All
Similar questions and discussions