plotcorr {ellipse} | R Documentation |
This function plots a correlation matrix using ellipse-shaped glyphs for each entry. The ellipse represents a level curve of the density of a bivariate normal with the matching correlation.
plotcorr(corr, outline = TRUE, col = "grey", numbers = FALSE, ...)
corr |
A matrix containing entries between -1 and 1 to be plotted as
correlations.
|
outline |
Whether the ellipses should be outlined in the default colour. |
col |
Which colour to use to fill the ellipses. |
numbers |
Whether to plot numerical correlations in place of ellipses. If
numbers is TRUE , then the correlations will be rounded to a single decimal
place and placed on the plot.
|
... |
Additional graphical parameters. |
The ellipses being plotted will be tangent to a unit character square, with the shape chosen to match the required correlation.
Murdoch, D.J. and Chow, E.D. (1996). A graphical display of large correlation matrices. The American Statistician 50, 178-180.
# Plot the correlation matrix for the mtcars data full model fit data(mtcars) fit <- lm(mpg ~ ., mtcars) plotcorr(summary(fit, correlation = TRUE)$correlation) # Plot a second figure with numbers in place of the # ellipses plotcorr(summary(fit, correlation = TRUE)$correlation, numbers = TRUE)