getEffectiveSubspace {fkbma}R Documentation

Get Effective Subspace

Description

This function identifies the "effective subspace" where exposure is effective based on posterior inference results from the FK-BMA model. It analyzes interaction terms between exposure and covariates, allowing for both binary and continuous variables.

Usage

getEffectiveSubspace(results, newdata = NULL, alpha = 0.05, pip_cutoff = 0.1)

Arguments

results

A fitted model object from rjMCMC.

newdata

Optional. A new dataset for evaluating the effective subspace. If NULL, the function uses results$data_fit.

alpha

Numeric. The alpha level used for computing quantiles. Default is 0.05.

pip_cutoff

Numeric. The minimum Posterior Inclusion Probability (PIP) threshold for selecting covariates. Default is 0.1.

Details

Value

A list with the following components:

quantiles

A vector of quantile values for the exposure effect in the new dataset.

is_effective_subspace

A logical vector indicating whether the exposure effect is positive in the effective subspace.

Examples


# Example dataset
data("simulated_data")

candsplinevars <- c("X_1")
candbinaryvars <- paste0("Z_", 1:5)
candinter <- c(candsplinevars, candbinaryvars)

results <- rjMCMC(simulated_data, candsplinevars, candbinaryvars, candinter,
                  outcome = "Y", factor_var = "trt")
getEffectiveSubspace(results)


[Package fkbma version 0.2.0 Index]