mvglmer {JMbayes} | R Documentation |
Multivariate Mixed Models
Description
Fits multivariate mixed models under a Bayesian approach using JAGS.
Usage
mvglmer(formulas, data, families, engine = c("JAGS", "STAN"),
overdispersion = FALSE, priors = NULL, init = NULL, control = NULL, ...)
Arguments
formulas |
a list of R formulas representing the mixed models; these should be lme4-type formulas. |
data |
a data.frame that contains all the variable to be used when fitting the multivariate mixed model. |
families |
a list of families objects correspond to each outcome. |
engine |
a character string indicating whether to use JAGS or STAN to fit the model. |
overdispersion |
logical; for Poisson outcomes, should an overdispersion parameter be included. |
priors |
a named list of user-specified prior parameters:
|
init |
a list of initial values. |
control |
a list of control values with components:
|
... |
options passed to the |
Details
This function creates a JAGS program representing a multivariate mixed effects that is run with JAGS using the jagsUI package. Currently only Gaussian, Bernoulli and Poisson longitudinal outcomes can be handled.
Value
A list of class mvglmer
with components:
mcmc |
a list with the MCMC samples for each parameter. |
components |
a list with design matrices and responses vectors extracted by applying
the |
data |
a copy of |
control |
a copy of the |
mcmc.info |
a list with information over the MCMC (i.e., time it took, iterations, etc.). |
DIC |
the DIC value for the fitted model. |
pD |
the pD valu for the fitted model. |
Rhat |
a list with the Rhat convergence diagnostics for each parameter. |
priors |
a copy of the priors used. |
postMeans |
a list with posterior means. |
postModes |
a list with posterior modes calculated using kernel desnisty estimation. |
EffectiveSize |
a list with effective sample sizes. |
StErr |
a list with posterior standard errors. |
StDev |
a list with posterior standard deviations. |
CIs |
a list with 95% credible intervals. |
Pvalues |
a list of tail probabilities for containg the zero value. |
call |
the matched call. |
Author(s)
Dimitris Rizopoulos d.rizopoulos@erasmusmc.nl
See Also
mvJointModelBayes
,
jointModelBayes
Examples
## Not run:
MixedModelFit <- mvglmer(list(log(serBilir) ~ year + (year | id),
spiders ~ year + (1 | id)), data = pbc2,
families = list(gaussian, binomial))
summary(MixedModelFit)
plot(MixedModelFit)
## End(Not run)