simulate.gllvm | R Documentation |
Generate new data using the fitted values of the parameters
## S3 method for class 'gllvm'
simulate(object, nsim = 1, seed = NULL, conditional = FALSE, ...)
object |
an object of class 'gllvm'. |
nsim |
an optional positive integer specifying the number of simulated datasets. Defaults to 1. |
seed |
an optional integer to set seed number, passed to set.seed. Defaults to a random seed number. |
conditional |
if |
... |
not used. |
simulate function for gllvm objects.
A matrix containing generated data.
David Warton, Jenni Niku <jenni.m.e.niku@jyu.fi>
# 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())
# Simulate data
newdata <- simulate(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.