Learn R Programming

gllvm (version 1.0)

getResidualCor.gllvm: Extract residual correlations from gllvm object

Description

Calculates the residual correlation from gllvm models.

Usage

# S3 method for gllvm
getResidualCor(object)

Arguments

object

an object of class 'gllvm'.

Examples

Run this code
# NOT RUN {
# Load a dataset from the mvabund package
data(antTraits)
y <- as.matrix(antTraits$abund)
# Fit gllvm model
fit <- gllvm(y = y, family = "poisson")
# residual correlations:
cr <- getResidualCor(fit)

# }
# NOT RUN {
# Plot residual correlations:
install.packages("corrplot", "gclus")
library(corrplot)
library(gclus)
rbPal <- colorRampPalette(c('darkblue','white','darkred'))
breaks <- seq(min(cr$cor), max(cr$cor), length.out = 40)
Colors <- rbPal(100)[as.numeric(cut(cr$cor, breaks = breaks))]
corrplot(cr$cor[order.single(cr$cor), order.single(cr$cor)], diag = F,
  type = "lower", method = "square", tl.cex = 0.8, tl.srt = 45, tl.col = "red")
  
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab