Skip to content

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

@jwilmer

Description

@jwilmer

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions