You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there. I'm relatively new to the jmv package and have been trying it in R. I really like it so far, but I'm running into an issue with calculating effect sizes for the post hoc tests in a one way ANCOVA with three groups. I'm using a sample dataset from Maxwell, Delaney, & Kelly's text in the AMCP R package. I've tried running the analysis with jmv and with an approach described in Field et al., 2012. Everything checks out for the two approaches except for the effect sizes in the post-hoc comparisons. I'm attaching a copy of the code which should run as long as the packages are installed. Is there something that I'm missing about how to properly configure the ancova() function in jmv? Any help on this would be greatly appreciated.
# --- One way ANCOVA jmv
library(AMCP)
library(jmv)
# Load data
data(chapter_9_table_7)
# Convert group to factor
chapter_9_table_7$Condition <- as.factor(chapter_9_table_7$Condition)
# one way ANCOVA in jmv
ancova(formula = Post ~ Pre + Condition,
data = chapter_9_table_7,
ss = "3",
effectSize = 'partEta',
postHoc = ~ Condition,
postHocCorr = 'bonf',
postHocES = "d",
emMeans = ~ Condition)
# Effect sizes are 0.3361555, 0.4873439, 0.1508555
# ---- One way ANCOVA non-jmv
# Approach described in Field et al., 2012
library(car)
library(effects)
library(compute.es)
# Create ANCOVA model
model <- aov(Post ~ Pre + Condition, data = chapter_9_table_7)
# Display type 3 ss results
Anova(model, type = "3")
# Display emmeans and confidence intervals
em_means <- effect("Condition", model, se = TRUE)
summary(em_means)
# Display the standar errors
em_means$se
# Display the standard deviations, estimated by multiplying se by the sqrt of n
n <- c(10,10,10)
em_means$se*sqrt(n)
# Use the em_means, sd, and n for post hoc effect sizes
# Grp 1 vs 2
mes(7.536616, 11.984895, 5.398312, 5.397476, 10, 10 )
# Grp 1 vs 3
mes(7.536616, 13.978489, 5.398312, 5.393536, 10, 10)
# Grp 2 vs 3
mes(11.984895, 13.978489, 5.397476, 5.393536, 10, 10)
# Effect sizes are 0.82, 1.19, 0.37
The text was updated successfully, but these errors were encountered:
Thanks! The post-hoc effect sizes are now displayed correctly. That's a bummer to hear that there are barriers to getting packages updated. Good thing there a work around and will keep it in mind if I run into anything else down the line.
For what it's worth, I did have to run this line to get things to work and I'm running Rstudio 1.2.5042, R 4.0.0, and macOS 10.15.7 (Catalina)
Hi there. I'm relatively new to the jmv package and have been trying it in R. I really like it so far, but I'm running into an issue with calculating effect sizes for the post hoc tests in a one way ANCOVA with three groups. I'm using a sample dataset from Maxwell, Delaney, & Kelly's text in the AMCP R package. I've tried running the analysis with jmv and with an approach described in Field et al., 2012. Everything checks out for the two approaches except for the effect sizes in the post-hoc comparisons. I'm attaching a copy of the code which should run as long as the packages are installed. Is there something that I'm missing about how to properly configure the ancova() function in jmv? Any help on this would be greatly appreciated.
The text was updated successfully, but these errors were encountered: