Learn R Programming

vimp (version 2.3.3)

sample_subsets: Create necessary objects for SPVIMs

Description

Creates the Z and W matrices and a list of sampled subsets, S, for SPVIM estimation.

Usage

sample_subsets(p, gamma, n)

Value

a list, with elements Z (the matrix encoding presence/absence of each feature in the uniquely sampled subsets), S (the list of unique sampled subsets), W (the matrix of weights), and z_counts (the number of times each subset was sampled)

Arguments

p

the number of covariates

gamma

the fraction of the sample size to sample (e.g., gamma = 1 means sample n subsets)

n

the sample size

Examples

Run this code
p <- 10
gamma <- 1
n <- 100
set.seed(100)
subset_lst <- sample_subsets(p, gamma, n)

Run the code above in your browser using DataLab