dataFrame.columns.stat — cohensD()
Description
The cohensD() method of the stat object computes Cohen's d effect size for two selected columns.
Signature
dataFrame.columns(...columnNames).stat.cohensD({ comparison: 'independent', estimator: 'sample' })Arguments
...columnNames( string[] )- The name of the columns from which to compute Cohen's d effect size
options(object)- Cohen's d computation options.
Options
comparison(string)- The comparison method used to compute Cohen's d.
independent(default)paired
estimator(string)- The variance estimator used in the calculation.
populationsample(default)
Returns
effectSize(object)- The computed Cohen's d effect size.
Notes
- The method requires exactly two selected columns.
- The
independentcomparison computes Cohen's d using the difference between the means of two independent samples. - The
pairedcomparison computes Cohen's d using the paired differences between observations. - Positive values indicate that the first selected column has a larger mean than the second selected column.
- Negative values indicate that the second selected column has a larger mean than the first selected column.
- Common interpretation guidelines for the absolute value of Cohen's d are:
< 0.2: negligible0.2 – 0.5: small0.5 – 0.8: medium≥ 0.8: large
Example
// calculate the Cohen's d effect size between 2 columns of the dataFrame
var effectSize = dataFrame.columns('groupA', 'groupB').stat.cohensD();
// log the effect size
notebook.log(effectSize);