For ratio scale data it is relatively simple to create and visualize a correlation matrix e.g. as shown below. Ho can I do the same for a data frame that contains also nominal scale data? I would like to see associations (e.g. Cramer's Phi or others) for nominal-nominal, and nominal-ratio pairs and correlation for ratio-ratio pair variables. Something like the matrix the sweetviz pyhton package generates for an automatic exploratory data analysis.
I appreciate each answer.
import seaborn as sns
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(15, 15)) # Sample figsize in inches (width, heights)
hm = sns.heatmap(df[meta_data + summary_ravenscroft].corr(method='spearman'), vmin=-1, vmax=1, annot=True, ax=ax);
# Give a title to the heatmap. Pad defines the distance of the title from the top of the heatmap.
hm.set_title('Correlation Heatmap', fontdict={'fontsize':12}, pad=12);
Update 1
what sweetviz does and what I would like to do:
"A major source of insight and unique feature of Sweetviz' associations graph and analysis is that it unifies in a single graph (and detail views):
- Numerical correlation (between numerical features)
- Uncertainty coefficient (for categorical-categorical)
- Correlation ratio (for categorical-numerical) Pairwise sample
Squares represent categorical-featured-related variables and circles represent numerical-numerical correlations. Note that the trivial diagonal is left empty, for clarity."
sweetvizsay it does? If it it ambiguous, do you have access to the source code to see what it does? If it is clear, do you have access to the source code to (trust but) verify what it does? $\endgroup$