pingouin.compute_effsize_from_t

pingouin.compute_effsize_from_t(tval, nx=None, ny=None, N=None, eftype='cohen')[source]

Compute effect size from a T-value.

Parameters
tvalfloat

T-value

nx, nyint, optional

Group sample sizes.

Nint, optional

Total sample size (will not be used if nx and ny are specified)

eftypestring, optional

desired output effect size

Returns
effloat

Effect size

See also

compute_effsize

Calculate effect size between two set of observations.

convert_effsize

Conversion between effect sizes.

Notes

If both nx and ny are specified, the formula to convert from t to d is:

\[d = t * \sqrt{\frac{1}{n_x} + \frac{1}{n_y}}\]

If only N (total sample size) is specified, the formula is:

\[d = \frac{2t}{\sqrt{N}}\]

Examples

  1. Compute effect size from a T-value when both sample sizes are known.

>>> from pingouin import compute_effsize_from_t
>>> tval, nx, ny = 2.90, 35, 25
>>> d = compute_effsize_from_t(tval, nx=nx, ny=ny, eftype='cohen')
>>> print(d)
0.7593982580212534
  1. Compute effect size when only total sample size is known (nx+ny)

>>> tval, N = 2.90, 60
>>> d = compute_effsize_from_t(tval, N=N, eftype='cohen')
>>> print(d)
0.7487767802667672