Learn R Programming

SSVS (version 2.1.0)

ssvs_mi: Perform SSVS on Multiply Imputed Datasets

Description

This function performs Stochastic Search Variable Selection (SSVS) analysis on multiply imputed datasets for a given set of predictors and a response variable. It supports continuous response variables and calculates aggregated results across multiple imputations.

Usage

ssvs_mi(
  data,
  y,
  x,
  imp,
  imp_num = 5,
  interval = 0.9,
  continuous = TRUE,
  progress = FALSE
)

Value

An ssvs_mi object containing aggregated results across imputations that can be used in summary().

Arguments

data

A dataframe containing the variables of interest, including an .imp column for imputation identifiers.

y

The response variable (character string).

x

A vector of predictor variable names.

imp

The imputation variable.

imp_num

The number of imputations to process (default is 5).

interval

Confidence interval level for summary results (default is 0.9).

continuous

Logical indicating if the response variable is continuous (default is TRUE).

progress

Logical indicating whether to display progress (default is FALSE).

Examples

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

Run the code above in your browser using DataLab