simulateVCM: Simulate a dataset for testing the performance of screenVCM

View source: R/simulateVCM.R

simulateVCMR Documentation

Simulate a dataset for testing the performance of screenVCM

Description

Simulates a dataset that can be used to test the screenVCM function, and to test the performance of the proposed method under different scenarios. The simulated dataset has a single U-covariate and p X-predictors, only a few of which have nonzero effect.

Jingyuan Liu for providing some of the code upon which this function is based.

Usage

simulateVCM(
  n = 200,
  rho = 0.4,
  p = 1000,
  trueIdx = c(2, 100, 400, 600, 1000),
  betaFun = NULL
)

Arguments

n

Number of subjects in the simulated dataset

rho

The correlation matrix of columns of X.

p

The total number of features to be screened from

trueIdx

The indexes for the active features in the simulated X matrix. This should be a vector, and the values should be a subset of 1:p.

betaFun

A list of functions of U, one function for each entry in trueIdx, giving the varying effects of each active predictor in the simulated X matrix.

Value

A list with following components: X Matrix of predictors to be screened. It will have n rows and p columns. Y Vector of responses. It will have length of n. U A vector representing a covariate with which the coefficient functions vary.

Examples

set.seed(12345678)
results <- simulateVCM(p=1000)

VariableScreening documentation built on June 24, 2022, 1:06 a.m.