Description Usage Arguments Value Author(s) Examples
method for performing Cox regression
1 | rowCoxTests(X, y, option = c("fast", "slow"), ...)
|
X |
Gene expression data. The following formats are available: matrix Rows correspond to observations, columns to variables. data.frame Rows correspond to observations, columns to variables. ExpressionSet rowCoxTests will extract the expressions using exprs(). |
y |
Survival Response, an object of class: Surv if X is of type data.frame or matrix character if X is of type ExpressionSet. In this case y is the name of the survival response in the phenoData of X. If survival time and indicator are stored separately in the phenoData one can specify a two-element character vector the first element representing the survival time variable. |
option |
"fast" loops over rows in C, "slow" calls coxph directly in R. The latter method may be used if something goes wrong with the "fast" method. |
... |
currently unused |
dataframe with two columns: coef = Cox regression
coefficients, p.value =
Wald Test p-values. Rows correspond to the rows of X.
Yuqing Zhang, Christoph Bernau, Levi Waldron
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 40 41 42 43 | #test
##regressor-matrix (gene expressions)
X<-matrix(rnorm(1e6),nrow=10000)
#seed
set.seed(123)
#times
time<-rnorm(n=ncol(X),mean=100)
#censoring(1->death)
status<-rbinom(n=ncol(X),size=1, prob=0.8)
##survival object
y<-Surv(time,status)
## Do 10,000 Cox regressions:
system.time(output <- rowCoxTests(X=X,y=y, option="fast"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.