Philip Robinson
2012-Jan-10 04:44 UTC
[R] Lapack routine dgesv: system is exactly singular
Hi I have a problem with this error, I have searched the archives and found previous discussion about this, can I cannot understand how the explanations apply to what I am trying to do. I am trying to do Log_rank Survival analysis, I have included tables and str command, is it a factor/integer problem? If so how do I correct this, as all my attempt to recode the data have failed.> survdiff(Surv(f2$days.alive , f2$censored)~group, data=f2)Error in drop(.Call("La_dgesv", a, as.matrix(b), tol, PACKAGE = "base")) : Lapack routine dgesv: system is exactly singular> head(f2)group days.alive censored 1 PRI_CAS_5_NODU 1826 1 2 PRI_CAS_5_NODU 1488 0 3 PRI_CAS_5_NODU 1826 1 4 PRI_CAS_5_NODU 1826 1 5 PRI_CAS_5_NODU 303 0 6 PRI_CAS_5_NODU 1826 1> str(f2)'data.frame': 16795 obs. of 3 variables: $ group : Factor w/ 2 levels "PRI_CAS_5_NODU",..: 1 1 1 1 1 1 1 1 1 1 ... $ days.alive: int 1826 1488 1826 1826 303 1826 1826 971 467 1826 ... $ censored : int 1 0 1 1 0 1 1 0 0 1 ...> table(f2$group)PRI_CAS_5_NODU SEC_CAS_5_NODUP 3326 13469> table(f2$censored)0 1 7860 8935 [[alternative HTML version deleted]]
I was sent a copy of the data on request. A quick look shows that> range(days.alive[censored==0])[1] 0 1825> range(days.alive[censored==1])[1] 1826 1826 The original call of survdiff(Surv(days.alive, censored) ~ group) will assume that censored=1 corresponds to deaths and 0 to alive; from the above this is almost certainly backwards. If instead we force 0 to be the "yes they're dead" group the results look better.> survdiff(Surv(days.alive, censored==0) ~ group, f2)Call: survdiff(formula = Surv(days.alive, censored == 0) ~ group, data = f2) N Observed Expected (O-E)^2/E (O-E)^2/V group=PRI_CAS_5_NODU 3326 1129 1745 217.7 281 group=SEC_CAS_5_NODUP 13469 6731 6115 62.1 281 Chisq= 281 on 1 degrees of freedom, p= 0 In the original setup the test statistic had value 0 + roundoff error and std = 0 + roundoff error due to all the "deaths" being tied on exactly the same day, and you were getting the matrix version of a 0/0 error. Terry T ------- begin included message ---- I have a problem with this error, I have searched the archives and found previous discussion about this, can I cannot understand how the explanations apply to what I am trying to do. I am trying to do Log_rank Survival analysis, I have included tables and str command, is it a factor/integer problem? If so how do I correct this, as all my attempt to recode the data have failed.> survdiff(Surv(f2$days.alive , f2$censored)~group, data=f2)Error in drop(.Call("La_dgesv", a, as.matrix(b), tol, PACKAGE "base")) : Lapack routine dgesv: system is exactly singular
Seemingly Similar Threads
- Error in solve.default(res$hessian * n.used) :Lapack routine dgesv: system is exactly singular
- sem : Error in solve.default(C[ind, ind]) : Lapack routine dgesv: system is exactly singular
- fclustIndex(package e1071) error: LaPack Routine dgesv
- log rank test p value
- Comparing survival curves with "survdiff" "strata" help