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)**strong text**
sd2 <- sd(Meaningfulness[df$age>=22],na.rm=TRUE)
d <- (mean1-mean2)/(c(sd1,sd2))
Interestingly I get 2 outputs then? And my second confusion is - when I compare the results to an online "cohen's d calculator" with one set of data my calculated Cohen's d matches with the one from the online calculator with another set of data it doesn't.
Any suggestions on what might be wrong with my code? Every help is appreciated!! :)