Subsample.w {SuRF.vs}R Documentation

Subsample.w

Description

This function is to subsample the data and perform LASSO (single time) on the selected samples

Usage

Subsample.w(data, fold, Alpha, prop, weights, family, Type)

Arguments

data

the dataframe should be arranged in the way such that columns are X1,X2,X3....,Xp, status. Where Xi's are variables and status is the outcome(for the logistic regression, the outcome is in terms of 0/1)

fold

fold used in lasso cross validation to select the tuning parameter

Type

should use 'class' for classification always

Alpha

1 for Lasso,0 for ridgeression

prop

percentage of samples left out for each subsamping

weights

=TRUE: if weighted version is desired; =FALSE, otherwise (binomial model);weights: =vector of weights of the same size as the sample size N: if weighted version is desired;=FALSE, otherwise (other generalized model)

family

the distribution family for the response variable.

Value

lambda: the tuning parameter that within 1 sd of the tuning parameter gives the lowest CV error

coef: a table shows the name of the selected variables by LASSO and its coefficients

table: there are a equal proportion of samples from each status left out and we use the model built on the selected

subsamples to predict those left out ones. Table contains two columns: column1 is the predicted value and column2 is the true class

error: misclassification error based on the above table

Beta: should be a vector of length p+1 and this is the beta coefficients from the LASSO model; Be aware of that the intercept is placed at the end of this vector


[Package SuRF.vs version 1.1.0.1 Index]