... > Occasionally, (about 1 in every 100 simulations) I get the following warning: > Error in coxph(Surv(start, end, censorind) ~ binary + uniform : > X matrix deemed to be singular; variable 2
It is not uncommon for the X matrix in a Cox model to be close enough to singular that the program thinks it is singular, i.e., one of the pivot elements falls below the tolerance threshold while performing a Cholesky decomposition. To understand your case better you need to capture one of the offending data sets and look at the X matrix. I am not going to be able to guess. I normally ignore this (the indeterminate coefficient is set to NA) and go on. You however have chosen to override the default and set singular.ok=FALSE so that the program fails with an error message. You get what you asked for. Last, I am always surprised when people chose method='breslow' in coxph. Why substitute an inferior approximation for the better one? Of course with simulated data there are no ties, in which case all the methods are identical. Terry Therneau ______________________________________________ R-help@r-project.org 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.