Corrected Cohen’s D

October 13, 2010
By

(This article was originally published at Adventures in R, and syndicated at StatsBlogs.)

Calculating Cohen’s D is a pain particularly when you have data which is not independent (e.g. is longitudinal). So I have written a function which take away the hassle. It is in early form but produces a normal Cohen’s D and a corrected Cohen’s D for the paired nature of the data.

CCD<- function (x1, x2) {
dif<-mean(x2,na.rm=TRUE)-mean(x1, ,na.rm=TRUE)
SD<-(sd(x1,na.rm=TRUE) + sd(x2,na.rm=TRUE) )/2
COR<-cor(x1, x2, use="complete.obs")	
CD<-(dif/SD)	
CCD<-CD/( (2*(1-COR) ) ^.5)	
list("Cohen's d"=CD, "Corrected Cohen's d"=CCD) 
}



Please comment on the article here: Adventures in R

Tags:


Subscribe

Email:

  Subscribe