Cohensdp()
computes the Cohen's d (noted $d_p$) and its confidence interval in
either within-subject, between-subject design and single-group design. For
the between-subject design, MBESS already has an implementation based on the
"pivotal" method but the present method is faster,
using the method based on the Lambda prime
distribution l07CohensdpLibrary. See
h81,c22a,c22b,gc18;textualCohensdpLibrary.
Cohensdp(statistics, design, gamma, method )
a list of pre-computed statistics. The statistics to provide
depend on the design:
- for "between": m1
, m2
the means of the two groups,
s1
, s2
the standard deviation of the two groups,
and n1
, n2
, the sample sizes of the two groups;
- for "within": m1
, m2
, s1
, s2
, n
, and
r
or rho
the correlation between the measure;
- for "single": m
, s
, n
and m0
the reference mean
from which m
is standardized).
the design of the measures ("within"
, "between"
, or "single"
);
the confidence level of the confidence interval (default 0.95)
In "within"-subject design only, choose among methods "piCI"
, or
"adjustedlambdaprime"
(default), "alginakeselman2003"
, "morris2000"
, and
"regressionapproximation"
.
The Cohen's $d_p$ statistic and its confidence interval. The return value is internally a dpObject which can be displayed with print, explain or summary/summarize.
This function uses the exact method in "single"-group and "between"-subject designs. In "within"-subject design, the default is the adjusted Lambda prime confidence interval ("adjustedlambdaprime") which is based on an approximate method. This method is described in c22b;textualCohensdpLibrary. Other methods are available, described in m00,ak03,CG057-1,f22;textualCohensdpLibrary
# example in which the means are 114 vs. 101 with sds of 14.3 and 12.5 respectively
Cohensdp( statistics = list( m1= 101, m2= 114, s1= 12.5, s2= 14.3, n1= 12, n2= 12 ),
design = "between")
#> [1] -1.8074058 -0.9679684 -0.1090564
# example in a repeated-measure design
Cohensdp(statistics =list( m1= 101, m2= 114, s1= 12.5, s2= 14.3, n= 12, rho= 0.53 ),
design ="within" )
#> [1] -1.5938740 -0.9679684 -0.3245811
# example with a single-group design where mu is a population parameter
Cohensdp( statistics = list( m = 101, m0 = 114, s = 12.5, n = 10 ),
design = "single")
#> [1] -1.8019885 -1.0400000 -0.2424991
# The results can be displayed in three modes
res <- Cohensdp( statistics = list( m = 101, m0 = 114, s = 12.5, n = 10),
design = "single")
# a raw result of the Cohen's d_p and its confidence interval
res
#> [1] -1.8019885 -1.0400000 -0.2424991
# a human-readable output
summarize( res )
#> Cohen's dp = -1.040
#> 95.0% Confidence interval = [-1.802, -0.242]
# ... and a human-readable ouptut with additional explanations.
explain( res )
#> Cohen's dp = -1.040
#> sample mean 101.000 is compared to assumed mean 114.000
#> sample standard deviation 12.500 is the denominator
#> 95.0% Confidence interval = [-1.802, -0.242]
#> *: confidence interval obtained from the lambda-prime method with 9 degrees of freedom (Lecoutre, 2007, Journal of Modern Applied Statistical Methods)
# example in a repeated-measure design with a different method than piCI
Cohensdp(statistics =list( m1= 101, m2= 114, s1= 12.5, s2= 14.3, n= 12, r= 0.53 ),
design ="within", method = "adjustedlambdaprime")
#> [1] -1.5901574 -0.9679684 -0.2726974