CORR() GROUP BY ...
All functions > GROUP BY > CORR() GROUP BY ...
Returns the Pearson correlation coefficient between two expressions.
Syntax
Diagram(
Sequence(
Terminal("CORR"),
Terminal("("),
NonTerminal("expr_y"),
Terminal(","),
NonTerminal("expr_x"),
Terminal(")"),
Choice(0, Skip(),
Sequence(
Terminal("FILTER"),
Terminal("("),
Terminal("WHERE"),
NonTerminal("condition"),
Terminal(")")
)
),
Choice(0, Skip(),
Sequence(
Terminal("GROUP BY"),
OneOrMore(NonTerminal("feature"), Terminal(","))
)
)
)
)| Parameter | Type | Required | Description |
|---|---|---|---|
expr_y | T | Yes | The dependent variable (y) |
expr_x | T | Yes | The independent variable (x) |
condition | BOOLEAN | No | The condition to filter the values before aggregation |
feature | FEATURE | No | The features to group by (many features are supported) |
Notes
- Returns a value between -1 (perfect negative correlation) and 1 (perfect positive correlation)
- NULL values in either expression are excluded from the calculation
- Returns NULL if fewer than 2 non-NULL pairs exist