File Exchange

image thumbnail

Correlation Matrix Scatterplot

version 1.0.0.0 (5.44 KB) by John Chow
Produces a correlation matrix scatterplot with least-squared fitted lines.

14 Downloads

Updated 16 Sep 2015

View License

This function creates multiple bivariate scatterplots similar to SPSS's Matrix Scatterplot but without duplicate relationships. A linear fitted line, the correlation coefficient and the associated p-value are included in each plot. It is helpful when you want to explore the relationships among several variables.

Comments and Ratings (7)

JCanal

Indeed a simple and useful function. Thanks!

Some minor adjustments were required to get it working without the statistics toolbox (corrcoef instead of corr, max()-min() instead of range()), but afterwards it produced the desired output. Thanks!

John Chow

@Thomas Have you tried the sample at the top of the codes. I just downloaded the program and processed the sample data and ended up with a figure the same as the cover figure. Note: There should be a '%' before 'orient tall' on line 17.) Feel free to send me your data in XLS for me to try if you are still having problems.

p-value calculation appears incorrect, getting p=0.000 for data with little to no correlation.

p-values for negatively correlated variables (negative coefficient) is always 0.

p-value calculation appears incorrect, getting p=0.000 for data with little to no correlation.

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired by: tight_subplot(Nh, Nw, gap, marg_h, marg_w)