Cohen's-d effect size with pooled sd for a control and experimental group

effect.size(y, x, pooled = TRUE, conf.level = 0.95)

Arguments

y

A character or factor vector

x

A numeric vector, same length as y

pooled

Pooled or population standard deviation (TRUE/FALSE)

conf.level

Specified confidence interval. Default is 0.95

Value

An effect.size class object with x, y and a data.frame with columns for effect size, lower confidence interval, lower confidence interval. The row names of the data frame represent the levels in y

Note

This implementation will iterate through each class in y and treating a given class as the experimental group and all other classes as a control case. Each class had d and the confidence interval derived. A negative d indicate directionality with same magnitude. The expected range for d is 0 - 3 d is derived; ( mean(experimental group) - mean(control group) ) / sigma(p) pooled standard deviation is derived; sqrt( ( (Ne - 1) * sigma(e)^2 + (Nc - 1) * sigma(c)^2 ) / (Ne + Nc - 2) ) where; Ne, Nc = n of experimental and control groups.

References

Cohen, J., (1988) Statistical Power Analysis for the Behavioral Sciences (second ed.). Lawrence Erlbaum Associates.

Cohen, J (1992) A power primer. Psychological Bulletin 112(1):155-159

Author

Jeffrey S. Evans <jeffrey_evans@tnc.org>

Examples

( es <- effect.size(iris$Species, iris$Sepal.Length) )
#> [1] "Effect size for: setosa = 2.366" #> Lower CI: -2.8909 Upper CI: -1.841 #> #> [1] "Effect size for: versicolor = 0.1825" #> Lower CI: -0.2193 Upper CI: 0.584 #> #> [1] "Effect size for: virginica = 1.7486" #> Lower CI: 1.2759 Upper CI: 2.221 #>
plot(es)