Clara
2013-Sep-09 07:48 UTC
[R] Cannot create summary of old glm object. How to ensure that R objects will be usable in the future.
Hi all, I have an older, probably about 2 years old glm object, I am not sure with which version of glm it was produced. I have tried to summary(my.model) but I get an error. > summary(my.model) Error in .Call("binomial_dev_resids", y, mu, wt, PACKAGE = "stats") : "binomial_dev_resids" not available for .Call() for package "stats" Some info about the model: Call: glm(formula = my.formula, family = binomial, data = my.data, weights = my.weights, x = T, y = T) My current r version and platform: R version 3.0.1 (2013-05-16) -- "Good Sport" Platform: x86_64-pc-linux-gnu (64-bit) I have used my.model before, about a year ago, without any problems. So my questions are, (1) Is there a way to "update" the model so it works with the new version of summary.glm? or is there a way to make the new summary.glm function agreeable to my.model? (2) Should I expect this behavior with other older models? I mean, If I create a model today should I expect to have problems when I try to do simple stuff with it, like "summary", in a couple of years? (3) Is there a way to prevent this? What would be the best way to make sure, as much as possible, that the models I produce today will be usable in the future by me and others? Any help is greatly appreciated. I will run into this problem again, so I would very much appreciate any help on how to handle this. Clara
Prof Brian Ripley
2013-Sep-09 08:22 UTC
[R] Cannot create summary of old glm object. How to ensure that R objects will be usable in the future.
On 09/09/2013 08:48, Clara wrote:> Hi all, > > I have an older, probably about 2 years old glm object, I am not sure > with which version of glm it was produced. I have tried toBefore R 3.0.0, which was a change in major version number.> summary(my.model) but I get an error. > > > summary(my.model) > Error in .Call("binomial_dev_resids", y, mu, wt, PACKAGE = "stats") : > "binomial_dev_resids" not available for .Call() for package "stats" > > Some info about the model: > Call: glm(formula = my.formula, family = binomial, data = my.data, > weights = my.weights, > x = T, y = T) > > My current r version and platform: > R version 3.0.1 (2013-05-16) -- "Good Sport" > Platform: x86_64-pc-linux-gnu (64-bit) > > I have used my.model before, about a year ago, without any problems. So > my questions are, > (1) Is there a way to "update" the model so it works with the new > version of summary.glm? or is there a way to make the new summary.glm > function agreeable to my.model?It is not to do with summary.glm: it is AFAIK due to what is stored in 'my.model'. You should re-fit my.model. In this particular case (which is not reproducible to us) it is possible that my.model$family <- binomial() would work.> (2) Should I expect this behavior with other older models? I mean, If I > create a model today should I expect to have problems when I try to do > simple stuff with it, like "summary", in a couple of years?Yes.> (3) Is there a way to prevent this? What would be the best way to make > sure, as much as possible, that the models I produce today will be > usable in the future by me and others?Not save .RData files and expect them to work with an R with an increased major version number. You should regard .RData files as a permanent form of storage only for data (things like data frames).> Any help is greatly appreciated. I will run into this problem again, so > I would very much appreciate any help on how to handle this.Use the version of R you used to create the object my.model to explore it. And BTW R 3.0.x has been out for several months and I have not seen anyone one else reporting such a problem so I think it is much rarer than you believe.> Clara-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595