mtorchiano / effsize

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

Hedges's correction for one-sample Cohen's d use a different formula #55

Open filippogambarota opened 4 years ago

filippogambarota commented 4 years ago

I've tried to correct the cohen's d using the hedges's correction however I've realized that using the cohen.d() formula, degrees of freedom are calculated using n-2 even in a one-sample design. From Borenstein (2009) book the correction for the paired t-test situation is calculated using n-1.

```{r}
# Vector
x = rnorm(10, 55, 1)
pop = 50
x = x - pop
n = length(x)

# Effect size
eff_size_uncor = cohen.d(x ~ 1, hedges.correction = F) # uncorrected
eff_size_cor = cohen.d(x ~ 1, hedges.correction = T) # corrected

heg_corr = 1 - (3/(4*(n-2)-1)) # hedge's correction

eff_size_uncor$estimate * heg_corr
eff_size_cor$estimate

heg_corr = 1 - (3/(4*(n-1)-1)) # hedge's correction n-1

eff_size_uncor$estimate * heg_corr

# diff

(eff_size_uncor$estimate * heg_corr) - eff_size_cor$estimate

Is there a reason for this formula? Thanks!