extended_summary
prints a summary of brmsfit results.
extended_summary(
fit = NULL,
draws = NULL,
gsub.pattern = NULL,
gsub.replacement = NULL,
xlab = "Effect size",
ylab = "Parameter",
n.posterior = 2000,
fit.name = NULL,
read.file = NULL,
plot.area.prop = 1,
remove.intercepts = FALSE,
fill = "#6DCD59FF",
trace.palette = viridis::viridis,
effects = NULL,
save = FALSE,
dest.path = ".",
overwrite = FALSE,
robust = FALSE,
width = 8,
height = "dynamic",
highlight = FALSE,
print.name = TRUE,
trace = TRUE,
return = FALSE,
spread.type = "MAD"
)
A brmsfit object.
A draws object.
A vector with character strings to be replaced
A vector with character strings to use for replacement.
A character string with the horizontal axis label. Default is "Effect size".
A character string with the vertical axis label. Default is "Parameter".
Number of posterior samples to use for plotting. Default is 2000.
Character string to be added as title. If not supplied and 'read.file' is supplied the name is obtained from the file.
Character string with the name of the .rds file containing the model fit.
Positive number to control de proportion of the plotting area of posterior distributions that will be included. Default is 1 (the default area included by ggplot
). Useful for adding or removing empty space around distributions.
Logical to control if intercepts are included in the output.
Color for posterior distribution fill. Default is "#6DCD59FF".
Color palette function for trace plotting. Default is viridis
.
Character vector with the name of the effects (e.g. predictor variables) to be included. Optional. Note that if effect names have been modified using 'gsub.pattern' and 'gsub.replacement' the modified names should be used instead. Effects in plots and tables will also be sorted as in 'effects' so this can be used to customize order.
Logical to control if the summary is saved instead of printed. If TRUE a RDS file with the function output (a list) and a jpeg file is saved into 'dest.path'.
Directory in which to save results (if save = TRUE
). The current working directory is used as default.
Logical to control if saved results are overwritten. Defaul is FALSE.
Logical to control the type of central tendency measure as in summary.brmsfit
).
Width of posterior distribution + trace plots as in ggsave
). Default is 8 (in).
Height of posterior distribution + trace plots as in ggsave
). Default is 'dynamic' which means that the height will increase as more panels (predictors) are added.
Logical to control if posterior estimates for which the 95% credible intervals do not overlap with zero are highlighted. Default is FALSE.
Logical to control if the name of the model fit is printed (when plot = TRUE
).
Logical to control if chain trace plots are generated. Default is TRUE
.
Logical to control if tables and plots are returned as a list instead of printed. Default is FALSE
(printing tables and plots).
Character string with the name of the method to quantify the spread of posterior distributions. Two options are available: "HPDI" (highest posterior density interval) and "MAD" (mean absolute deviation, default).
If plot = TRUE
the function returns a model fit table, a coefficient table and a posterior distribution halfeye graph. If save = TRUE
this objects are saved as a RDS file along with jpeg file.
It prints a summary of brmsfit results. It includes a model fit table, a coefficient table and a posterior distribution halfeye graph next to a chain trace plot. Tables are produce in html format so the output is nicely printed when knit in Rmarkdown files. You might have to add 'results = 'as.is' to chunk options in Rmarkdown documents.
Araya-Salas (2022), brmsish: miscellaneous functions to customize brms bayesian regression models. R package version 1.0.0.Paul-Christian Buerkner (2017). brms: An R Package for Bayesian Multilevel Models Using Stan. Journal of Statistical Software, 80(1), 1-28. doi:10.18637/jss.v080.i01
{
# run model
mod <- brm(Petal.Length ~ Petal.Width + Species, iris, chains = 1,
iter = 500, file = file.path(tempdir(), "mod"))
# print from fit
extended_summary(fit= mod)
# print summary reading the rds file
extended_summary(read.file = file.path(tempdir(), "mod.rds"))
}
#> Compiling Stan program...
#> Error in .fun(model_code = .x1): Boost not found; call install.packages('BH')