get_bf: Extract Bayes factor from S4 object

Description Usage Arguments Value Examples

View source: R/get_bf.R

Description

get_bf extracts the Bayes factor from an S4 object (i.e., baymedrSuperiority, baymedrEquivalence, baymedrNonInferiority), created from the functions super_bf, equiv_bf, or infer_bf.

Usage

1
get_bf(object)

Arguments

object

An S4 object of class baymedrSuperiority, baymedrEquivalence, or baymedrNonInferiority.

Value

A numeric scalar, providing the Bayes factor from an S4 object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Extract Bayes factor from a baymedrSuperiority object using raw data:
mod_super <- super_bf(x = rnorm(100, 10, 15),
                      y = rnorm(130, 13, 10))

get_bf(object = mod_super)

# Extract Bayes factor from a baymedrEquivalence object using raw data:
mod_equiv <- equiv_bf(x = rnorm(100, 10, 15),
                      y = rnorm(130, 13, 10))

get_bf(object = mod_equiv)

# Extract Bayes factor from a baymedrNonInferiority object using raw data:
mod_infer <- infer_bf(x = rnorm(100, 10, 15),
                      y = rnorm(130, 13, 10),
                      ni_margin = 1)

get_bf(object = mod_infer)

baymedr documentation built on March 28, 2021, 9:08 a.m.