Learn R Programming

gllvm (version 1.0)

coefplot.gllvm: Plot covariate coefficients and confidence intervals

Description

Plots covariate coefficients and their confidence intervals.

Usage

# S3 method for gllvm
coefplot(object, y.label = TRUE, which.Xcoef = NULL,
  cex.ylab = 0.5, mfrow = NULL, mar = c(4, 6, 2, 1), ...)

Arguments

object

an object of class 'gllvm'.

y.label

logical, if TRUE (default) colnames of y with respect to coefficients are added to plot.

which.Xcoef

vector indicating which X-coefficients will be plotted. Can be vector of covariate names or numbers. Default is NULL when all covariate coefficients are plotted.

cex.ylab

the magnification to be used for axis annotation relative to the current setting of cex.

mfrow

same as mfrow in par. If NULL (default) it is determined automatically.

mar

vector of length 4, which defines the margin sizes: c(bottom, left, top, right). Defaults to c(4,5,2,1).

...

additional graphical arguments.

Examples

Run this code
# NOT RUN {
## Load a dataset from the mvabund package
data(antTraits)
y <- as.matrix(antTraits$abund)
X <- as.matrix(antTraits$env)
TR <- antTraits$traits
# Fit model with environmental covariates
fit <- gllvm(y, X, formula = ~ Bare.ground + Shrub.cover,
            family = "poisson")
coefplot.gllvm(fit)

# }
# NOT RUN {
# Fit model with all environmental covariates
fitx <- gllvm(y, X, family = "negative.binomial")
coefplot(fitx, mfrow = c(3,2))
coefplot(fitx, which.Xcoef = 1:2)

# Fit gllvm model with environmental and trait covariates
TR <- antTraits$traits
fitT <- gllvm(y = y, X = X, TR = TR, family = "negative.binomial")
coefplot(fitT)
# }

Run the code above in your browser using DataLab