How to make batch univariate cox analysis for list
1
0
Entering edit mode
4.8 years ago
BioLite ▴ 20

I have been trying to make batch univariate cox analysis with apply family and for loops, but I can't edit useful and effective codes. Please, please help me!

I have prepared two kinds of data. Data A, "data_train_list" is a list comprising many data frames. And each column elements in every data frame will serve as independent variables in my codes. Data B, "os_train_list" also is a list including data with data frames. And each data frame in this list will serve as the response variable.

Here are my codes,

    for (i in 1:length(data_train_list)) {comb_resBM[[i]]=apply(data_train_list[[i]],2,FUN = function(x){
  coxph(Surv(os_train_list[[i]]$time,os_train_list[[i]]$status)~.,data = data_train_list[[i]] )
})}

I hope finally codes can analyze correctly and effectively, because the data in the analysis is huge actually.

Thanks in advance!

batch univariate cox analysis apply • 2.1k views
ADD COMMENT
2
Entering edit mode
4.8 years ago

My Bioconductor package, RegParallel, will do this for you, i.e., it can test each gene independently in a Cox proportional hazards regression model and generate a neat output table for you (and process the variables via parallel processing). See if you can understand how to use it from the vignette (see section 3.4: 3.4 Survival analysis via Cox Proportional Hazards regression

Kevin

ADD COMMENT

Login before adding your answer.

Traffic: 1906 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