pingouin.convert_effsize

pingouin.convert_effsize(ef, input_type, output_type, nx=None, ny=None)[source]

Conversion between effect sizes.

Parameters
effloat

Original effect size

input_typestring

Effect size type of ef. Must be ‘r’ or ‘d’.

output_typestring

Desired effect size type. Available methods are

'none' : no effect size
'cohen' : Unbiased Cohen d
'hedges' : Hedges g
'glass': Glass delta
'eta-square' : Eta-square
'odds-ratio' : Odds ratio
'AUC' : Area Under the Curve

nx, nyint, optional

Length of vector x and y. nx and ny are required to convert to Hedges g

Returns
effloat

Desired converted effect size

compute_effsize

Calculate effect size between two set of observations.

compute_effsize_from_t

Convert a T-statistic to an effect size.

Notes

The formula to convert r to d is given in ref [1]:

$d = \frac{2r}{\sqrt{1 - r^2}}$

The formula to convert d to r is given in ref [2]:

$r = \frac{d}{\sqrt{d^2 + \frac{(n_x + n_y)^2 - 2(n_x + n_y)} {n_xn_y}}}$

The formula to convert d to $$\eta^2$$ is given in ref [3]:

$\eta^2 = \frac{(0.5 * d)^2}{1 + (0.5 * d)^2}$

The formula to convert d to an odds-ratio is given in ref [4]:

$OR = e(\frac{d * \pi}{\sqrt{3}})$

The formula to convert d to area under the curve is given in ref [5]:

$AUC = \mathcal{N}_{cdf}(\frac{d}{\sqrt{2}})$

References

1

Rosenthal, Robert. “Parametric measures of effect size.” The handbook of research synthesis 621 (1994): 231-244.

2

McGrath, Robert E., and Gregory J. Meyer. “When effect sizes disagree: the case of r and d.” Psychological methods 11.4 (2006): 386.

3

Cohen, Jacob. “Statistical power analysis for the behavioral sciences. 2nd.” (1988).

4

Borenstein, Michael, et al. “Effect sizes for continuous data.” The handbook of research synthesis and meta-analysis 2 (2009): 221-235.

5

Ruscio, John. “A probability-based measure of effect size: Robustness to base rates and other factors.” Psychological methods 1 3.1 (2008): 19.

Examples

1. Convert from Cohen d to eta-square

>>> from pingouin import convert_effsize
>>> d = .45
>>> eta = convert_effsize(d, 'cohen', 'eta-square')
>>> print(eta)
0.048185603807257595

1. Convert from Cohen d to Hegdes g (requires the sample sizes of each group)

>>> d = .45
>>> g = convert_effsize(d, 'cohen', 'hedges', nx=10, ny=10)
>>> print(g)
0.4309859154929578

1. Convert Pearson r to Cohen d

>>> r = 0.40
>>> d = convert_effsize(r, 'r', 'cohen')
>>> print(d)
0.8728715609439696

1. Reverse operation: convert Cohen d to Pearson r

>>> d = 0.873
>>> r = convert_effsize(d, 'cohen', 'r')
>>> print(r)
0.40004943911648533