A correlation matrix is easy to calculate. Choosing a suitable method for each pair of variables takes more care, especially when a dataset mixes continuous, count, binary, ordinal, and categorical variables.

smartcor detects variable types, selects a suitable correlation or association method, and reports the estimate, confidence interval, p-value, and reasoning behind the choice. It also identifies alternative methods. The project has two implementations: smartcor for R and pysmartcor for Python.

I developed the project with Pritam Ranjan. Our accompanying paper, smartcor: Intelligent Correlation Method Selection for Mixed Variable Types, explains the method-selection framework.

Install the Python package with:

pip install pysmartcor