Learn R Programming

SSVS (version 2.1.0)

plot.ssvs_mi: Plot SSVS-MI Estimates and Marginal Inclusion Probabilities (MIP)

Description

This function creates a plot of SSVS-MI estimates with minimum and maximum and a plot for marginal inclusion probabilities (MIP) optional thresholds for highlighting significant predictors..

Usage

# S3 method for ssvs_mi
plot(
  x,
  type = "both",
  threshold = 0.5,
  legend = TRUE,
  est_title = NULL,
  mip_title = NULL,
  color = TRUE,
  ...
)

Value

Two ggplot2 objects representing the plot of SSVS estimates and the plot of MIP with thresholds.

Arguments

x

An ssvs result object obtained from ssvs_mi()

type

Defaults to "both", can change to "estimate" or "MIP".

threshold

A numeric value (between 0 and 1) specifying the MIP threshold to highlight significant predictors. Defaults to 0.5.

legend

Logical indicating whether to include a legend for the threshold. Defaults to TRUE.

est_title

A character string specifying the plot title. Defaults to "SSVS-MI estimates".

mip_title

A character string specifying the plot title. Defaults to "Multiple Inclusion Probability for SSVS-MI".

color

Logical indicating whether to use color to highlight thresholds. Defaults to TRUE.

...

Ignored

Examples

Run this code
# \donttest{
data(imputed_mtcars)
outcome <- 'qsec'
predictors <- c('cyl', 'disp', 'hp', 'drat', 'wt', 'vs', 'am', 'gear', 'carb','mpg')
imputation <- '.imp'
results <- ssvs_mi(data = imputed_mtcars, y = outcome, x = predictors, imp = imputation)
plot(results)
# }

Run the code above in your browser using DataLab