plot.summary.bmult: Plot estimates

View source: R/bmult_S3methods.R

plot.summary.bmultR Documentation

Plot estimates

Description

Plots the posterior estimates from the unconstrained multi- or binomial model.

Usage

## S3 method for class 'summary.bmult'
plot(
  x,
  main = NULL,
  xlab = NULL,
  ylab = NULL,
  xlim = NULL,
  ylim = NULL,
  panel.first = NULL,
  ...
)

Arguments

x

A summary.bmult-object returned by summary().

main

character. A string used as title. Defaults to the informed hypothesis and the Bayes factor.

xlab

character. A string used as title for the x-axis.

ylab

character. A string used as title for the y-axis.

xlim, ylim

numeric vectors of length 2, giving the x and y coordinates ranges.

panel.first

expression. Evaluated after the plot axes are set up but before any plotting takes place. This can be useful for drawing background grids or null distributions.

...

additional arguments passed to plot.summary.bmult-method.

Value

Invisibly returns a data.frame with the plotted estimates.

Examples

# data
x <- c(3, 4, 10, 11, 7, 30)
# priors
a <- c(1, 1, 1, 1, 1, 1)
# restricted hypothesis
factor_levels <- c('theta1', 'theta2', 'theta3', 'theta4', 'theta5', 
                   'theta6')
Hr <- c('theta1', '<',  'theta2', '&', 'theta3', '=', 
'theta4', ',', 'theta5', '<', 'theta6')
output_total  <- mult_bf_informed(x, Hr, a, factor_levels, seed=2020, 
niter=1e3, bf_type = "BFer")
plot(summary(output_total))

# data for a big Bayes factor
x <- c(3, 4, 10, 11, 7, 30) * 1000
output_total  <- mult_bf_informed(x, Hr, a, factor_levels, seed=2020, 
niter=1e3, bf_type = "BFre")
plot(summary(output_total))

multibridge documentation built on Nov. 1, 2022, 5:05 p.m.