-
Notifications
You must be signed in to change notification settings - Fork 29
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
Incorrect CI bars for repeated measures ANOVA (standard and Bayesian) #1187
Comments
Hi @Angalanse, Thanks for your report. What options did you use for the plots? For the frequentist RM ANOVA, you can either plot by CI or standard error, which can lead to different sized intervals. Also, have you averaged across the unused RM factors, by ticking the corresponding box? This can also have a big impact on the result. It's a bit puzzling though why also the Bayesian RM ANOVA is giving different results. Kind regards, |
Hi @Angalanse , Thanks for the data set. The discrepancy of the results comes from the fact that JASP applies a correction to the intervals (see also the help file for the RM ANOVA):
below is R code that reproduces both versions of the results (SPSS first for the uncorrected intervals, and then the JASP results with the corrected results). Kind regards,
|
Thanks Johnny! That’s interesting!
L
Från: JohnnyDoorn <notifications@github.com>
Skickat: den 2 mars 2021 10:19
Till: jasp-stats/jasp-issues <jasp-issues@noreply.github.com>
Kopia: Linus Andersson <linus.andersson@umu.se>; Mention <mention@noreply.github.com>
Ämne: Re: [jasp-stats/jasp-issues] Incorrect CI bars for repeated measures ANOVA (standard and Bayesian) (#1187)
Hi @Angalanse<https://github.com/Angalanse> ,
Thanks for the data set. The discrepancy of the results comes from the fact that JASP applies a correction to the intervals (see also the help file for the RM ANOVA):
In order to get accurate confidence intervals and standard errors, the data are normalized by subtracting the appropriate participantʹs mean performance from each observation, and then adding the grand mean score to every observation. The variances of the resulting normalized values in each condition, and thus the size of the bars, no longer depend on the participant effects and are therefore a more accurate representation of the experimental manipulation. See Morey (2008) for a thorough discussion of this procedure.
The paper in question can be found here<http://pcl.missouri.edu/sites/default/files/morey.2008.pdf>.
below is R code that reproduces both versions of the results (SPSS first for the uncorrected intervals, and then the JASP results with the corrected results).
Kind regards,
Johnny
dat <- read.csv2("~/Downloads/ForVanDoorn.csv", dec = ",")
# convert wide data to long data
longDat <- reshape2::melt(dat, measure.vars = 3:11)
# compute anova and marginal means with afex and emmeans UNCORRECTED
res <- afex::aov_ez(id = "FPID", dv = "value", data = longDat, between = "Sex", within = "variable")
mMeans <- emmeans::emmeans(res, specs = c("variable", "Sex"))
# compute pp means to apply Morey correction
idMeans <- tapply(longDat$value, longDat$FPID, mean)
longDat$value <- longDat$value - idMeans[longDat$FPID]
# compute anova and marginal means with afex and emmeans CORRECTED
resCor <- afex::aov_ez(id = "FPID", dv = "value", data = longDat, between = "Sex", within = "variable")
mMeansCor <- emmeans::emmeans(resCor, specs = c("variable", "Sex"))
# plot marginal means
plot(mMeans)
plot(mMeansCor)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#1187 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ATBIGIVJ5WETBOJGQM7YZITTBSUP5ANCNFSM4YMXACFA>.
|
Just a follow-up Johnny,
One of the arguments in the paper you linked to was that the new confidence intervals are more aligned with the results of the (significant) t-test in the paper. The pedagogical problem I see with the RM ANOVA example I provided is that readers who are used to glancing at the figure to get an overview of the results would probably expect an immense difference between the two factors (men / women). However, there is no supported / significant difference.
L
Från: JohnnyDoorn <notifications@github.com>
Skickat: den 2 mars 2021 10:19
Till: jasp-stats/jasp-issues <jasp-issues@noreply.github.com>
Kopia: Linus Andersson <linus.andersson@umu.se>; Mention <mention@noreply.github.com>
Ämne: Re: [jasp-stats/jasp-issues] Incorrect CI bars for repeated measures ANOVA (standard and Bayesian) (#1187)
Hi @Angalanse<https://github.com/Angalanse> ,
Thanks for the data set. The discrepancy of the results comes from the fact that JASP applies a correction to the intervals (see also the help file for the RM ANOVA):
In order to get accurate confidence intervals and standard errors, the data are normalized by subtracting the appropriate participantʹs mean performance from each observation, and then adding the grand mean score to every observation. The variances of the resulting normalized values in each condition, and thus the size of the bars, no longer depend on the participant effects and are therefore a more accurate representation of the experimental manipulation. See Morey (2008) for a thorough discussion of this procedure.
The paper in question can be found here<http://pcl.missouri.edu/sites/default/files/morey.2008.pdf>.
below is R code that reproduces both versions of the results (SPSS first for the uncorrected intervals, and then the JASP results with the corrected results).
Kind regards,
Johnny
dat <- read.csv2("~/Downloads/ForVanDoorn.csv", dec = ",")
# convert wide data to long data
longDat <- reshape2::melt(dat, measure.vars = 3:11)
# compute anova and marginal means with afex and emmeans UNCORRECTED
res <- afex::aov_ez(id = "FPID", dv = "value", data = longDat, between = "Sex", within = "variable")
mMeans <- emmeans::emmeans(res, specs = c("variable", "Sex"))
# compute pp means to apply Morey correction
idMeans <- tapply(longDat$value, longDat$FPID, mean)
longDat$value <- longDat$value - idMeans[longDat$FPID]
# compute anova and marginal means with afex and emmeans CORRECTED
resCor <- afex::aov_ez(id = "FPID", dv = "value", data = longDat, between = "Sex", within = "variable")
mMeansCor <- emmeans::emmeans(resCor, specs = c("variable", "Sex"))
# plot marginal means
plot(mMeans)
plot(mMeansCor)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#1187 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ATBIGIVJ5WETBOJGQM7YZITTBSUP5ANCNFSM4YMXACFA>.
|
@JohnnyDoorn I have a related question. I have noticed in later editions of JASP that 95% Credible-intervals of RM-ANOVAS are much smaller than the 95% credible interval given in the Descriptives tables. As I understand the above discussion this is intended for frequentist confidence intervals, but not for bayesian credible intervals. Is it then a bug? I am currently using old intervals for my paper that I plotted with an older version of JASP where there was no discrepancy between the 95% credible intervlas from the descriptives table and the 95% credible intervals from the descriptive plots. But I would like to know if the smaller intervals that are currently plotted are actually "more" correct. PS. Note if I should start a new issue on this, but it seems highly related. EDIT: Basically the Credible intervals look identical to the Confidence intervals (which I think is by design given that a uniform prior is used for the decriptive plots) - thus I guess the same correction is used for the Bayesian Credible intervals. Is that resonable? Best, |
@AugustOlsson |
I'll test it during next week and get back to you! |
@AugustOlsson @Angalanse |
Thanks for the update @tomtomme. I would really really like the option to get CIs without Morey correction though. If it was possible to include a choice to add/not add Morey correction that would be greatly apprechiated. Best, |
Yep. This is still on the todo list at #1227 |
@AugustOlsson |
The text was updated successfully, but these errors were encountered: