[R] X matrix deemed to be singular in counting process coxph

caspar caspar.hallmann at gmail.com
Fri Oct 19 04:36:14 CEST 2007

Dear all,

I have a question  with respect to counting process formulation of the 
coxph(survival) model.
I have two groups of observations for which I have partitioned each 
observation into two distinct time intervals, namely, entry day till day 13, 
and day 13 till death or censorship day (of course the latter only for the 
observations that survived the first 13 day interval), and added a dummy 't' 
representing the first and second interval [0,1]. The reason I want this is 
because the groups have crossing survival curves and I happen to know that 
the change in hazard ratio between the groups occurs at day 13.

I try the following:

> coxph(Surv(Start,Stop,event)~group*t+cluster(nr),data=dat4)
coxph(formula = Surv(Start, Stop, event) ~ group * t + cluster(nr),
    data = dat4)

which results in  :

         coef exp(coef) se(coef) robust se      z       p
group     0.336     1.400   0.0409    0.0408   8.24 1.1e-16
t         NA        NA   0.0000    0.0000     NA      NA
group:t -0.689     0.502   0.0530    0.0530 -13.02 0.0e+00

Likelihood ratio test=180  on 2 df, p=0  n= 13244
Warning message:
X matrix deemed to be singular; variable 2 in: coxph(Surv(Start, Stop, 
event) ~ group * t + cluster(nr),

deleting all terms apart from 't' still results in the same warning.
I seem to have been stuck on this one. Does anyone known or have any 
suggestions why t can't be estimated?
I haven't been able to find any help on the RSiteSearch.

Many thanks in advance.


PS: I could send a some of this dataset if anyone interested for a tryout

Caspar Hallmann
MSc Student WUR
The Netherlands

More information about the R-help mailing list