pingouin.plot_skipped_corr

pingouin.plot_skipped_corr(x, y, xlabel=None, ylabel=None, n_boot=2000, seed=None)[source]

Plot the bootstrapped 95% confidence intervals and distribution of a robust Skipped correlation.

Parameters
x, y1D-arrays or list

Samples

xlabel, ylabelstr

Axes labels

n_bootint

Number of bootstrap iterations for the computation of the confidence intervals

seedint

Random seed generator for the bootstrap confidence intervals.

Returns
figmatplotlib Figure instance

Matplotlib Figure. To get the individual axes, use fig.axes.

Notes

This function is inspired by the Matlab Robust Correlation Toolbox (Pernet, Wilcox and Rousselet, 2012). It uses the skipped correlation to determine the outliers. Note that this function requires the scikit-learn package.

References

1

Pernet, C.R., Wilcox, R., Rousselet, G.A., 2012. Robust correlation analyses: false positive and power validation using a new open source matlab toolbox. Front. Psychol. 3, 606. https://doi.org/10.3389/fpsyg.2012.00606

Examples

Plot a robust Skipped correlation with bootstrapped confidence intervals

>>> import numpy as np
>>> import pingouin as pg
>>> np.random.seed(123)
>>> mean, cov, n = [170, 70], [[20, 10], [10, 20]], 30
>>> x, y = np.random.multivariate_normal(mean, cov, n).T
>>> # Introduce two outliers
>>> x[10], y[10] = 160, 100
>>> x[8], y[8] = 165, 90
>>> fig = pg.plot_skipped_corr(x, y, xlabel='Height', ylabel='Weight')
../_images/pingouin-plot_skipped_corr-1.png