plot.pbayes: Plot Bayesian Probability Mapping Results

View source: R/pbayes.R

plot.pbayesR Documentation

Plot Bayesian Probability Mapping Results

Description

Visualizes the results of Bayesian probability mapping for p-values by plotting the fitted uniform-beta mixture distribution alongside the histogram of the original p-values. This function provides a graphical representation of how well the mixture model fits the data and allows for the inspection of posterior probabilities associated with each p-value.

Usage

## S3 method for class 'pbayes'
plot(pb, hist_breaks = 70, linewidth = 1, brewer_pal = "Set2")

Arguments

pb

A 'pbayes' object containing the results from Bayesian probability mapping, including the fitted mixture model and original p-values. Must be of class 'pbayes'.

hist_breaks

Integer, the number of breaks (bins) to use for the histogram of p-values. Defaults to 70.

linewidth

Numeric, specifying the line width for the mixture model components. Defaults to 1.

brewer_pal

Character string, specifying the color palette from the RColorBrewer package to use for the different components of the mixture model. Defaults to "Set2".

Value

A ggplot object representing the fitted mixture model and the distribution of p-values. This object can be further modified using ggplot2 functions or printed to display the plot.

Examples

## Not run: 
  # Assuming you have a pbayes object `pb` from previous analysis
  plot.pbayes(pb)

  # Customizing the plot
  plot.pbayes(pb, hist_breaks = 100, linewidth = 2, brewer_pal = "Dark2")

## End(Not run)


stevehoang/pbayes documentation built on Feb. 16, 2024, 2:20 p.m.