Description Usage Arguments Value Author(s) References Examples
The varOrder
function implements some features of “effect ordering”
(Friendly & Kwan (2003)
for variables in a multivariate data display to make the
displayed relationships more coherent.
This can be used in pairwise HE plots, scatterplot matrices, parallel coordinate plots, plots of multivariate means, and so forth.
For a numeric data frame, the most useful displays often order variables according to the angles of variable vectors in a 2D principal component analysis or biplot. For a multivariate linear model, the analog is to use the angles of the variable vectors in a 2D canonical discriminant biplot.
1 2 3 4 5 6 7 8 9 10 11 12 | varOrder(x, ...)
## S3 method for class 'mlm'
varOrder(x, term, variables,
type = c("can", "pc"),
method = c("angles", "dim1", "dim2", "alphabet", "data", "colmean"),
names = FALSE, descending = FALSE, ...)
## S3 method for class 'data.frame'
varOrder(x, variables,
method = c("angles", "dim1", "dim2", "alphabet", "data", "colmean"),
names = FALSE, descending = FALSE, ...)
|
x |
A multivariate linear model or a numeric data frame |
term |
For the |
variables |
indices or names of the variables to be ordered; defaults to all response variables an MLM or all numeric variables in a data frame. |
type |
For an MLM, |
method |
One of
|
names |
logical; if |
descending |
If |
... |
Arguments passed to methods |
A vector of integer indices of the variables or a character vector of their names.
Michael Friendly
Friendly, M. & Kwan, E. (2003). Effect Ordering for Data Displays, Computational Statistics and Data Analysis, 43, 509-539. http://dx.doi.org/10.1016/S0167-9473(02)00290-6
1 2 3 4 5 6 7 8 9 10 | data(Wine, package="candisc")
Wine.mod <- lm(as.matrix(Wine[, -1]) ~ Cultivar, data=Wine)
Wine.can <- candisc(Wine.mod)
plot(Wine.can, ellipse=TRUE)
# pairs.mlm HE plot, variables in given order
pairs(Wine.mod, fill=TRUE, fill.alpha=.1, var.cex=1.5)
order <- varOrder(Wine.mod)
pairs(Wine.mod, variables=order, fill=TRUE, fill.alpha=.1, var.cex=1.5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.