View source: R/neg_binomial_2.R
neg_binomial_2 | R Documentation |
Specifies the information required to fit a Negative Binomial GLM in a
similar way to negative.binomial
. However, here the
overdispersion parameter theta
is not specified by the user and always
estimated (really the reciprocal of the dispersion parameter is
estimated). A call to this function can be passed to the family
argument of stan_glm
or stan_glmer
to estimate a
Negative Binomial model. Alternatively, the stan_glm.nb
and
stan_glmer.nb
wrapper functions may be used, which call
neg_binomial_2
internally.
neg_binomial_2(link = "log")
link |
The same as for |
An object of class family
very similar to
that of poisson
but with a different family name.
if (.Platform$OS.type != "windows" || .Platform$r_arch != "i386")
stan_glm(Days ~ Sex/(Age + Eth*Lrn), data = MASS::quine, seed = 123,
family = neg_binomial_2, QR = TRUE, algorithm = "optimizing")
# or, equivalently, call stan_glm.nb() without specifying the family
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.