A visualization of a correlation matrix.
- Maybe this is the same reason that the graphical method is off. When I plot T 2 vs. M, I did a normal linear regression. This takes all the data and find the linear function that best fits the.
- Method 'pie' and 'shade' came from Michael Friendly's job (with some adjustment about the shade added on). Don't plot confidence interval. If 'rect', plot rectangles whose upper side means upper bound and lower side means lower bound, respectively, and meanwhile correlation coefficients are also added on the rectangles. If 'circle', first.
A graphical display of a correlation matrix, confidence interval. The detailsare paid great attention to. It can also visualize a general matrix bysetting is.corr = FALSE
.
T-plot, BJH, pore volume calculations Cross-sectional area Size of a nitrogen molecule BET, Langmuir, BJH, HK Hard sphere diameter pressure correction for micro pore analyses je.kenvin@micromeritics.com Surface area and porosity.
Usage
Arguments
The correlation matrix to visualize, must be square iforder
is not 'original'
. For general matrix, please usingis.corr = FALSE
to convert.
Character, the visualization method of correlation matrix to be used. Currently, it supports seven methods, named 'circle'
(default), 'square'
, 'ellipse'
, 'number'
, 'pie'
, 'shade'
and 'color'
. See examples for details.
The areas of circles or squares show the absolute value of corresponding correlation coefficients. Method 'pie'
and 'shade'
came from Michael Friendly's job (with some adjustment about the shade added on), and 'ellipse'
came from D.J. Murdoch and E.D. Chow's job, see in section References.
Character, 'full'
(default), 'upper'
or'lower'
, display full matrix, lower triangular or upper triangularmatrix.
Logical, if TRUE
, the graph is added to an existing plot,otherwise a new plot is created.
Vector, the color of glyphs. It is distributed uniformly incl.lim
. If NULL, col
will becolorRampPalette(col2)(200)
, see example about col2.
The background color.
Character, title of the graph.
Logical, whether the input matrix is a correlation matrix ornot. We can visualize the non-correlation matrix by settingis.corr = FALSE
.
Logical, whether display the correlation coefficients on theprincipal diagonal.
Logical or character, whether plot outline of circles, squareand ellipse, or the color of these glyphs. For pie, this represents thecolor of the circle outlining the pie. If outline
is TRUE
,the default value is 'black'
.
See par
.
The color of the grid. If NA
, don't add grid. IfNULL
the default value is chosen. The default value depends onmethod
, if method
is color
or shade
, the colorof the grid is NA
, that is, not draw grid; otherwise 'grey'
.
Color of coefficients added on the graph. If NULL
(default), add no coefficients.
Logic, whether translate coefficients into percentagestyle for spacesaving.
Character, the ordering method of the correlation matrix.
'original'
for original order (default).'AOE'
for the angular order of the eigenvectors.'FPC'
for the first principal component order.'hclust'
for the hierarchical clustering order.'alphabet'
for alphabetical order.
See function corrMatOrder
for details.
Character, the agglomeration method to be used whenorder
is hclust
. This should be one of 'ward'
,'ward.D'
, 'ward.D2'
, 'single'
, 'complete'
,'average'
, 'mcquitty'
, 'median'
or 'centroid'
.
Integer, the number of rectangles draws on the graph accordingto the hierarchical cluster, only valid when order
is hclust
.If NULL
(default), then add no rectangles.
Color for rectangle border(s), only valid when addrect
is equal or greater than 1.
Numeric, line width for borders for rectangle border(s), onlyvalid when addrect
is equal or greater than 1.
Character or logical, position of text labels. If character, itmust be one of 'lt'
, 'ld'
, 'td'
, 'd'
or'n'
. 'lt'
(default if type'full'
) means left and top,'ld'
(default if type'lower'
) means left and diagonal,'td'
(default if type'upper'
) means top and diagonal(near),'d'
means diagonal, 'n'
means don't add textlabel.
Numeric, for the size of text label (variable names).
The color of text label.
Numeric, for text label, see text
.
Numeric, for text label string rotation in degrees, seetext
.
Character or logical, position of color labels; If character,it must be one of 'r'
(default if type'upper'
or'full'
), 'b'
(default if type'lower'
) or 'n'
,'n'
means don't draw colorlabel.
T Plot Method Bet
The limits (x1, x2)
in the colorlabel.
Wilson Plot Method
Integer, the number of number-text in colorlabel, passed tocolorlegend
. If NULL
, cl.length
islength(col) + 1
when length(col) <=20
; cl.length
is 11when length(col) > 20
Numeric, cex of number-label in colorlabel, passed tocolorlegend
.
Numeric, to justify the width of colorlabel, 0.1~0.2 issuggested.
Character, 'l'
, 'c'
(default) or'r'
, for number-label in colorlabel, 'l'
means left,'c'
means center, and 'r'
means right.
Numeric, for number-label in colorlabel, seetext
.
The cex
parameter to send to the call to text
when writing the correlation coefficients into the plot.
the font
parameter to send to the call totext
when writing the correlation coefficients into the plot.
indicating the number of decimal digits to beadded into the plot. Non-negative integer or NULL, default NULL.
Character for shade style, 'negative'
,'positive'
or 'all'
, only valid when method
is'shade'
. If 'all'
, all correlation coefficients' glyph willbe shaded; if 'positive'
, only the positive will be shaded; if'negative'
, only the negative will be shaded. Note: the angle ofshade line is different, 45 degrees for positive and 135 degrees fornegative.
Numeric, the line width of shade.
The color of shade line.
Matrix of p-value, if NULL
, arguments sig.level
,insig
, pch
, pch.col
, pch.cex
is invalid.
T Plot Method Crossword
Significant level, if the p-value in p-mat
is biggerthan sig.level
, then the corresponding correlation coefficient isregarded as insignificant. If insig
is 'label_sig'
, this maybe an increasing vector of significance levels, in which case pch
will be used once for the highest p-value interval and multiple times(e.g. '*', '**', '***') for each lower p-value interval.
Character, specialized insignificant correlation coefficients,'pch'
(default), 'p-value'
, 'blank'
, 'n'
, or'label_sig'
. If 'blank'
, wipe away the corresponding glyphs;if 'p-value'
, add p-values the corresponding glyphs;if 'pch'
, add characters (see pch
for details) oncorresponding glyphs; if 'n'
, don't take any measures; if'label_sig'
, mark significant correlations with pch(see sig.level
).
Add character on the glyphs of insignificant correlationcoefficients(only valid when insig
is 'pch'
). Seepar
.
The color of pch (only valid when insig
is'pch'
).
The cex of pch (only valid when insig
is 'pch'
).
Character, method of ploting confidence interval. If'n'
, don't plot confidence interval. If 'rect', plot rectangleswhose upper side means upper bound and lower side means lower bound,respectively, and meanwhile correlation coefficients are also added on therectangles. If 'circle', first plot a circle with the bigger absolutebound, and then plot the smaller. Warning: if the two bounds are the samesign, the smaller circle will be wiped away, thus forming a ring. Method'square' is similar to 'circle'.
Matrix of the lower bound of confidence interval.
Matrix of the upper bound of confidence interval.
Label to be used for rendering NA
cells. Default is'?'
. If 'square', then the cell is rendered as a square with thena.label.col
color.
Color used for rendering NA
cells. Default is'black'
.
Aspect ration for the whole plot. Value other than 1 iscurrently compatible only with methods 'circle' and 'square'.
Additional arguments passing to function text
for drawingtext lable.
Details
corrplot
function offers flexible ways to visualize correlation matrix, lower and upper bound of confidence interval matrix.
Value
(Invisibly) returns a reordered correlation matrix.
Note
Cairo
and cairoDevice
packages is strongly recommended to produce high-quality PNG, JPEG, TIFF bitmap files, especially for that method
circle
, ellipse
.
Row- and column names of the input matrix are used as labels rendered in the corrplot. Plothmath expressions will be used if the name is prefixed by one of the following characters: :
, =
or $
. For example ':alpha + beta'
.
References
Michael Friendly (2002).Corrgrams: Exploratory displays for correlation matrices.The American Statistician, 56, 316--324.
D.J. Murdoch, E.D. Chow (1996).A graphical display of large correlation matrices.The American Statistician, 50, 178--180.
See Also
Function plotcorr
in the ellipse
package and corrgram
in the corrgram
package have some similarities.
Package seriation
offered more methods to reorder matrices, such as ARSA, BBURCG, BBWRCG, MDS, TSP, Chen and so forth.
Aliases
- corrplot