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

plot.contrast.rms

plot.contrast.rms


Description

Plot Bayesian Contrast Posterior Densities

Usage

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

Arguments

x

the result of contrast.rms

bivar

set to TRUE to plot 2-d posterior density contour

bivarmethod

see rmsb::pdensityContour()

prob

posterior coverage probability for HPD interval or 2-d contour

which

applies when plotting the result of contrast(..., fun=), defaulting to showing the posterior density of both estimates plus their difference. Set to "ind" to only show the two individual densities or "diff" to only show the posterior density for the differences.

nrow

for ggplot2::facet_wrap()

ncol

likewise

...

unused

Details

If there are exactly two contrasts and bivar=TRUE plots an elliptical or kernal (based on bivarmethod posterior density contour with probability prob). Otherwise plots a series of posterior densities of contrasts along with HPD intervals, posterior means, and medians. When the result being plotted comes from contrast with fun= specified, both the two individual estimates and their difference are plotted.

Value

ggplot2 object

Author(s)

Frank Harrell


rms

Regression Modeling Strategies

v6.2-0
GPL (>= 2)
Authors
Frank E Harrell Jr <fh@fharrell.com>
Initial release
2021-03-17

We don't support your browser anymore

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