R/cal.cox.coef.R

cal.cox.coef <-
function (gnExpMat, survivaltime, censor){
	cox.coef = NULL

        max.col = ifelse (is.matrix(gnExpMat), ncol(gnExpMat), 1)

        for (i in 1:max.col){
                if(is.matrix(gnExpMat))
                        var = gnExpMat[,i]
                else
                        var = gnExpMat
                cox.t = coxph(Surv (survivaltime, censor)~var)          
                cox.coef = c(cox.coef, cox.t$coef)
        }
  return (cox.coef)
}

Try the survJamda package in your browser

Any scripts or data that you put into this service are public.

survJamda documentation built on May 1, 2019, 8:50 p.m.