Survey data (R attitude)

Correlation heatmap example: drawing a supplied matrix

Paste an existing correlation matrix and draw it in full with an orange–purple scale. Seven supervisor ratings from 30 departments.

Open this example in the editorStart from scratch

rating × rating: r = 1.001.00rating × complaints: r = 0.820.82rating × privileges: r = 0.430.43rating × learning: r = 0.620.62rating × raises: r = 0.590.59rating × critical: r = 0.160.16rating × advance: r = 0.150.15complaints × rating: r = 0.820.82complaints × complaints: r = 1.001.00complaints × privileges: r = 0.560.56complaints × learning: r = 0.600.60complaints × raises: r = 0.670.67complaints × critical: r = 0.190.19complaints × advance: r = 0.230.23privileges × rating: r = 0.430.43privileges × complaints: r = 0.560.56privileges × privileges: r = 1.001.00privileges × learning: r = 0.490.49privileges × raises: r = 0.450.45privileges × critical: r = 0.150.15privileges × advance: r = 0.340.34learning × rating: r = 0.620.62learning × complaints: r = 0.600.60learning × privileges: r = 0.490.49learning × learning: r = 1.001.00learning × raises: r = 0.640.64learning × critical: r = 0.120.12learning × advance: r = 0.530.53raises × rating: r = 0.590.59raises × complaints: r = 0.670.67raises × privileges: r = 0.450.45raises × learning: r = 0.640.64raises × raises: r = 1.001.00raises × critical: r = 0.380.38raises × advance: r = 0.570.57critical × rating: r = 0.160.16critical × complaints: r = 0.190.19critical × privileges: r = 0.150.15critical × learning: r = 0.120.12critical × raises: r = 0.380.38critical × critical: r = 1.001.00critical × advance: r = 0.280.28advance × rating: r = 0.150.15advance × complaints: r = 0.230.23advance × privileges: r = 0.340.34advance × learning: r = 0.530.53advance × raises: r = 0.570.57advance × critical: r = 0.280.28advance × advance: r = 1.001.00ratingcomplaintsprivilegeslearningraisescriticaladvanceratingcomplaintsprivilegeslearningraisescriticaladvancer−1−0.500.51
A supplied 7 × 7 correlation matrix of supervisor ratings, drawn in full with the diagonal.

About this example

Often only the correlation matrix is available, for example from a published table or another program. This example pastes cor(attitude) from R, rounded to three decimals: ratings by clerical employees of their supervisors in 30 departments of a large financial organization (Chatterjee & Price 1977). The tool recognises the matrix because the first column repeats the header names.

The matrix is checked for symmetry, a diagonal of 1 and values between −1 and 1, then drawn as given. Without the raw data there is no n, so no p-values are offered. The overall rating correlates most with handling of complaints (r = 0.83); critical attitude relates only weakly to the other items.

Sources: R documentation: The Chatterjee–Price Attitude Data (attitude)

The data

Column 1ratingcomplaintsprivilegeslearningraisescriticaladvance
rating10.8250.4260.6240.590.1560.155
complaints0.82510.5580.5970.6690.1880.225
privileges0.4260.55810.4930.4450.1470.343
learning0.6240.5970.49310.640.1160.532
raises0.590.6690.4450.6410.3770.574
critical0.1560.1880.1470.1160.37710.283
advance0.1550.2250.3430.5320.5740.2831

A supplied correlation matrix (cor(attitude) rounded to 3 decimals). It is drawn as given; without raw data there is no n and no p-value. Open the example, replace the data with your own, and export the figure as SVG, PDF, PNG or TIFF.

More examples