heplot.candisc {candisc} | R Documentation |
These functions plot ellipses (or ellipsoids in 3D) in canonical discriminant space representing the hypothesis and error sums-of-squares-and-products matrices for terms in a multivariate linear model. They provide a low-rank 2D (or 3D) view of the effects for that term in the space of maximum discrimination.
## S3 method for class 'candisc': heplot(mod, which = 1:2, scale, asp = 1, var.col = "blue", var.lwd = par("lwd"), prefix = "Can", suffix = TRUE, terms = mod$term, ...) ## S3 method for class 'candisc': heplot3d(mod, which = 1:3, scale, var.col = "blue", var.lwd=par("lwd"), prefix = "Can", suffix = FALSE, terms = mod$term, ...)
mod |
A candisc object for one term in a mlm |
which |
A numeric vector containing the indices of the canonical dimensions to plot. |
scale |
Scale factor for the variable vectors in canonical space. If not specified, the function calculates one to make the variable vectors approximately fill the plot window. |
asp |
Aspect ratio for the horizontal and vertical
dimensions. The default, asp=1 ensures equal units, so that angles
and lengths of variable vectors are interpretable. As well, the
standardized canonical scores are uncorrelated, so the Error ellipse
(ellipsoid) should plot as a circle (sphere) in canonical space. |
var.col |
Color for variable vectors and labels |
var.lwd |
Line width for variable vectors |
prefix |
Prefix for labels of canonical dimensions. |
suffix |
Suffix for labels of canonical dimensions. If suffix=TRUE
the percent of hypothesis (H) variance accounted for by each canonical dimension is added to the axis label. |
terms |
Terms from the original mlm whose H ellipses
are to be plotted in canonical space. The default is the one term for
which the canonical scores were computed. If terms=TRUE ,
all terms are plotted. |
... |
Arguments to be passed down |
The generalized canonical discriminant analysis for on term in a mlm
is based on the eigenvalues, lambda_i, and eigenvectors, V,
of the H and E matrices for that term. This produces uncorrelated
canonical scores which give the maximum univariate F statistics.
The canonical HE plot is then just the HE plot of the canonical scores
for the given term.
No useful value; used for the side-effect of producing a canonical HE plot.
Michael Friendly and John Fox
Friendly, M. (2006). Data Ellipses, HE Plots and Reduced-Rank Displays for Multivariate Linear Models: SAS Software and Examples Journal of Statistical Software, 17(6), 1-42. http://www.jstatsoft.org/v17/i06/
Friendly, M. (2007). HE plots for Multivariate General Linear Models. Journal of Computational and Graphical Statistics, 16 (2), 421-444. http://www.math.yorku.ca/SCS/Papers/jcgs-heplots.pdf
candisc
, candiscList
,
heplot
, heplot3d
grass.mod <- lm(cbind(N1,N9,N27,N81,N243) ~ Block + Species, data=Grass) grass.can1 <-candisc(grass.mod, term="Species") grass.canL <-candiscList(grass.mod) heplot(grass.can1, scale=6) heplot(grass.can1, scale=6, terms=TRUE) heplot(grass.canL, terms=TRUE, ask=FALSE) # NB: aspect3d not set for equal scaling in this plot heplot3d(grass.can1) # change to equal scaling, so E ellipsoid is spherical aspect3d("iso") ## Pottery data, from car package pottery.mod <- lm(cbind(Al, Fe, Mg, Ca, Na) ~ Site, data=Pottery) (pottery.can <-candisc(pottery.mod)) heplot(pottery.can, var.lwd=3) heplot3d(pottery.can, scale=12) aspect3d("iso")