rstanarm
tidiers will soon be deprecated in broom
and there is no
ongoing development of these functions at this time.
# S3 method for stanreg tidy(x, parameters = "non-varying", intervals = FALSE, prob = 0.9, ...) # S3 method for stanreg glance(x, looic = FALSE, ...)
x | Fitted model object from the rstanarm package. See
|
---|---|
parameters | One or more of |
intervals | If |
prob | See |
... | For |
looic | Should the LOO Information Criterion (and related info) be
included? See |
All tidying methods return a data.frame
without rownames.
The structure depends on the method chosen.
When parameters="non-varying"
(the default), tidy.stanreg
returns
one row for each coefficient, with three columns:
The name of the corresponding term in the model.
A point estimate of the coefficient (posterior median).
A standard error for the point estimate based on
stats::mad()
. See the Uncertainty estimates section in
rstanarm::print.stanreg()
for more details.
The algorithm used to fit the model.
The posterior sample size (except for models fit using optimization).
The number of observations used to fit the model.
The square root of the estimated residual variance, if
applicable. If not applicable (e.g., for binomial GLMs), sigma
will
be given the value 1
in the returned object.
The LOO Information Criterion.
The expected log predictive density (elpd_loo = -2 * looic
).
The effective number of parameters.
These methods tidy the estimates from rstanarm::stanreg-objects()
(fitted model objects from the rstanarm package) into a summary.
rstanarm::summary.stanreg()
if (FALSE) { fit <- stan_glmer(mpg ~ wt + (1|cyl) + (1+wt|gear), data = mtcars, iter = 300, chains = 2) # non-varying ("population") parameters tidy(fit, intervals = TRUE, prob = 0.5) # hierarchical sd & correlation parameters tidy(fit, parameters = "hierarchical") # group-specific deviations from "population" parameters tidy(fit, parameters = "varying") # glance method glance(fit) glance(fit, looic = TRUE, cores = 1) }