Produces an ordination diagram (also known as a biplot or latent variable plot) for reduced-rank vector generalized linear models (RR-VGLMs). For rank-2 models only, the x- and y-axis are the first and second canonical axes respectively.
lvplot.rrvglm(object,
A = TRUE, C = TRUE, scores = FALSE, show.plot = TRUE,
groups = rep(1, n), gapC = sqrt(sum(par()$cxy^2)),
scaleA = 1,
xlab = "Latent Variable 1", ylab = "Latent Variable 2",
Alabels = if (length(object@misc$predictors.names))
object@misc$predictors.names else param.names("LP", M),
Aadj = par()$adj, Acex = par()$cex, Acol = par()$col,
Apch = NULL,
Clabels = rownames(Cmat), Cadj = par()$adj,
Ccex = par()$cex, Ccol = par()$col, Clty = par()$lty,
Clwd = par()$lwd,
chull.arg = FALSE, ccex = par()$cex, ccol = par()$col,
clty = par()$lty, clwd = par()$lwd,
spch = NULL, scex = par()$cex, scol = par()$col,
slabels = rownames(x2mat), ...)
Object of class "rrvglm"
.
Logical. Allow the plotting of A?
Logical. Allow the plotting of C? If TRUE
then
C is represented by arrows emenating from the origin.
Logical. Allow the plotting of the \(n\) scores? The scores are the values of the latent variables for each observation.
Logical. Plot it? If FALSE
, no plot is produced
and the matrix of scores (\(n\) latent variable values) is returned.
If TRUE
, the rank of object
need not be 2.
A vector whose distinct values indicate which group the
observation belongs to. By default, all the observations belong to a
single group. Useful for the multinomial logit model (see
multinomial
.
The gap between the end of the arrow and the text labelling of C, in latent variable units.
Numerical value that is multiplied by A, so that C is divided by this value.
Caption for the x-axis. See par
.
Caption for the y-axis. See par
.
Character vector to label A. Must be of length \(M\).
Justification of text strings for labelling A.
See the adj
argument of par
.
Numeric. Character expansion of the labelling of A.
See the cex
argument of par
.
Line color of the arrows representing C.
See the col
argument of par
.
Either an integer specifying a symbol or a single character
to be used as the default in plotting points.
See par
.
The pch
argument can be of length \(M\),
the number of species.
Character vector to label C. Must be of length \(p2\).
Justification of text strings for labelling C.
See the adj
argument of par
.
Numeric. Character expansion of the labelling of C.
See the cex
argument of par
.
Line color of the arrows representing C.
See the col
argument of par
.
Line type of the arrows representing C.
See the lty
argument of par
.
Line width of the arrows representing C.
See the lwd
argument of par
.
Logical. Plot the convex hull of the scores?
This is done for each group (see the group
argument).
Numeric.
Character expansion of the labelling of the convex hull.
See the cex
argument of par
.
Line color of the convex hull.
See the col
argument of par
.
Line type of the convex hull.
See the lty
argument of par
.
Line width of the convex hull.
See the lwd
argument of par
.
Either an integer specifying a symbol or
a single character
to be used as the default in plotting points.
See par
.
The spch
argument can be of length \(M\),
the number of species.
Numeric. Character expansion of the
labelling of the scores.
See the cex
argument of par
.
Line color of the arrows representing C.
See the col
argument of par
.
Character vector to label the scores. Must be of length \(n\).
Arguments passed into the plot
function
when setting up the entire plot. Useful arguments here include
xlim
and ylim
.
The matrix of scores (\(n\) latent variable values) is returned regardless of whether a plot was produced or not.
For RR-VGLMs, a biplot and a latent variable
plot coincide.
In general, many of the arguments starting with
``A'' refer to A (of length \(M\)),
``C'' to C (of length \(p2\)),
``c'' to the convex hull (of length length(unique(groups))
),
and ``s'' to scores (of length \(n\)).
As the result is a biplot, its interpretation is based on the inner product.
Yee, T. W. and Hastie, T. J. (2003). Reduced-rank vector generalized linear models. Statistical Modelling, 3, 15--41.
# NOT RUN {
nn <- nrow(pneumo) # x1, x2 and x3 are some unrelated covariates
pneumo <-
transform(pneumo, slet = scale(log(exposure.time)),
x1 = rnorm(nn), x2 = rnorm(nn), x3 = rnorm(nn))
fit <- rrvglm(cbind(normal, mild, severe) ~ slet + x1 + x2 + x3,
multinomial, data = pneumo, Rank = 2,
Corner = FALSE, Uncorrel = TRUE)
# }
# NOT RUN {
lvplot(fit, chull = TRUE, scores = TRUE, clty = 2, ccol = "blue",
scol = "red", Ccol = "darkgreen", Clwd = 2, Ccex = 2,
main = "Biplot of some fictitional data")
# }
Run the code above in your browser using DataLab