Learn R Programming

bayesics (version 2.0.2)

coef: Coefficient extraction for bayesics objects

Description

Coefficient extraction for bayesics objects

Usage

# S3 method for lm_b
coef(object, ...)

# S3 method for aov_b coef(object, ...)

# S3 method for np_glm_b coef(object, ...)

# S3 method for glm_b coef(object, ...)

# S3 method for lm_b_bma coef(object, ...)

Value

vector of coefficients

Arguments

object

bayesics object

...

optional arguments.

Examples

Run this code
# \donttest{
set.seed(2025)
N = 500
test_data = 
  data.frame(x1 = rep(letters[1:5],N/5))
test_data$outcome = 
  rnorm(N,-1 + 2 * (test_data$x1 %in% c("d","e")) )

# Fit 1-way ANOVA model
fit1 <-
  aov_b(outcome ~ x1,
        test_data,
        prior_mean_mu = 2,
        prior_mean_nu = 0.5,
        prior_var_shape = 0.01,
        prior_var_rate = 0.01)
coef(fit1)
# }

Run the code above in your browser using DataLab