Learn R Programming

boral (version 0.4)

lvsplot: Plot the latent variables from an boral model

Description

Construct a 1-D index plot or 2-D scatterplot of the latent variables from a fitted boral model.

Usage

lvsplot(x, jitter = FALSE, a = 1, newplot = TRUE, ...)

Arguments

x
An object for class "boral".
jitter
If jitter = TRUE, then some jittering is applied so that points on the plots do not overlap exactly (which can often occur with discrete data and samll sample sizes). Please see jitter for its i
a
Default parameter used in cex. Graphical options are adjusted as par(cex = a, cex.axis = a, cex.lab = a+0.5, cex.main = a+0.5, ...). Defaults to 1.
newplot
Construct plots on a new graphics device? Defaults to TRUE.
...
Additional graphical options to be included in par.

Details

Two plots are produced, based on the posterior medians and posterior means of the latent variables respectively. The points in each plot are labelled using the row index of the reponse matrix $y$.

If the fitted model does not include covariates (X = NULL), the plots can be interpreted in the exactly same manner as unconstrainted ordination plots constructed from methods such as Nonmetric Multi-dimensional Scaling (NMDS, Kruskal, 1964) and Correspondence Analysis (CA, Hill, 1974). with multivariate abundance data for instance, where the response matrix $y$ consists of $n$ sites and $p$ species, the ordination plots can be studied to look for possible clustering of sites, location and/or dispersion effects, an arch pattern indicative of some sort species succession over an environmental gradient, and so on.

References

  • Hill, M. O. (1974). Correspondence analysis: a neglected multivariate method. Applied statistics, 23, 340-354.
  • Kruskal, J. B. (1964). Nonmetric multidimensional scaling: a numerical method. Psychometrika, 29, 115-129.

Examples

Run this code
library(mvabund) ## Load a dataset from the mvabund package
data(spider)
y <- spider$abun
n <- nrow(y); p <- ncol(y); 

spider.fit.nb <- boral(y, family = "negative.binomial", num.lv = 2, 
     site.eff = TRUE, save.model = FALSE, calc.ics = FALSE)

## Three clusters are observable with site 25 roughly in the middle.
lvsplot(spider.fit.nb)

Run the code above in your browser using DataLab