SubLasso: Logistic model via Lasso penalty with a subset features

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/SubLasso.R

Description

Fit a logistic model via Lasso penalty. A subset features can be fixed in the model.

Usage

1
SubLasso(X, y, subset, nfold)

Arguments

X

gene expression matrix, column is sample, row is gene(probe sets).

y

category vector, 1 (positive, illness) or 0 (negative, normal).

subset

gene (probe sets) names must be included in the model; Default is null set.

nfold

number of cross-validation; Default is 5.

Details

some details

Value

selname

features selected by the model.

w

the coefficient (weight) of feature in the model

valid

sensitivity (Sn), specificity (Sp), Accuracy (Acc), and Matthews correlation coefficient(Mcc)

description

the description statistics of selected features by group.

correlation

the correlations between all selected features.

Author(s)

Youxi Luo

References

Friedman, J., Hastie, T. and Tibshirani, R. (2008) Regularization Paths for Generalized Linear Modelsvia Coordinate Descent, http://www.stanford.edu/~hastie/Papers/glmnet.pdf Journal of Statistical Software, Vol. 33(1), 1-22 Feb 2010. http://www.jstatsoft.org/v33/i01/

See Also

glmnet

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
 
#screen device is not support in examples but SubLasso function use it to visualize results.
#when you want to test examples, please uncomment following code.

##### Example 1
#data(Golub_Merge)
#X <- Golub_Merge$X
#y <- Golub_Merge$y
#f1=SubLasso(X,y,nfold=10)

## predict.sublasso(f1,X[1:10,]) ##error predicted x
#predy=predict.sublasso(f1,X)
#predy=predict.sublasso(f1,X,type="class")
#predy=predict.sublasso(f1,X,type="link")
#predy=predict.sublasso(f1,X,type="response")
#predy=predict.sublasso(f1,X,type="response",s=0.05)
#subset=f1$selname
#f2=SubLasso(X,y,subset,nfold=10)

#subset=row.names(X)[1:10]
#f3=SubLasso(X,y,subset,nfold=10)

#predy=predict.sublasso(f3,X)
#predy=predict.sublasso(f3,X,type="class")
#predy=predict.sublasso(f3,X,type="link")
#predy=predict.sublasso(f3,X,type="response")
#predy=predict.sublasso(f3,X,type="response",s=0.05)

###Example 2

#data(Colon)
#X<-t(Colon$X)
#y_tmp<-Colon$Y
#y<-ifelse(y_tmp==1,1,0)
#f1=SubLasso(X,y,nfold=10)
#subset=f1$selname
#f2=SubLasso(X,y,subset,nfold=10)
#subset=row.names(X)[30:40]
#f3=SubLasso(X,y,subset,nfold=10)

SubLasso documentation built on May 29, 2017, 8:45 p.m.