Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot.rmsb

Plot Posterior Densities and Summaries


Description

For an rms Bayesian fit object, plots posterior densities for selected parameters along with posterior mode, mean, median, and highest posterior density interval. If the fit was produced by stackMI the density represents the distribution after stacking the posterior draws over imputations, and the per-imputation density is also drawn as pale curves. If exactly two parameters are being plotted and bivar=TRUE, hightest bivariate posterior density contrours are plotted instead, for a variety of prob values including the one specified, using

Usage

## S3 method for class 'rmsb'
plot(
  x,
  which = NULL,
  nrow = NULL,
  ncol = NULL,
  prob = 0.95,
  bivar = FALSE,
  bivarmethod = c("ellipse", "kernel"),
  ...
)

Arguments

x

an rms Bayesian fit object

which

names of parameters to plot, defaulting to all non-intercepts. Can instead be a vector of integers.

nrow

number of rows of plots

ncol

number of columns of plots

prob

probability for HPD interval

bivar

set to TRUE to plot bivariate density contours instead of univariate results (ignored if the number of parameters plotted is not exactly two)

bivarmethod

passed as method argument to pdensityContour

...

passed to pdensityContour

Value

ggplot2 object

Author(s)

Frank Harrell


rmsb

Bayesian Regression Modeling Strategies

v0.0.2
GPL (>= 3)
Authors
Frank Harrell [aut, cre] (<https://orcid.org/0000-0002-8271-5493>), Ben Goodrich [ctb] (contributed Stan code), Ben Bolker [ctb] (wrote original code that is folded into the pdensityContour function), Doug Bates [ctb] (write original code for highest posterior density interval that is folded into the HPDint function)
Initial release
2021-02-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.