Norrr = ~ 1
.perspqrrvglm(x, varlvI = FALSE, reference = NULL, plot.it = TRUE,
xlim = NULL, ylim = NULL, zlim = NULL,
gridlength = if (Rank == 1) 301 else c(51,51),
whichSpecies = NULL,
xlab = if (Rank == 1) "Latent Variable" else "Latent Variable 1",
ylab = if (Rank == 1) "Expected Value" else "Latent Variable 2",
zlab = "Expected value", labelSpecies = FALSE,
stretch = 1.05, main = "", ticktype = "detailed",
col = if (Rank == 1) par()$col else "white",
llty = par()$lty, llwd = par()$lwd,
add1 = FALSE, ...)
"qrrvglm"
, i.e., a
constrained quadratic ordination (CQO) object.Coef.qrrvglm
.Coef.qrrvglm
.par
.par
.Rank = 2
then the argument is recycled to length 2, and the two numbers
are the number of grid points on the x- and y-axes reRank = 2
.
By default, a suitable caption is found.
See the xlab
argument in plot
or
Rank = 1
only.
The position of the label is just above the species' maximum.Rank = 1
only.Rank = 2
.
See persp
for more information.persp
for more information.lty
argument of par
.lwd
argument of par
.persp
. Useful
arguments here include theta
and phi
, which control
the position of the eye.gridlength
.lv2grid
and maxfitted
are NULL
.lvplot.qrrvglm
but plots the curves along a fine grid
and there is no rugplot to show the site scores. For a rank-2 model, a perspective plot has the first latent variable as
the x-axis, the second latent variable as the y-axis, and the expected
value (fitted value) as the z-axis. The result of a CQO is that each
species has a response surface with elliptical contours. This function
will, at each grid point, work out the maximum fitted value over all
the species. The resulting response surface is plotted. Thus rare
species will be obscured and abundant species will dominate the plot.
To view rare species, use the whichSpecies
argument to select
a subset of the species.
A perspective plot will be performed if Norrr = ~ 1
, and
Rank = 1
or 2
. Also, all the tolerance matrices of
those species to be plotted must be positive-definite.
persp
,
cqo
,
Coef.qrrvglm
,
lvplot.qrrvglm
,
par
,
title
.hspider[,1:6] <- scale(hspider[,1:6]) # Good idea when ITolerances = TRUE
set.seed(111)
r1 <- cqo(cbind(Alopacce, Alopcune, Alopfabr, Arctlute, Arctperi,
Auloalbi, Pardmont, Pardnigr, Pardpull, Trocterr) ~
WaterCon + BareSand + FallTwig + CoveMoss + CoveHerb + ReflLux,
poissonff, hspider, trace = FALSE, ITolerances = TRUE)
set.seed(111) # r2 below is an ill-conditioned model
r2 <- cqo(cbind(Alopacce, Alopcune, Alopfabr, Arctlute, Arctperi,
Auloalbi, Pardmont, Pardnigr, Pardpull, Trocterr) ~
WaterCon + BareSand + FallTwig + CoveMoss + CoveHerb + ReflLux,
isdlv = c(2.4,1.0), Muxfactor = 3.0, trace = FALSE,
poissonff, hspider, Rank = 2, EqualTolerances = TRUE)
sort(r1@misc$deviance.Bestof) # A history of the fits
sort(r2@misc$deviance.Bestof) # A history of the fits
if (deviance(r2) > 857) stop("suboptimal fit obtained")
persp(r1, xlim = c(-6,5), col = 1:4, label = TRUE)
# Involves all species
persp(r2, xlim = c(-6,5), ylim = c(-4,5), theta = 10, phi = 20, zlim = c(0,220))
# Omit the two dominant species to see what's behind them
persp(r2, xlim = c(-6,5), ylim = c(-4,5), theta = 10, phi = 20, zlim = c(0,220),
which = (1:10)[-c(8,10)]) # Use zlim to retain the original z-scale
Run the code above in your browser using DataLab