[R] Coxph frailty model counting process error X matrix deemed singular

Porter, Aaron T aaron-t-porter at uiowa.edu
Wed Jun 24 19:13:07 CEST 2009


Hello,

I am currently trying to simulate data and analyze it using the frailty option in the coxph function.  I am working with recurrent event data, using counting process notation.  Occasionally, (about 1 in every 100 simulations) I get the following warning: 

Error in coxph(Surv(start, end, censorind) ~ binary + uniform + frailty(subject,  : 
  X matrix deemed to be singular; variable 2

My data is structured as follows: I have a Bernoulli random variable (parameter=0.5) (labeled "binary") and a second variable which was generated as seq(0.02, 1, 0.02), which is labeled as "uniform".  There are 50 individual subjects.  Recurrent events are then generated as rexp(1, 0.2*frailparm[j]*exp(mydata[j,1]*alpha[1]+mydata[j,2]*alpha[2])) where mydata is the cbind of the data just mentioned, alpha are the parameters for the recurrent events (here I am using c(1,1)) and frailparm is the frailty term for subject {j}.  I generate recurrent events until the sum of the times is greater than the terminal time or censoring time, and keep the previous highest time as my final recurrent time, with one additional time which is censored at the minimum of the terminal event time and the censoring time.  I then repeat for each subject.

I then try to analyze the data like this: coxph(Surv(start,end,censorind)~binary+uniform+frailty(subject,distribution="gauss", method="reml"), method="breslow", singular.ok=FALSE, data=fulldata) 
Where start is the previous recurrent time, end is the current recurrent time, censorind is the censoring indicator for the current recurrent time, and subject is the current observation.

There does not appear to be an issue with the binary variable taking a particular value for every observed event time, nor does there appear to be perfect correlation between the variable "uniform" and the survival time.

Any help would be much appreciated.




More information about the R-help mailing list