[R] Possible bug with lrm.fit in Design Library

Noah Silverman noah at smartmediacorp.com
Fri Aug 21 07:24:11 CEST 2009


Hi,

I've come across a strange error when using the lrm.fit function and the 
subsequent predict function.

The model is created very quickly and can be verified by printing it on 
the console.  Everything looks good. (In fact, the performance measures 
are rather nice.)

Then, I want to use the model to predict some values.  I get the 
following error: "fit was not created by a Design library fitting function"

This is the exact same data and process I'm using with the lrm 
function.  I thought I'd try lrm.fit to see if the results where better.

Since the model WAS created by a function of the Design library, I can't 
see how it would then be rejected.

Below is the session transcript:

--------------------------------------------------------------------------------
 > fmodel <- lrm.fit(cbind(trainlogdata$v1, trainlogdata$v2), 
trainlogdata$label)
 > fmodel

Logistic Regression Model

lrm.fit(x = cbind(trainlogdata$v1, trainlogdata$v2), y = trainlogdata$label)


Frequencies of Responses
     0     1
20988  6684

        Obs  Max Deriv Model L.R.       d.f.          P          
C        Dxy
      27672      8e-13    3876.12          2          0      0.744      
0.488
      Gamma      Tau-a         R2      Brier
       0.49      0.179      0.195      0.157

           Coef   S.E.    Wald Z P
Intercept -2.890 0.04318 -66.92 0
x[1]       5.864 0.23341  25.12 0
x[2]       4.479 0.17256  25.95 0

 > predictions <- predict(fmodel, trainlogdata, type="fitted");
Error in getOldDesign(fit) :




More information about the R-help mailing list