[R] Cannot create summary of old glm object. How to ensure that R objects will be usable in the future.

Clara cantonfe at mtu.edu
Mon Sep 9 11:02:24 CEST 2013


Thanks Prof. Ripley,

my.model$family <- binomial() worked

Do you have any suggestions on how to store the models? I used the 
models mostly for projections, so being able to use "predict" would be 
handy. Refitting the model would be an option but it would not ensure 
AFAIK that the resulting model would be the same in all cases.

Clara





On 2013-09-09 10:22, Prof Brian Ripley wrote:
> On 09/09/2013 08:48, Clara wrote:
>> my.model$family <- binomial()
>> 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
>
> Before 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
>
>



More information about the R-help mailing list