cohen.d | R Documentation |
Computes the Cohen's d and Hedges'g effect size statistics.
cohen.d(d, ...) ## S3 method for class 'formula' cohen.d(formula,data=list(),...) ## Default S3 method: cohen.d(d,f,pooled=TRUE,paired=FALSE, na.rm=FALSE, hedges.correction=FALSE, conf.level=0.95, ...)
d |
a numeric vector giving either the data values (if |
f |
either a factor with two levels or a numeric vector of values |
pooled |
a logical indicating whether compute pooled standard deviation or the whole sample standard deviation |
paired |
deprecated a logical indicating whether to consider the values as paired Since version 0.3.1 this parameter is ignored and may be removed in future code clean-ups |
na.rm |
logical indicating whether |
hedges.correction |
logical indicating whether apply the Hedges correction |
conf.level |
confidence level of the confidence interval |
formula |
a formula of the form |
data |
an optional matrix or data frame containing the variables in the formula |
... |
further arguments to be passed to or from methods. |
The function computes the value of Cohen's d statistics (Cohen 1988).
If required (hedges.correction==TRUE
) the Hedges g statistics is computed instead (Hedges and Holkin, 1985).
Also a quantification of the effect size magnitude is performed using the thresholds define in Cohen (1992).
The magnitude is assessed using the thresholds provided in (Cohen 1992), i.e. |d|<0.2 "negligible"
, |d|<0.5 "small"
, |d|<0.8 "medium"
, otherwise "large"
The variace of the d
is computed using the conversion formula reportead at page 238 of Cooper et al. (2009):
((n1+n2)/(n1*n2) + .5*d^2/df) * ((n1+n2)/df)
A list of class effsize
containing the following components:
estimate |
the statistics estimate |
conf.int |
the confidence interval of the statistic |
var |
the estimated variance of the statistic |
conf.level |
the confidence level used to compute the confidence interval |
magnitude |
a qualitative assessment of the magnitude of effect size |
method |
the method used for computing the effect size, either |
Marco Torchiano http://softeng.polito.it/torchiano/
Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). New York:Academic Press.
Hedges, L. V. & Olkin, I. (1985). Statistical methods for meta-analysis. Orlando, FL: Academic Press.
Cohen, J. (1992). A power primer. Psychological Bulletin, 112, 155-159.
The Handbook of Research Synthesis and Meta-Analysis (Cooper, Hedges, & Valentine, 2009)
cliff.delta
, VD.A
, print.effsize
treatment = rnorm(100,mean=10) control = rnorm(100,mean=12) d = (c(treatment,control)) f = rep(c("Treatment","Control"),each=100) ## compute Cohen's d ## treatment and control cohen.d(treatment,control) ## data and factor cohen.d(d,f) ## formula interface cohen.d(d ~ f) ## compute Hedges' g cohen.d(d,f,hedges.correction=TRUE)