| glmmVA | R Documentation |
Wraps the "gllvm" function to fit a (univariate) generalized linear mixed-effects model (GLMM) in a more familiar syntax.
Both fixed and random effects are specified in lme4-style via the formula argument.
glmmVA(
formula,
data,
family,
control = list(reltol = 1e-10, optimizer = "optim", max.iter = 6000, maxit = 6000,
optim.method = "BFGS"),
control.va = list(Ar.struc = "unstructured", diag.iter = 0, Lambda.start = 0.3),
control.start = list(starting.val = "zero", n.init = 1, n.init.max = 10, start.fit =
NULL, scalmax = 10, MaternKappa = 1.5, rangeP = NULL, zetacutoff = NULL,
start.optimizer = "nlminb", start.optim.method = "BFGS"),
...
)
formula |
a formula object describing both the fixed- and random-effects part of the model. A response should be present on the left-hand side of the operator, and otherwise passed as a named 'y' argument to the function. Random effects are written in |
data |
an optional data frame containing the variables named in formula. |
family |
a family as supported by the |
control |
A list with the following arguments controlling the optimization:
|
control.va |
A list with the following arguments controlling the variational approximation method:
|
control.start |
A list with the following arguments controlling the starting values:
|
... |
other arguments passed onto the |
An object of class "glmmVA" that inherits from the "gllvm" class.
Bert van der Veen
gllvm
data(eSpider)
data <- cbind(data.frame(y = c(eSpider$abund[eSpider$nonNA,]),
species = factor(rep(1:ncol(eSpider$abund), each = length(eSpider$nonNA))),
site = factor(rep(1:length(eSpider$nonNA), ncol(eSpider$abund)))),
do.call(rbind, replicate(ncol(eSpider$abund), scale(eSpider$X[eSpider$nonNA,]),
simplify = FALSE)))
# Example 1: crossed random slope effects
model <- glmmVA(y~species + ConWate + ConHumu + (0+ConHumu|species) + (0+ConWate|species),
family = "poisson", data = data)
# Example 2: correlated random slopes
model1 <- glmmVA(y~species + ConWate + ConHumu + (0+ConWate+ConHumu|species),
family = "poisson", data = data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.