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

Computation of Cohen's d for meanDiff when paired=TRUE needs a simple fix #16

Open
jwilmer opened this issue May 13, 2020 · 0 comments
Open

Comments

@jwilmer
Copy link

jwilmer commented May 13, 2020

I noticed the following, easy-to-fix error in the computation of Cohen's d for paired design in meanDiff.R

Line 274, which currently reads...
res$meanDiff.d <- res$meanDiff/res$diff.sd;
...should be changed to...
res$meanDiff.d <- res$meanDiff/res$sd.withingroups

I checked the Bornstein et al (2009) reference, which says to compute Cohen's d by dividing by Swithin (formula 4.27).
This formula is already being computed on line 267 of meanDiff as...
res$sd.withingroups <- res$diff.sd / (sqrt(2*(1-res$correlation)));
...but then line 274 mistakenly divides by res$diff.sd rather than res$sd.withingroups

p.s. I am a HUGE fan of RosettaStats and the userfriendlyscience package, which has been an incredible asset to my teaching stats this semester via rstudio.cloud. I've posted a fix here that we are using (and others can use) until this issue is resolved: source("https://bit.ly/meanDiffFix")

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

1 participant