pingouin.circ_corrcl

pingouin.circ_corrcl(x, y, tail='two-sided')[source]

Correlation coefficient between one circular and one linear variable random variables.

Parameters
x1-D array_like

First circular variable (expressed in radians). The range of x must be either $$[0, 2\pi]$$ or $$[-\pi, \pi]$$. If angles is not expressed in radians (e.g. degrees or 24-hours), please use the pingouin.convert_angles() function prior to using the present function.

y1-D array_like

Second circular variable (linear)

tailstring

Specify whether to return ‘one-sided’ or ‘two-sided’ p-value.

Returns
rfloat

Correlation coefficient

pvalfloat

Uncorrected p-value

Notes

Please note that NaN are automatically removed from datasets.

Examples

Compute the r and p-value between one circular and one linear variables.

>>> from pingouin import circ_corrcl
>>> x = [0.785, 1.570, 3.141, 0.839, 5.934]
>>> y = [1.593, 1.291, -0.248, -2.892, 0.102]
>>> r, pval = circ_corrcl(x, y)
>>> print(round(r, 3), round(pval, 3))
0.109 0.971