Learn R Programming

lsplsGlm (version 1.0)

preselected.sample: Selected randomized controlled random sample

Description

Creates a random sample keeping the proportions of 1 and 0 that are in label.

Usage

preselected.sample(label, ns)

Arguments

label

vector of 0 and 1.

ns

sample size, contain ns random index of label.ns has to be lower than length of label.

Value

index.learn

a vector of size ns containing random index of label.

Details

The aim of this method is to select randomly ns index of label. This function returns a vector of size ns composed of random rank of label.

Examples

Run this code
# NOT RUN {
#load data
data(BreastCancer)
index<-preselected.sample(BreastCancer$Y,10)
index
BreastCancer$Y[index]      
# }

Run the code above in your browser using DataLab