spm
is an abbreviation for scatterplot.matrix
.
This function just sets up a call to pairs
.scatterplot.matrix(x, ...)
scatterplot.matrix.formula(formula, data=NULL, subset, ...)
scatterplot.matrix.default(data, labels=colnames(data),
diagonal=c("density", "boxplot", "histogram", "qqplot", "none"),
adjust=1, nclass, plot.points=TRUE, smooth=TRUE, span=0.5, reg.line=lm,
transform=FALSE, groups=FALSE, by.groups=FALSE, col=palette(),
pch=1:n.groups, lwd=1, legend.plot=length(levels(groups)) > 1)
spm(x, ...)
~ x1 + x2 + ... + xk
or ~ x1 + x2 + ... + xk | z
where z
evaluates to a factor or other variable to divide the data into groups.scatterplot.matrix.formula
)
a data frame within which to evaluate the formula.density
function.hist
function.TRUE
the points are plotted in each
off-diagonal panel.TRUE
a lowess smooth is plotted in each
off-diagonal panel.FALSE
a line is plotted using the
function given by this argument; e.g., using rlm
in
package MASS
plots a robust-regression line.TRUE
, multivariate normalizing Box-Cox transformations
are computed and plotted; if a vector of powers, one for each variable, these are applied
as Box-Cox power transformations prior to plotting.TRUE
data-concentration ellipses are plotted in
the off-diagonal panels.c(.5, .9)
.TRUE
use the cov.trob
function in the MASS
package
to calculate the center and covariance matrix for the data ellipse.TRUE
, regression lines are fit by groups.par
).TRUE
then a legend for the groups is plotted
in the bottom-right cell.NULL
. This function is used for its side effect: producing
a plot.pairs
, scatterplot
,
data.ellipse
, box.cox.powers
,
box.cox
, cov.trob
.data(Duncan)
scatterplot.matrix(~income + education + prestige | type, data=Duncan)
scatterplot.matrix(~income + education + prestige,
transform=T, data=Duncan)
Run the code above in your browser using DataLab