
cohen.d(d, ...)
"cohen.d"(formula,data=list(),...)
"cohen.d"(d,f,pooled=TRUE,paired=FALSE, na.rm=FALSE, hedges.correction=FALSE, conf.level=0.95,noncentral=FALSE, ...)
f
is a factor) or the treatment group values (if f
is a numeric vector)
NA
s should be removed before computation;
if paired==TRUE
then all incomplete pairs are removed.
y ~ f
, where y
is a numeric variable giving the data values and f
a factor with two levels giving the corresponding groups
formula
. By default the variables are taken from environment(formula)
.
effsize
containing the following components:
containing the following components:f
in the default version is a factor or a character, it must have two values and it identifies the two groups to be compared. Otherwise (e.g. f
is numeric), it is considered as a sample to be compare to d
.In the formula version, if f
is expected to be a factor, if that is not the case it is coherced to a factor and a warning is issued.
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).
When paired
is set, the effect size is computed using the
approach suggested in (Gibbons et al. 1993).
The computation of the CI requires the use of non-central Student-t distributions that are used when noncentral==TRUE
; otherwise a central distribution is used.
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 variance of the d
is computed using the conversion formula reported at page 238 of Cooper et al. (2009):
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)
David C. Howell (2010). Confidence Intervals on Effect Size. Available at: https://www.uvm.edu/%7Edhowell/methods7/Supplements/Confidence%20Intervals%20on%20Effect%20Size.pdf
Cumming, G.; Finch, S. (2001). A primer on the understanding, use, and calculation of confidence intervals that are based on central and noncentral distributions. Educational and Psychological Measurement, 61, 633-649.
Gibbons, R. D., Hedeker, D. R., & Davis, J. M. (1993). Estimation of effect size from a series of experiments involving paired comparisons. Journal of Educational Statistics, 18, 271-279.
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)
Run the code above in your browser using DataLab