Last chance! 50% off unlimited learning
Sale ends in
negative.binomial
. However, here the
overdispersion parameter theta
is not specified by the user and always
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")
poisson
, typically a character
vector of length one among "log"
, "identity"
, and
"sqrt"
.if (!grepl("^sparc", R.version$platform))
stan_glm(Days ~ Sex/(Age + Eth*Lrn), data = MASS::quine, seed = 123,
family = neg_binomial_2, QR = TRUE, algorithm = "fullrank")
# or, equivalently, call stan_glm.nb() without specifying the family
Run the code above in your browser using DataLab