function [d,r]=Cohen(M1,SD1,M2,SD2) %Calculate the value of Cohen's d and the effect-size correlation, r, using the means and standard deviations of two groups. %M1,SD1 represent mean and standard deviation of Group 1 %M2,SD2 represent mean and standard deviation of Group 2 %ref:http://www.uccs.edu/~lbecker/ o = sqrt((SD1^2+SD2^2)/2); d = (M1-M2)/o; r = d/sqrt(d^2+4);