eelbrain.correlation_coefficient

eelbrain.correlation_coefficient(x, y, dim=None, name=None)

Correlation between two NDVars along a specific dimension

Parameters:
x : NDVar

First variable.

y : NDVar

Second variable.

dim : str | tuple of str

Dimension over which to compute correlation (by default all shared dimensions).

name : str

Name for output variable.

Returns:
correlation_coefficient : float | NDVar

Correlation coefficient over dim. Any other dimensions in x and y are retained in the output.