brms_tidiers {broom} | R Documentation |
These methods tidy the estimates from
brmsfit-objects
(fitted model objects from the brms package) into a summary.
## S3 method for class 'brmsfit' tidy(x, parameters = NA, par_type = c("all", "non-varying", "varying", "hierarchical"), robust = FALSE, intervals = TRUE, prob = 0.9, ...)
x |
Fitted model object from the brms package. See
|
parameters |
Names of parameters for which a summary should be
returned, as given by a character vector or regular expressions.
If |
par_type |
One of |
robust |
Whether to use median and median absolute deviation rather than mean and standard deviation. |
intervals |
If |
prob |
Defines the range of the posterior uncertainty intervals,
such that |
... |
Extra arguments, not used |
All tidying methods return a data.frame
without rownames.
The structure depends on the method chosen.
When parameters = NA
, the par_type
argument is used
to determine which parameters to summarize.
Generally, tidy.brmsfit
returns
one row for each coefficient, with at least three columns:
term |
The name of the model parameter. |
estimate |
A point estimate of the coefficient (mean or median). |
std.error |
A standard error for the point estimate (sd or mad). |
When par_type = "non-varying"
, only population-level
effects are returned.
When par_type = "varying"
, only group-level effects are returned.
In this case, two additional columns are added:
group |
The name of the grouping factor. |
level |
The name of the level of the grouping factor. |
Specifying par_type = "hierarchical"
selects the
standard deviations and correlations of the group-level parameters.
If intervals = TRUE
, columns for the lower
and
upper
bounds of the posterior intervals computed.
## Not run: library(brms) fit <- brm(mpg ~ wt + (1|cyl) + (1+wt|gear), data = mtcars, iter = 500, chains = 2) tidy(fit) tidy(fit, parameters = "^sd_", intervals = FALSE) tidy(fit, par_type = "non-varying") tidy(fit, par_type = "varying") tidy(fit, par_type = "hierarchical", robust = TRUE) ## End(Not run)