Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't verify post hoc effect size option from ancova() #306

Open
carlosivanr opened this issue May 27, 2021 · 2 comments
Open

Can't verify post hoc effect size option from ancova() #306

carlosivanr opened this issue May 27, 2021 · 2 comments

Comments

@carlosivanr
Copy link

carlosivanr commented May 27, 2021

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
@jonathon-love
Copy link
Member

could you try using the latest version of jmv from our repo, and see if that brings things into alignment?

remotes::install_github('jamovi/jmv')

# this might be necessary first, not sure:

remotes::install_github('jamovi/jmvcore')

CRAN raised a bunch of requirements for submitting packages, which make it difficult for us to push updates.

with thanks

jonathon

@carlosivanr
Copy link
Author

Hi Jonathon,

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)

remotes::install_github('jamovi/jmvcore')

Thanks again,

C

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants