How to interpret LASSO results for creating gene signature ?
0
0
Entering edit mode
11 months ago

I'm interested in creating a gene signature model for testing on an independent dataset using LASSO. I have used the LASSO code but not able to interpret the results properly. Can anyone please suggest if I have used the correct code for gene signature correction.

My data is available here: LASSO32.txt

My code

##Load libraries###
require(tidyverse)
require(glmnet)
require(survival)
library(rio)

##Load data###
coxdata <- read.delim("LASSO_32.txt", header = TRUE)

x = data.matrix(coxdata[,2:33]) 
y <- data.matrix(coxdata[,34:35]) 

cv.out = cv.glmnet(x, y, alpha = 1, family = 'cox') 
plot(cv.out) 
bestlam = cv.out$lambda.min
coef(cv.out, s = bestlam) 

coxlasso <- glmnet(
  x = x,
  y = y,
  alpha = 1, family = 'cox')
plot(coxlasso)


out = glmnet(x, y, alpha = 1, lambda = bestlam, family = 'cox') 
lasso_coef = predict(out, type = "coefficients", s = bestlam)[1:32,]
lasso_coef
lasso_coef[lasso_coef != 0]
plot(lasso_coef)
Microarray KM OS plot • 569 views
ADD COMMENT
0
Entering edit mode

Hi. Did you find the answer for your question. Can you share your picture of your data. What variable you put in y.

ADD REPLY

Login before adding your answer.

Traffic: 1147 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6