I've just tried to calculate Cohen's d in R with the following formula:
mean1 <- mean(Meaningfulness[df$age<=22],na.rm=TRUE)
mean2 <- mean(Meaningfulness[df age>=22],na.rm=TRUE)
sd1 <- sd(Meaningfulness[df$age<=22],na.rm=TRUE)
sd2 <- sd(Meaningfulness[df$age>=22],na.rm=TRUE)
pooled <- sqrt((sd1^2 + sd2^2) / 2
d <- (mean1-mean2)/(pooled)
Just to be sure I have compared 2 outputs with an online "cohen's d calculator". The Cohen's ds I've calculated differs by 0.04 and.003 from the online calculator. Any suggestions on what might be wrong with my code? Every help is appreciated!! :)