mtorchiano / effsize

Effsize - a package for efficient effect size computation
GNU General Public License v2.0
104 stars 11 forks source link

effsize Hedges g with paired #32

Closed mtorchiano closed 5 years ago

mtorchiano commented 5 years ago

From email received by maintainer:

If I run something like cohen.d(myData$after,myData$before, na.rm=TRUE, pooled=TRUE, paired=TRUE, hedges.correction=TRUE)

I suspect the Hedges correction that is used is: 1 - 3/(4*(n1+n2-2)-1), or as on Wikipedia 1 - 3/(4*(n1+n2) - 9), where n1 is the number of cases is the first variable, and n2 of the second. This is the correction for independent samples, not for paired.

The paired version should be I think: 1 - 3/(4*(n - 1) - 1), where n is the number of pairs.

This can be seen for example on page 9 and 10 in chapter 4 of Introduction to Meta-Analysis. Michael Borenstein, L. V. Hedges, J. P. T. Higgins and H. R. Rothstein (chapter available here: https://www.meta-analysis.com/downloads/Meta-analysis%20Effect%20sizes%20based%20on%20means.pdf )

Also on page 275 of Gibbons, Hedeker, and Davis (1993) they write that  "this is perhaps a greater problem in the paired sample case since v = n - 1 and not n1 + n2 - 2, as in the two independent sample case". Hedges (1981) original article on p 114 also shows the general formula to be 1 - 3/(4m-1), where m is the degrees of freedom.

References used:

  1. Gibbons, R. D., Hedeker, D. R., & Davis, J. M. (1993). Estimation of Effect Size From a Series of Experiments Involving Paired Comparisons. Journal of Educational Statistics, 18(3), 271–279. doi:10.3102/10769986018003271

  2. Hedges, L. V. (1981). Distribution Theory for Glass’s Estimator of Effect Size and Related Estimators. Journal of Educational Statistics, 6(2), 107–128. doi:10.2307/1164588

mtorchiano commented 5 years ago

Actually the formula used is the one reported on line 93 of source file CohenD.R

The issue is confirmed bug.

mtorchiano commented 5 years ago

Issue solved. Will be released in v.0.7.5