Definition

It is used to estimate the population mean \(\mu\)

\[d=\frac{\overline{X}_1 - \overline{X}_2}{S_p}\] where \(s\) is the pooled standard deviation

Example

x1 <- c(30.02, 29.99, 30.11, 29.97, 30.01, 29.99)
x2 <-c(29.89, 29.93, 29.72, 29.98, 30.02, 29.98)

sp_square <- ( (length(x1)-1) * sd(x1)^2 + (length(x2)-1) * sd(x2)^2 ) /(length(x1) + length(x2) -2)

d <- (mean(x1) - mean(x2)) / sqrt(sp_square)
d
## [1] 1.131033

Using esc

library(esc)
esc_mean_sd(grp1m = mean(x1), grp1sd = sd(x1), grp1n = length(x1),
            grp2m = mean(x2), grp2sd = sd(x2), grp2n = length(x2), 
            es.type = "d")
## 
## Effect Size Calculation for Meta Analysis
## 
##      Conversion: mean and sd to effect size d
##     Effect Size:   1.1310
##  Standard Error:   0.6218
##        Variance:   0.3866
##        Lower CI:  -0.0877
##        Upper CI:   2.3497
##          Weight:   2.5864

Bias

Cohen’s d is a biased estimator of the population effect size \((\mu_1 - \mu_2) / \sigma\)

Hedges g is not biased

\[g = J(n_1+n_2-2) d \approx \left( 1- \frac{3}{4 (n_1 +n_2) - 9}\right) d\]

Example

d * (1- (3)/(4*(length(x1) +length(x2)) - 9))
## [1] 1.04403

Using esc

esc_mean_sd(grp1m = mean(x1), grp1sd = sd(x1), grp1n = length(x1),
            grp2m = mean(x2), grp2sd = sd(x2), grp2n = length(x2), 
            es.type = "g")
## 
## Effect Size Calculation for Meta Analysis
## 
##      Conversion: mean and sd to effect size Hedges' g
##     Effect Size:   1.0440
##  Standard Error:   0.6218
##        Variance:   0.3866
##        Lower CI:  -0.1747
##        Upper CI:   2.2627
##          Weight:   2.5864