Josh B
2010-Jun-20 02:40 UTC
[R] "Unable to fit" error message from the lrm function in the rms library
Hi all, I have another question about the lrm function (from the rms library) that I cannot find the answer to. I get an error message when I try to fit a model, and I don't know what to make of it. Please forgive me for not having a toy example, but it appears the size and complexity of my data is somehow causing the error. The best I can do is show you what I type and what errors I get. Here's what I'm doing that causes the error. I fit this model:> model.lrm24 <- lrm(x.all[,156] ~ pol(PC1, 3) + pol(PC2, 3) + pol(PC3, 3) + PCNM1 + PCNM2 + PCNM3 +PCNM4 + PCNM5 + PCNM6 + PCNM7 + PCNM8 + PCNM9 + PCNM10 + PCNM11 + PCNM12 + PCNM13 + PCNM14 + PCNM15 + PCNM16 + PCNM17 + PCNM18 + PCNM19 + PCNM20 + PCNM21 + PCNM22 + PCNM23 + PCNM24 + PCNM25 + PCNM26 + PCNM27 + PCNM28 + PCNM29 + PCNM30 + PCNM31 + PCNM32 + PCNM33 + PCNM34 + PCNM35 + PCNM36 + PCNM37 + PCNM38 + PCNM39, data=x.all)...and I get this error: Error in lrm(x.all[, 156] ~ pol(PC1, 3) + pol(PC2, 3) + pol(PC3, 3) + : Unable to fit model using “lrm.fit” The weird thing is that the model still seems to have been "fit" anyway. For instance:> model.lrm24$statsObs Max Deriv Model L.R. d.f. P 3.610000e+02 5.352815e-02 1.251547e+02 4.800000e+01 8.340322e-09 C Dxy Gamma Tau-a R2 8.795642e-01 7.591284e-01 7.631040e-01 2.578793e-01 4.522090e-01 Brier g gr gp 1.113480e-01 3.489163e+00 3.275851e+01 2.494908e-01 So it still seems it was able to run, at least to some extent, despite it's protests. Any ideas what is going on? Why does the model run if it is "unable" to be fit? That seems contradictory on its face. What does that even mean? Here's a hint to the source of the problem. If I fit a simplified model, the error message goes away:> model.lrm24 <- lrm(x.all[,156] ~ pol(PC1, 3) + pol(PC2, 3) + pol(PC3, 3), data=x.all) >No problem at all -- no error. Here's what the same summary output looks like, from the simplified model:> model.lrm24$statsObs Max Deriv Model L.R. d.f. P 2.030000e+02 2.861290e-01 7.180027e+01 9.000000e+00 6.747713e-12 C Dxy Gamma Tau-a R2 8.195579e-01 6.391159e-01 6.424134e-01 2.975662e-01 4.077021e-01 Brier g gr gp 1.583826e-01 2.032737e+00 7.634955e+00 2.869544e-01 So what's going on here? Any ideas? And why does the model still seem to be "fit" despite the claim it was "unable" to be fit? Thanks very much in advance -- you guys are great. ----------------------------------- Josh Banta, Ph.D Center for Genomics and Systems Biology New York University 100 Washington Square East New York, NY 10003 Tel: (212) 998-8465 http://plantevolutionaryecology.org [[alternative HTML version deleted]]
Christos Argyropoulos
2010-Jun-20 11:23 UTC
[R] "Unable to fit" error message from the lrm function in the rms library
Hi, The error message you are getting (probably) means that the algorithm did not converge. Did you check for convergence? (Look at the "fail" element of the returned lrm object) Christos _________________________________________________________________ Hotmail: Powerful Free email with security by Microsoft. [[alternative HTML version deleted]]