Latent Variable Plot for RR-VGLMs
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 |
Object of class |
A |
Logical. Allow the plotting of A? |
C |
Logical. Allow the plotting of C? If |
scores |
Logical. Allow the plotting of the n scores? The scores are the values of the latent variables for each observation. |
show.plot |
Logical. Plot it? If |
groups |
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
|
gapC |
The gap between the end of the arrow and the text labelling of C, in latent variable units. |
scaleA |
Numerical value that is multiplied by A, so that C is divided by this value. |
xlab |
Caption for the x-axis. See |
ylab |
Caption for the y-axis. See |
Alabels |
Character vector to label A. Must be of length M. |
Aadj |
Justification of text strings for labelling A.
See the |
Acex |
Numeric. Character expansion of the labelling of A.
See the |
Acol |
Line color of the arrows representing C.
See the |
Apch |
Either an integer specifying a symbol or a single character
to be used as the default in plotting points.
See |
Clabels |
Character vector to label C. Must be of length p2. |
Cadj |
Justification of text strings for labelling C.
See the |
Ccex |
Numeric. Character expansion of the labelling of C.
See the |
Ccol |
Line color of the arrows representing C.
See the |
Clty |
Line type of the arrows representing C.
See the |
Clwd |
Line width of the arrows representing C.
See the |
chull.arg |
Logical. Plot the convex hull of the scores? This is
done for each group (see the |
ccex |
Numeric. Character expansion of the labelling of the convex hull.
See the |
ccol |
Line color of the convex hull.
See the |
clty |
Line type of the convex hull.
See the |
clwd |
Line width of the convex hull.
See the |
spch |
Either an integer specifying a symbol or a single character
to be used as the default in plotting points.
See |
scex |
Numeric. Character expansion of the labelling of the scores.
See the |
scol |
Line color of the arrows representing C.
See the |
slabels |
Character vector to label the scores. Must be of length n. |
... |
Arguments passed into the |
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.
The matrix of scores (n latent variable values) is returned regardless of whether a plot was produced or not.
The functions lvplot.rrvglm
and
biplot.rrvglm
are equivalent.
In the example below the predictor variables are centered, which is a good idea.
Thomas W. Yee
Yee, T. W. and Hastie, T. J. (2003). Reduced-rank vector generalized linear models. Statistical Modelling, 3, 15–41.
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") ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.