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, ...)
A matrix (with nsim columns) of simulated response vectors
an object of class "MCMCglmm"
number of response vectors to simulate. Defaults to 1
.
Either NULL
or an integer that will be used in a call to set.seed
before simulating the response vectors. The default, NULL
will 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
character; if it
is NULL
should 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")
logical; if 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
Jarrod Hadfield j.hadfield@ed.ac.uk
MCMCglmm