Learn R Programming

fake (version 1.4.0)

SamplePredictors: Simulation of binary contribution status

Description

Simulates the binary contribution status of potential predictor variables from different blocks to outcome variables. For each outcome, the set of true predictors is sampled from one block of potential predictors. If the blocks of variables are independent, the outcomes will be independent too.

Usage

SamplePredictors(pk, q = NULL, nu = 0.1, orthogonal = TRUE)

Value

A binary matrix encoding the contribution status of each predictor variable (columns) to each outcome variable (rows).

Arguments

pk

vector of the number of variables per group, defining the block structure.

q

number of outcome variables. By default, one block of predictor is linked to one outcome, i.e. q=sum(pk).

nu

vector of probabilities. Each entry corresponds to one block of predictors and defines the probability for each predictor within the block to be chosen as true predictor of the corresponding outcome variable.

orthogonal

logical indicating if the outcomes have to be defined from independent blocks of predictors as encoded in pk.