| best_models | R Documentation |
This function ranks the best models according to posterior model probabilities calculated using one of the available model priors: binomial or beta-binomial. It returns three types of tables in three different formats: an inclusion table, where 1 indicates that a regressor is included in the model and 0 indicates that it is excluded; an estimation results table, which displays the best models and their estimation output, including point estimates, standard errors, and significance levels; and an estimation results table with robust standard errors.
best_models(
bma_list,
prior = "binomial",
best = 5,
round = 3,
estimate = TRUE,
robust = TRUE
)
bma_list |
An object of class |
prior |
Character string specifying the model prior used for the
ranking. Options are |
best |
Integer. The number of best models to display (default: 5). |
round |
Integer indicating the decimal place to which numbers in the tables should be rounded (default: 3). |
estimate |
A parameter with values TRUE or FALSE indicating which table should be displayed when
TRUE - table with the estimation results |
robust |
A parameter with values TRUE or FALSE indicating which type of standard errors should be displayed
when the function finishes calculations. Works only if estimate = TRUE. Works well when best is small. |
A list with best_models objects:
matrix with inclusion of the regressors in the best models
matrix with estimation output in the best models with regular standard errors
matrix with estimation output in the best models with robust standard errors
knitr_kable table with inclusion of the regressors in the best models (the best for the display on the console - up to 11 models)
knitr_kable table with estimation output in the best models with regular standard errors (the best for the display on the console - up to 6 models)
knitr_kable table with estimation output in the best models with robust standard errors (the best for the display on the console - up to 6 models)
gTree table with inclusion of the regressors in the best models (displayed as a plot). Use grid::grid.draw() to display.
gTree table with estimation output in the best models with regular standard errors (displayed as a plot). Use grid::grid.draw() to display.
gTree table with estimation output in the best models with robust standard errors (displayed as a plot). Use grid::grid.draw() to display.
library(magrittr)
data_prepared <- badp::economic_growth[, 1:6] %>%
badp::feature_standardization(
excluded_cols = c(country, year, gdp)
) %>%
badp::feature_standardization(
group_by_col = year,
excluded_cols = country,
scale = FALSE
)
bma_results <- bma(
model_space = badp::small_model_space,
round = 3,
dilution = 0
)
best_5_models <- best_models(bma_results, prior = "binomial", best = 5, estimate = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.