BRBVS: Bivariate Rank-Based Variable Selection

View source: R/BRBVS.R

BRBVSR Documentation

Bivariate Rank-Based Variable Selection

Description

This function performs bivariate rank-based variable selection (BRBVS) based on copula survival copula models. It computes rankings for covariates and selects a specified number of variables according to the estimated probabilities. The function returns rankings and selected variables for different criteria.

Usage

BRBVS(y, x, kmax, copula, margins, m, tau, n.rep, metric)

Arguments

y

Time to events and censoring matrix as a data frame.

x

Covariates matrix as a data frame. Input matrix containing the predictor variables.

kmax

Numeric. The maximum number of variables to be selected. Must be positive, non-zero, and less than or equal to the number of columns in x.

copula

Character. Type of copula employed in the algorithm. Must be one of the following types: N, C0, C90, C180, C270, GAL0, GAL90, GAL180, GAL270, J0, J90, J180, J270, G0, G90, G180, G270, F, AMH, FGM, T, PL, HO default is C0. See GJRM package documentation for details: GJRM package.

margins

Character. Type of margin employed in the algorithm. Must be one of PH, PO, probit. Default is c(PH, PO). See GJRM package documentation for more on margins: GJRM package.

m

Numeric. Subsample size, typically set to n/2 where n is the number of observations.

tau

Numeric. A user-defined threshold for variable selection. Must be in the interval (0,1), exclusive.

n.rep

Integer. Number of Bootstrap replicates. Must be positive.

metric

Character, specifies the metric used for ranking the variables. Must be one of 'CE', 'FIM', 'Abs'. Default is 'FIM'.

Value

A list containing the following components:

  • mtx.act1E: Numeric vector of indices of the active variables selected based on the first survival function. Remaining positions (up to 'kmax') are filled with 0.

  • score.r1E: Numeric vector of the ranked scores for variable selection based on the first survival function, with remaining positions (up to 'kmax'-1) filled with 0.

  • freq.rel1E: Numeric vector of the relative frequencies of selected variables based on the first survival function (frequencies divided by 'n.rep').

  • mtx.act2E: Numeric vector of indices of the active variables selected based on the second survival function. Remaining positions (up to 'kmax') are filled with 0.

  • score.r2E: Numeric vector of the ranked scores for variable selection based on the second survival function, with remaining positions (up to 'kmax'-1) filled with 0.

  • freq.rel2E: Numeric vector of the relative frequencies of selected variables based on the second survival function (frequencies divided by 'n.rep').

  • metric: The metric used for ranking the variables.

  • kmax: The maximum number of variables to be selected.

  • copula: The type of copula employed in the algorithm.

  • margins: The type of margins employed in the algorithm. . - Namecondings: Table with name of covariates and encoding used in the output.

Examples


###############################################
# Example based on AREDS dataset
# This analysis serves solely as a
# demonstration of the function's capabilities.
###############################################

data(AREDS)
Y<- AREDS[,c('t11','t12', 't21', 't22', 'cens1', 'cens2', 'cens')]
X<- AREDS[,c(3, 9)]
# Including just 1 covariates as example
X$SevScale1E <- scale(as.numeric( X$SevScale1E))
X$SevScale2E <- scale(as.numeric(X$SevScale1E))


Bivrbvs<- BRBVS(y=Y, x=X, kmax=2,copula='C0',
                      margins=c('PO','PO'),
                      m=628 , # try to set m=628 (628 is the sample size)
                      tau=0.5,
                      n.rep=1, # number of bootstrap = 1
                      metric='FIM')
                      







BRBVS documentation built on June 27, 2024, 5:13 p.m.

Related to BRBVS in BRBVS...