best_models: Table with the best models according to one of the posterior...

View source: R/best_models.R

best_modelsR Documentation

Table with the best models according to one of the posterior criteria

Description

This function creates a ranking of best models according to one of the possible criterion (PMP under binomial model prior, PMP under binomial-beta model prior, R^2 under binomial model prior, R^2 under binomial-beta model prior). The function gives two types of tables in three different formats: inclusion table (where 1 indicates presence of the regressor in the model and 0 indicates that the variable is excluded from the model) and estimation results table (it displays the best models and estimation output for those models: point estimates, standard errors, significance level, and R^2).

Usage

best_models(bma_list, criterion = 1, best = 5, round = 3, estimate = TRUE)

Arguments

bma_list

bma object (the result of the bma function)

criterion

The criterion that will be used for a basis of the model ranking:
1 - binomial model prior
2 - binomial-beta model prior

best

The number of the best models to be considered

round

Parameter indicating the decimal place to which number in the tables should be rounded (default round = 3)

estimate

A parameter with values TRUE or FALSE indicating which table should be displayed when TRUE - table with estimation to the results
FALSE - table with the inclusion of regressors in the best models

Value

A list with best_models objects:

  1. matrix with inclusion of the regressors in the best models

  2. matrix with estimation output in the best models with regular standard errors

  3. knitr_kable table with inclusion of the regressors in the best models (the best for the display on the console - up to 11 models)

  4. 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)

  5. gTree table with inclusion of the regressors in the best models (displayed as a plot). Use grid::grid.draw() to display.

  6. gTree table with estimation output in the best models with regular standard errors (displayed as a plot). Use grid::grid.draw() to display.

Examples


data <- Trade_data[,1:10]
modelSpace <- model_space(data, M = 9, g = "UIP")
bma_list <- bma(modelSpace)
models <- best_models(bma_list, best = 3)
models[[4]]


rmsBMA documentation built on March 14, 2026, 5:06 p.m.