Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predictLVs.gllvm

Predict latent variables for gllvm Fits


Description

Obtains predictions for latent variables from a fitted generalized linear latent variable model object. Currently works only for the variational approximation method.

Usage

## S3 method for class 'gllvm'
predictLVs(object, newX = NULL, newY = object$y, ...)

Arguments

object

an object of class 'gllvm'.

newX

A new data frame of environmental variables. If omitted, the original matrix of environmental variables is used.

newY

A new response data. Defaults to the dataset used for original model fit.

...

not used.

Details

Obtains predictions for latent variables from a fitted generalized linear latent variable model object.

Value

A matrix containing requested predictor types.

Author(s)

David Warton, Jenni Niku <jenni.m.e.niku@jyu.fi>

Examples

# Load a dataset from the mvabund package
data(antTraits)
y <- as.matrix(antTraits$abund)
X <- scale(antTraits$env[, 1:3])
# Fit gllvm model
fit <- gllvm(y = y, X, family = poisson())
# fitted values
predLVs <- predictLVs.gllvm(fit)

gllvm

Generalized Linear Latent Variable Models

v1.3.0
GPL-2
Authors
Jenni Niku [aut, cre], Wesley Brooks [aut], Riki Herliansyah [aut], Francis K.C. Hui [aut], Sara Taskinen [aut], David I. Warton [aut], Bert van der Veen [aut]
Initial release
2021-4-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.