Noah Silverman
2009-Aug-21 16:02 UTC
[R] Repost - Possible bug with lrm.fit in Design Library
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)> fmodelLogistic 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) :
Marc Schwartz
2009-Aug-21 16:13 UTC
[R] Repost - Possible bug with lrm.fit in Design Library
On Aug 21, 2009, at 11:02 AM, Noah Silverman wrote:> 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:<snip> Noah, you seem to have missed Frank's reply to your original post about 3 hours ago: https://stat.ethz.ch/pipermail/r-help/2009-August/208940.html HTH, Marc Schwartz