posterior_dens: Kernel Densities of the Coefficients

View source: R/posterior_dens.R

posterior_densR Documentation

Kernel Densities of the Coefficients

Description

This function draws graphs of the posterior densities of all the coefficients of interest.

Usage

posterior_dens(x, prior = "binomial", SE = "standard")

Arguments

x

An object of class badp_bma, typically returned by bma.

prior

Parameter indicating which model prior should be used for calculations:

  1. "binomial" - using binomial model prior (default option)

  2. "beta" - using binomial-beta model prior

SE

Parameter indicating which standard errors should be used in calculation of posterior standard deviation:

  1. "standard" - regular standard errors (default option)

  2. "robust" - robust standard errors

Value

A list with the graphs of the posterior densities of coefficients for all the considered regressors.

Examples


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
)

posterior_graphs <- posterior_dens(bma_results, prior = "binomial", SE = "robust")


badp documentation built on Sept. 15, 2026, 1:08 a.m.