stan_glmer(formula, data = NULL, family = gaussian, subset, weights,
na.action = getOption("na.action", "na.omit"), offset, contrasts = NULL,
..., prior = normal(), prior_intercept = normal(),
prior_ops = prior_options(), prior_covariance = decov(),
prior_PD = FALSE, algorithm = c("sampling", "meanfield", "fullrank"),
adapt_delta = NULL, QR = FALSE)stan_lmer(...)
stan_glmer.nb(..., link = "log")
glmer
.glm
.glm
, but rarely
specified.priors
for details.
Set prior
to NULL
to omit a prior, i.e., use an (improper)
uniform prior.priors
for
details. Set prior_intercept
to NULL
to omit a prior, i.e.,
use an (improper) uniform prior. (Note: the prior distribution for
NULL
to omit a prior on the dispersion and see
prior_options
otherwise.NULL
; see decov
for
more information about the default arguments.FALSE
) indicating
whether to draw from the prior predictive distribution instead of
conditioning on the outcome."sampling"
for MCMC (the
default), "optimizing"
for optimization, "meanfield"
for
variational inference with independent normalgorithm="sampling"
. See
adapt_delta
for details.FALSE
) but if TRUE
applies a scaled qr
decomposition to the design matrix,
$X = Q^\ast R^\ast$, where
$Q^\ast = Q \sqrt{n-1}$ and
$R^\ast = \frac{1}{\sstan_glmer.nb
only, the link function to use. See
neg_binomial_2
.stan_glmer, stan_lmer, stan_glmer.nb
.stan_glmer
function is similar in syntax to
glmer
but rather than performing (restricted) maximum
likelihood estimation of generalized linear models, Bayesian estimation is
performed via MCMC. The Bayesian model adds independent priors on the
regression coefficients (in the same way as stan_glm
) and
priors on the terms of a decomposition of the covariance matrices of the
group-specific parameters. See priors
for more information
about the priors.
The stan_lmer
function is equivalent to stan_glmer
with
family = gaussian(link = "identity")
.
The stan_glmer.nb
function, which takes the extra argument
link
, is a simple wrapper for stan_glmer
with
family = neg_binomial_2(link)
.stanreg-methods
and
glmer
.The vignette for stan_glmer
and the Hierarchical
Partial Pooling vignette.
# see help(example_model) for details on the model below
print(example_model, digits = 1)
Run the code above in your browser using DataLab