Learn R Programming

LatentBMA (version 0.1.2)

plotBeta: Visualization of Posterior Means of Coefficients

Description

plotBeta produces a visualization of the estimated posterior means of the coefficients, extracted from ULLGM_BMA results.

Usage

plotBeta(x,
         variable_names = NULL,
         sort           = TRUE)

Value

Returns a 'ggplot2::ggplot' object.

Arguments

x

The output object of ULLGM_BMA.

variable_names

A character vector specifying the names of the columns of X.

sort

Logical, indicating whether the plot should be sorted by posterior mean. Defaults to TRUE.

Author

Gregor Zens

Examples

Run this code
# Load package
library(LatentBMA)

# Example: Estimate a PLN model under a BRIC prior with m = p/2 using simulated data
# Note: Use more samples for actual analysis
# Note: nsave = 250 and nburn = 250 are for demonstration purposes
X <- matrix(rnorm(100*20), 100, 20)
z <- 2 + X %*% c(0.5, -0.5, rep(0, 18)) + rnorm(100, 0, sqrt(0.25))
y <- rpois(100, exp(z))
results_pln <- ULLGM_BMA(X = X, y = y, model = "PLN", nsave = 250, nburn = 250)
plotBeta(results_pln)

Run the code above in your browser using DataLab