What you appear to want are all of the univariate models. You can get this
with a loop (and patience - it won't be fast).
ngene <- ncol(genes)
coefmat <- matrix(0., nrow=ngene, ncol=2)
for (i in 1:ngene) {
tempfit <- coxph(Surv(time, relapse) ~ genes[,i])
coefmat[i,] <- c(tempfit$coef, sqrt(tempfit$var))
}
However, the fact that R can do this for you does not mean it is a good idea.
In fact, doing all of the univariate tests for a microarray has been shown by
many people to be a very bad idea. There are several approaches to deal with
the key issues, which you should research before going forward.
Terry Therneau
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.