dataFrame.columns.stat — cramersV()
Description
The cramersV() method of the stat object computes Cramér's V association measure between two selected categorical columns.
Signature
dataFrame.columns(...columnNames).stat.cramersV()Argument
...columnNames( string[] )- The name of the columns from which to compute the Cramér's V association.
Returns
stat( object[] )- A statistic object containing the Cramér's V association and related statistics.
cramerV(number)- The Cramér's V association measure.
strength(string)- The interpreted strength of association. Values:
- `
- marginal
- weak
- moderate
- strong
Notes
- The method requires exactly two selected categorical columns.
- Cramér's V measures the strength of association between categorical variables.
- The statistic ranges from
0to1. - A value of
0indicates no association. - A value of
1indicates a perfect association. - Unlike Pearson correlation, Cramér's V does not indicate the direction of the relationship.
- The strength classification depends on the dimensions of the contingency table.
Example
// evaluate a Cramer's V association for 2 columns of the dataFrame
var stat = dataFrame.columns('groupA', 'groupB').stat.cramersV();
// log the stat details
notebook.log(stat);