| best_models | R Documentation |
Ranks the models in a fitted model space by their posterior model probability and returns the highest ranked ones as a list of individual models, each carrying its own estimates and diagnostics.
best_models(x, prior = "binomial", best = 5, round = 3)
x |
An object of class |
prior |
Model prior used to rank the models: |
best |
Number of models to return. If it exceeds the size of the model space, every model is returned and a message is issued. |
round |
Number of decimal places used when the estimates are formatted for display. The stored values are not rounded. |
The object returned is a list of badp_model objects, one per
selected model, ordered from the highest to the lowest posterior model
probability. Individual models are reached by position, for example
best_models(bma_results)[[1]] for the best one, and each has its own
print, summary and coef methods. The container has
print, summary and plot methods that display the whole
selection.
An object of class badp_best_models: a list of
badp_model objects with attributes prior, n_models
(the size of the model space), reg_names and digits.
bma, summary.badp_best_models,
plot.badp_best_models, print.badp_model
data(full_model_space)
results <- bma(full_model_space)
best <- best_models(results, best = 5)
best # the selection
best[[1]] # the single best model
coef(best[[1]]) # its coefficients
summary(best, robust = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.