Simulate method for GLMMs fitted with MCMCglmm
Simulated response vectors for GLMMs fitted with MCMCglmm
# S3 method for MCMCglmm simulate(object, nsim = 1, seed = NULL, newdata=NULL, marginal = object$Random$formula, type = "response", it=NULL, posterior = "all", verbose=FALSE, …)
an object of class
number of response vectors to simulate. Defaults to
NULLor an integer that will be used in a call to
set.seedbefore simulating the response vectors. The default,
NULLwill not change the random generator state.
An optional data frame for which to simulate new observations
formula defining random effects to be maginalised
character; either "terms" (link scale) or "response" (data scale)
integer; optional, MCMC iteration on which predictions should be based
NULLshould the response vector be simulated using the marginal posterior means ("mean") of the parameters, or the posterior modes ("mode"), random draws from the posterior with replacement ("distribution") or without replacement ("all")
TRUE, warnings are issued with newdata when the original model has fixed effects that do not appear in newdata and/or newdata has random effects not present in the original model.
Further arguments to be passed
A matrix (with nsim columns) of simulated response vectors