nancorr

Calculates Pearson correlation allowing for nan values.
132 Downloads
Updated 29 Dec 2021

View License

nancorr(A, B) is equivalent to matlab's corr(A, B, 'Rows', 'pairwise'), except nancorr routine is orders of magnitude faster on large matrices.
nancorr also returns t-statistics:
[coef, t] = nancorr(A, B); zmat = t;
These can be converted to p-values as follows:
[coef, t, n] = NANCORR(A, B);
pval = tcdf(-abs(t), n - 2)

Cite As

Oleksandr Frei (2024). nancorr (https://www.mathworks.com/matlabcentral/fileexchange/71893-nancorr), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2019a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Interpolation in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.1

stops underflow/overflow in calculations of standard errors (sx, sy) causing the output to become complex

1.0.0