Pooled errror term for RM factor for posthoc tests
Hi!
I was hoping someone could help me with a small issue...
In short - I have a RM ANOVA with three levels (remember, control, forgot). The significant main effect is followed with posthoc tests.
In JASP, I can chose whether I want to pool the error term for the RM factors (when running the posthoc tests). In r, however, it is pooled automatically.... Is there any way to prevent r from doing this?....
Im adding my few lines of code below. I hope someone can help me with this! :)
# Creates contrasts for condition
contrast_list_forCondition <- list(c_remcon = c(-1, 0, 1), c_remfor = c(0, -1, 1), c_confor = c(-1, 1, 0))
# anova + posthoc tests
res.aov_memory <- aov(memoryperc ~ (Motivation) + Error(pp/(Motivation)), data = data_memory_resh)
leastsquare_2 = lsmeans(res.aov_memory, "Motivation")
res.contrasts_memory = summary(contrast(leastsquare_2, contrast_list_forCondition, adjust = "bonf"))
Thank you!
Nathalie
Comments
Hi Nathalie,
That's a good point - we use the emmeans package for most of the posthoc/marginal means/contrast computations, but in order to use the unpooled error term, we do these computations manually. The R code that JASP uses takes the observations for each group, computes the average for each subject, and then runs individual paired samples t-tests to evaluate each contrast. The SE then equals the estimated mean difference divided by the t statistic.
Does that clarify the issue, or should I provide some R code? It would be from within JASP, so will not be completely "plug and play" unfortunately.
Cheers
Johnny