Xinyi Li asked how to keep track of which coxph models, called from within a
loop, were responsible for warning messges. One solution is to modify the
coxph code so that those models are marked in the return coxph object. Below
is a set of changes to the final 40 lines of coxph.fit, that will ca
One way is to turn the 'warnings' into 'errors' and then trap the error:
> library(survival)
>
> time= c(4,3,1,1,2,2,3,3,2)
> status=c(1,0,0,0,1,1,1,1,1)
> TIME=Surv(time,status)
> x= cbind(c(0,2,1,1,0,0,0,2,0),c(0,2,1,1,0,0,0,0,0))
>
> results=matrix(NA,ncol=3,nrow=ncol(x))
> colnames(results)=c(
Hi,
I want to fit multiple cox models using the coxph() function. To do
this, I use a for-loop and save the relevant results in a separate
matrix. In the example below, only two models are fitted (my actual
matrix has many more columns), one gives a warning message, while the
other does not. Right
3 matches
Mail list logo