Learn R Programming

bayestestR (version 0.8.0)

update.bayesfactor_models: Methods for bayesfactor_models

Description

Methods for bayesfactor_models

Usage

# S3 method for bayesfactor_models
update(object, subset = NULL, reference = NULL, ...)

# S3 method for bayesfactor_models as.matrix(x, ...)

Arguments

object, x
subset

Vector of model indices to keep or remove.

reference

Index of model to rereference to, or "top" to reference to the best model, or "bottom" to reference to the worst model.

...

Currently not used.

Examples

Run this code
# NOT RUN {
library(lme4)
lmer1 <- lmer(Sepal.Length ~ Petal.Length + (1 | Species), data = iris)
lmer2 <- lmer(Sepal.Length ~ Petal.Length + (Petal.Length | Species), data = iris)
lmer3 <- lmer(
  Sepal.Length ~ Petal.Length + (Petal.Length | Species) + (1 | Petal.Width),
  data = iris
)

m <- bayesfactor_models(lmer1, lmer2, lmer3, denominator = 1)
m

update(m, reference = "bottom")
as.matrix(m)
# }

Run the code above in your browser using DataLab