Learn R Programming

MPAgenomics (version 1.2.3)

variableSelection: SNPs selection

Description

This function selects the most relevant variables according to a response.

Usage

variableSelection(
  dataMatrix,
  dataResponse,
  nbFolds = min(length(dataResponse), 10),
  loss = c("logistic", "linear"),
  plot = TRUE,
  pkg = c("HDPenReg", "spikeslab"),
  ...
)

Arguments

dataMatrix

Matrix containing the data, each row is a different sample.

dataResponse

response associated to the data.

nbFolds

number of folds in the cross validation.

loss

either "logistic" (binary response) or "linear" (quantitative response).

plot

If TRUE plot cross-validation mean squared error (default=TRUE).

pkg

Either "HDPenReg" or "spikeslab". Ued package in linear case.

...

spplementary arguments for cv.glmnet function in case of logistic loss or for HDlars or spikeslab function for linear loss.

Value

a list containing

variable

A vector containing the index of all selected variables.

coefficient

A vector containing the coefficients of all selected variables.

intercept

Intercept of the model.