plotbf: Plot Sequential Bayesian Analysis

View source: R/plot.R

plotbfR Documentation

Plot Sequential Bayesian Analysis

Description

This function allows to plot a sequential Bayesian analysis.

Usage

plotbf(
  data,
  sims.df = NULL,
  sims.df.col = "bf",
  color = "black",
  coordy = NULL,
  label.x = "N"
)

Arguments

data

A seqbf object or a vector containing sequential Bayes Factors or a list containing multiple vectors.

sims.df

A dataframe containing simulations, including column "simid". Set to NULL if you don't want to display simulations.

sims.df.col

The name of the column of the simulation dataframe to compare to.

color

A color in which the Seq BF-function will be drawn.

coordy

A vector containing the minimum and maximum value of the y-coordinates to be drawn.

label.x

A character that overrides the label for the x-axis ("N" for sum scores, "Trials" for binomial data).

Details

The BF analysis can be plotted by itself or in comparison to simulated data sets. GGplot2 is used to draw an image. BFs above 1 indicate evidence towards H1, BFs below 1 indicate evidence towards H0. Depending on the amount of simulations, drawing might take a while. It might be wise to chose a smaller simulation set for this purpose.

Examples


plot(seqbf)

p.bf <- plotbf(tbl$bf)
p.bf

plotbf(list(test1=bf1,test2=bf2))

plotbf(tbl$bf, sims.df = sims)

sims1000 <- subset(sims, simid <= 1000)
plotbf(tbl$bf, sims.df = sims1000)

mrzdcmps/changeofevidence documentation built on Feb. 27, 2025, 3:10 a.m.