Learn R Programming

bayesnec (version 2.1.3.0)

+.bnecfit: "Add" multiple bnecfit objects into one single bayesmanecfit object containing Bayesian model averaging statistics.

Description

"Add" multiple bnecfit objects into one single bayesmanecfit object containing Bayesian model averaging statistics.

Usage

# S3 method for bnecfit
+(e1, e2)

Value

An object of class bayesmanecfit.

Arguments

e1

An object of class bnecfit.

e2

An object of class bnecfit.

Examples

Run this code
if (FALSE) {
library(bayesnec)
nec4param <- pull_out(manec_example, model = "nec4param")
ecx4param <- pull_out(manec_example, model = "ecx4param")
# Go from two bayesnecfit objects to a bayesmanecfit object.
#   In this example case it is redundant because it recovers the original
#   `manec_example`.
nec4param + ecx4param
# Add a bayesnecfit object to an existing bayesmanecfit object
nechorme4 <- nec_data |>
  dplyr::mutate(y = qlogis(y)) |>
  (\(.)bnec(formula = y ~ crf(x, model = "nechorme4"),
            data = ., iter = 200, warmup = 150, chains = 2,
            stan_model_args = list(save_dso = FALSE)))()
nechorme4 + manec_example
}

Run the code above in your browser using DataLab