pSpearmanCorrelation

pSpearmanCorrelation(size, rho, tail=False, ties=False)

Cumulative distribution function of a the Spearman correlation distribution.

Parameters:
nint

The number of distinct ranks.

rhofloat

Location.

tailbool

Tail flag.

Default value is False.

If True, the complementary CDF is computed.

tiesbool

Indicates whether ties in the samples are taken into account.

Default value is False.

Returns:
pfloat

The CDF or its complementary of the Spearman statistic distribution.

Notes

This method enables to test whether an observed value of the Spearman correlation \rho is significantly different from zero. It implements the distribution of the statistic under the null hypothesis where the Spearmann correlation is assumed to be not significantly different from 0.

The CDF value is the probability that the statistic is lower than or equal to the value calculated from \rho. The complementary CDF value is the p-value.

When there is no tie, we use the tabulated exact distribution of the statistic for small sample size thanks to the values given in [luke] and the Edgeworth expansion for the other sample sizes.

When there are ties, we use the Student asymptotic approximation.

Examples

>>> import openturns as ot
>>> cdf = ot.DistFunc.pSpearmanCorrelation(100, 0.1)