[R] error in survival analysis
Terry Therneau
therneau at mayo.edu
Tue Jul 26 14:43:54 CEST 2011
There is something very odd about your data to give se values that are
so very large. Usually, this means that the data is deterministic: some
combination of predictors is able to separate a subset with no events
from all the others. This leads to a problem where the log-likelihood
is maximum at infinity.
I expect that both the warning messages you see are completely
correct.
Terry Therneau
---- begin included message ---
This is a simple R program that I have been trying to run. I keep
running into the "singular matrix" error. I end up with no sensible
results. Can anyone suggest any changes or a way around this?
I am a total rookie when working with R.
Thanks,
Rasika
> library(survival)
Loading required package: splines
> args(coxph)
function (formula, data, weights, subset, na.action, init, control,
method = c("efron", "breslow", "exact"), singular.ok = TRUE,
robust = FALSE, model = FALSE, x = FALSE, y = TRUE, tt, ...)
NULL
>
test1<-read.table("S:/FISHDO/03_Phase_I_Field_Work/Data_6_28_2011/Working Folder/R_files/4SondesJuly24.csv", header=T, sep=",")
> sondes<-coxph(Surv(Start, Stop, Depart)~DOLoomis + DOI55 + DODamen,
data=test1)
Warning messages:
1: In fitter(X, Y, strats, offset, init, control, weights = weights, :
Loglik converged before variable 1,2 ; beta may be infinite.
2: In coxph(Surv(Start, Stop, Depart) ~ DOLoomis + DOI55 + DODamen, :
X matrix deemed to be singular; variable 3
> summary(sondes)
Call:
coxph(formula = Surv(Start, Stop, Depart) ~ DOLoomis + DOI55 +
DODamen, data = test1)
n= 1737, number of events= 58
(1 observation deleted due to missingness)
coef exp(coef) se(coef) z Pr(>|z|)
DOLoomis -2.152e+00 1.163e-01 1.161e+05 0 1
DOI55 4.560e-01 1.578e+00 3.755e+04 0 1
DODamen NA NA 0.000e+00 NA NA
exp(coef) exp(-coef) lower .95 upper .95
DOLoomis 0.1163 8.5995 0 Inf
DOI55 1.5777 0.6338 0 Inf
DODamen NA NA NA NA
Concordance= 0.5 (se = 0 )
Rsquare= 0 (max possible= 0.01 )
Likelihood ratio test= 0 on 2 df, p=1
Wald test = 0 on 2 df, p=1
Score (logrank) test = 0 on 2 df, p=1
More information about the R-help
mailing list