Skip to content
Prev 334367 / 398506 Next

freetype 2.5.2, problem with the survival package, build R 2.15.x with gcc 4.8.x

I was sent a copy of the data, and this is what I get on a different machine:
data=pscc)
Warning messages:
1: In fitter(X, Y, strats, offset, init, control, weights = weights,  :
   Loglik converged before variable  1,2,3,4 ; beta may be infinite.
2: In coxph(formula = Surv(rep(1, 13110L), cc) ~ addContr(A) + addContr(C) +  :
   X matrix deemed to be singular; variable 5
coef exp(coef) se(coef)         z  p
addContr(A)2     -0.14250     0.867   110812 -1.29e-06  1
addContr(C)2      0.00525     1.005   110812  4.74e-08  1
addContr(A.C)1-2 -0.30097     0.740   110812 -2.72e-06  1
addContr(A.C)2-1 -0.47712     0.621   110812 -4.31e-06  1
addContr(A.C)2-2       NA        NA        0        NA NA
[1] 1.932097e+02 2.700101e+01 1.624731e+01 6.049630e-15 2.031334e-15

The primary issue is that the covariates matrix is singular, having rank 3 instead of rank 5.
The coxph routine prints two warning messages that things are not good about the matrix. 
Warning messages should not be ignored!  The insane se(coef) values in the printed result 
are an even bigger clue that the model fit is suspect. Unfortunately, some small change in 
the iteration path or numerics has put this data set over the edge from being seen as rank 
3 (old run) to rank 4 (new run).  Moral: coxph does pretty well at detecting redundat 
variables, but if you know of some it never hurts to help the routine out by removing them 
before the fit.

Singularity of the X matrix in a Cox model is very difficult to detect reliably; the 
current threshold is the result of long experience and experiment to give as few false 
messages as possible.  (The RMS package in particular used truncated power basis functions 
for the splines, which lead to X matrices that look almost singular numerically, but are 
not.)  Setting a little less stringent threshold for declaring singularity in the cholesky 
decompostion sufficies for this data set.

fit2 <- clogit(cc ~ addContr(A) + addContr(C) + addContr(A.C) + strata(set),
          data=pscc, toler.chol=1e-10)

I'll certainly add this to my list of test problems that I use to tune those constants.

Terry Therneau
On 12/11/2013 09:30 PM, Hin-Tak Leung wrote: