[R-sig-ME] lme4 upgrade broke my old code?

Ben Bolker bbolker at gmail.com
Tue Mar 17 19:26:20 CET 2015


Ben Bolker <bbolker at ...> writes:

> 
> 
> On 15-03-17 01:13 PM, marKo wrote:
> > On 03/17/2015 05:01 PM, Stuart Luppescu wrote:
> >> Hello, I'm trying to update a mer object (here called 
> >> crossed.lmer3) created about 2 years ago using lmer of a version
> >> I don't remember. I'm now using lme4_1.1-7   Rcpp_0.11.5
> >> Matrix_1.1-5 in R version 3.1.2 (2014-10-31) Platform:
> >> x86_64-redhat-linux-gnu (64-bit). When I do stuff that worked
> >> before, I get errors. E.g.:
> >>> crossed.lmer3a <- update(crossed.lmer3, ~ . + cmclsach + 
> >>> crclsach)
> >> Error: $ operator not defined for this S4 class
> > 
> >> and summary() gives nothing interesting.
> >>> summary(crossed.lmer3)
> >> Length  Class   Mode 1    mer     S4
> > 
> >> Also, code from the examples from the lme4 manual also gives 
> >> errors: str(terms(crossed.lmer3)) Error: $ operator not defined 
> >> for this S4 class
> > 
> >> Enter a frame number, or 0 to exit
> > 
> >> Can I get a little advice here, please?
> > 
> > 
> > I think that starting with version 1, lme4 was not compatible with
> > the lower version code. I am afraid that you will have to calculate
> > the old models again with the newer lme4.
> > 
> > Cheers,
> > 
> > Marko
> 
>   There is some help here.  If you install the lme4.0 package (see the
> README at https://github.com/lme4/lme4 ) you can at least use
> convert_old_lme4() to update lme4 pre 1.0 to lme4.0  ...  We don't
> currently have a function to convert stuff that old to modern lme4
> (lots of the internal structures have changed), but if you want to
> badly enough you can use lme4.0 ...
> 

  Just to follow up on my own post a little bit:

  it would probably be quite a big pain to import *all* of the
results from an old-lme4 fit into a new-lme4 object, as the internal
structures have changed quite a lot.  Something that would work
well and be reasonably efficient would be to import the basic
data structures such as the random-effects design matrix (Z), the
Cholesky factor of the RE var-cov matrix (Lambda), hopefully along
with its symbolic permutation information, and to re-fit the model
starting from the ML/REML estimates from the old model.  There hasn't
been a big outcry demanding this feature, but if it were to be
posted as a Github issue something *might* happen ...

  cheers
    Ben Bolker



More information about the R-sig-mixed-models mailing list