[R-sig-ME] ranef() on Mac OS X
Malcolm Fairbrother
m.fairbrother at bristol.ac.uk
Tue Oct 19 18:56:30 CEST 2010
Dear Chris,
I've had problems similar to this before, and it's often due to having nlme loaded along with lme4. I use a Mac. I see from your sessionInfo() that you had nlme loaded on Mac, but not Ubuntu. I'd trying detaching:
> ranef(fm1)
Error in UseMethod("ranef") :
no applicable method for 'ranef' applied to an object of class "mer"
> detach(package:nlme)
> ranef(fm1)
$Subject
(Intercept) Days
308 2.2571870 9.1992523
309 -40.3984020 -8.6211497
etc.
Hope that works.
- Malcolm
Dr Malcolm Fairbrother
Lecturer
School of Geographical Sciences
University of Bristol
> Message: 4
> Date: Tue, 19 Oct 2010 11:31:18 -0500
> From: Christopher Desjardins <desja004 at umn.edu>
> To: r-sig-mixed-models at r-project.org
> Subject: [R-sig-ME] ranef() on Mac OS X
> Message-ID:
> <AANLkTin=ksZK=5eC30fHiaY9OH-Y3ExaU=5yktc0DB9O at mail.gmail.com>
> Content-Type: text/plain
>
> I am unable to use the ranef() function on a lmer function on a Mac. I get
> the following error:
>
>> fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
>> ranef(fm1)
> Error in UseMethod("ranef") :
> no applicable method for 'ranef' applied to an object of class "mer"
>> sessionInfo()
> R version 2.11.1 (2010-05-31)
> i386-apple-darwin9.8.0
>
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
>
> attached base packages:
> [1] stats graphics grDevices utils datasets methods base
>
> other attached packages:
> [1] plyr_1.2.1 nlme_3.1-96 lme4_0.999375-34
> Matrix_0.999375-39 lattice_0.18-8 foreign_0.8-40
>
> loaded via a namespace (and not attached):
> [1] grid_2.11.1 stats4_2.11.1 tools_2.11.1
>
> This works as expected on Ubuntu 10.10 64 bit (see below). I built the lme4
> package from source on the Mac and I know that lme4 has had some issues on
> Mac for a while (i.e. it hasn't been available as a binary for some time). I
> just wanted to post this here to see if this was either a new bug, something
> already documented, or something that I've overlooked. Googling 'ranef lme4
> Mac' brought me to this thread
> https://stat.ethz.ch/pipermail/r-sig-mixed-models/2010q3/004091.html ... but
> the author was able to use the ranef() function.
>
> Thanks,
> Chris
>
>
> #################
> ### From Linux ###
> #################
>> fm1 <- lmer(Reaction ~ Days + (1|Subject), sleepstudy)
>> ranef(fm1)
> $Subject
> (Intercept)
> 308 40.787403
> 309 -77.856603
> 310 -63.114282
> 330 4.406841
> 331 10.217114
> 332 8.221982
> 333 16.501988
> 334 -2.997253
> 335 -45.286227
> 337 72.189222
> 349 -21.198168
> 350 14.112641
> 351 -7.862933
> 352 36.381719
> 369 7.037018
> 370 -6.363279
> 371 -3.294571
> 372 18.117387
>> sessionInfo()
> R version 2.11.1 (2010-05-31)
> x86_64-pc-linux-gnu
>
> locale:
> [1] LC_CTYPE=en_US.utf8 LC_NUMERIC=C
> [3] LC_TIME=en_US.utf8 LC_COLLATE=en_US.utf8
> [5] LC_MONETARY=C LC_MESSAGES=en_US.utf8
> [7] LC_PAPER=en_US.utf8 LC_NAME=C
> [9] LC_ADDRESS=C LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats graphics grDevices utils datasets methods base
>
> other attached packages:
> [1] lme4_0.999375-35 Matrix_0.999375-40 lattice_0.18-8
>
> loaded via a namespace (and not attached):
> [1] grid_2.11.1 nlme_3.1-96 stats4_2.11.1 tcltk_2.11.1 tools_2.11.1
>
>
>
>
> --
> Christopher David Desjardins
> Ph.D. student, Quantitative Methods in Education
> M.S. student, Statistics
> University of Minnesota
>
> [[alternative HTML version deleted]]
>
>
>
> ------------------------------
>
> Message: 5
> Date: Tue, 19 Oct 2010 11:44:58 -0500
> From: Douglas Bates <bates at stat.wisc.edu>
> To: Christopher Desjardins <desja004 at umn.edu>
> Cc: r-sig-mixed-models at r-project.org
> Subject: Re: [R-sig-ME] ranef() on Mac OS X
> Message-ID:
> <AANLkTimOmPM0cdw6zLFjrSRrF_M_GgT9d3Q4RYM0F8WA at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Notice that you have different versions of the lme4 package on Ubuntu
> and on the Mac. For some reason the lme4 package is failing a test on
> Mac OS X only and we haven't been able to diagnose why the -35 version
> fails there. Also, we haven't been able to reproduce this on other
> operating systems and we can't decide why it should fail on Mac OS X
> unless it is an obscure memory issue. As neither Martin nor I use Mac
> OS X we aren't able to debug the issue. Other folks have looked at it
> but all they can say is that it is failing, no idea why. We even
> tried to bypass the test on the Mac but that doesn't seem to have
> worked either.
>
> I'm open to suggestions from the list on what can be done about lme4
> and Mac OS X. If you look at the test results for the package on
> CRAN, e.g.
>
> http://cran.us.r-project.org/web/checks/check_results_lme4.html
>
> you will see that Mac OS X is the only system on which there is a
> problem and the test on which it fails doesn't make sense for it to
> fail. The only difference between the two models being compared is
> that they were generated from slightly different formulas but the
> models are identical once the formula is parsed.
>
> On Tue, Oct 19, 2010 at 11:31 AM, Christopher Desjardins
> <desja004 at umn.edu> wrote:
>> I am unable to use the ranef() function on a lmer function on a Mac. I get
>> the following error:
>>
>>> fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
>>> ranef(fm1)
>> Error in UseMethod("ranef") :
>> ?no applicable method for 'ranef' applied to an object of class "mer"
>>> sessionInfo()
>> R version 2.11.1 (2010-05-31)
>> i386-apple-darwin9.8.0
>>
>> locale:
>> [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
>>
>> attached base packages:
>> [1] stats ? ? graphics ?grDevices utils ? ? datasets ?methods ? base
>>
>> other attached packages:
>> [1] plyr_1.2.1 ? ? ? ? nlme_3.1-96 ? ? ? ?lme4_0.999375-34
>> Matrix_0.999375-39 lattice_0.18-8 ? ? foreign_0.8-40
>>
>> loaded via a namespace (and not attached):
>> [1] grid_2.11.1 ? stats4_2.11.1 tools_2.11.1
>>
>> This works as expected on Ubuntu 10.10 64 bit (see below). I built the lme4
>> package from source on the Mac and I know that lme4 has had some issues on
>> Mac for a while (i.e. it hasn't been available as a binary for some time). I
>> just wanted to post this here to see if this was either a new bug, something
>> already documented, or something that I've overlooked. Googling 'ranef lme4
>> Mac' brought me to this thread
>> https://stat.ethz.ch/pipermail/r-sig-mixed-models/2010q3/004091.html ... but
>> the author was able to use the ranef() function.
>>
>> Thanks,
>> Chris
>>
>>
>> #################
>> ### From Linux ###
>> #################
>>> fm1 <- lmer(Reaction ~ Days + (1|Subject), sleepstudy)
>>> ranef(fm1)
>> $Subject
>> ? ?(Intercept)
>> 308 ? 40.787403
>> 309 ?-77.856603
>> 310 ?-63.114282
>> 330 ? ?4.406841
>> 331 ? 10.217114
>> 332 ? ?8.221982
>> 333 ? 16.501988
>> 334 ? -2.997253
>> 335 ?-45.286227
>> 337 ? 72.189222
>> 349 ?-21.198168
>> 350 ? 14.112641
>> 351 ? -7.862933
>> 352 ? 36.381719
>> 369 ? ?7.037018
>> 370 ? -6.363279
>> 371 ? -3.294571
>> 372 ? 18.117387
>>> sessionInfo()
>> R version 2.11.1 (2010-05-31)
>> x86_64-pc-linux-gnu
>>
>> locale:
>> ?[1] LC_CTYPE=en_US.utf8 ? ? ? LC_NUMERIC=C
>> ?[3] LC_TIME=en_US.utf8 ? ? ? ?LC_COLLATE=en_US.utf8
>> ?[5] LC_MONETARY=C ? ? ? ? ? ? LC_MESSAGES=en_US.utf8
>> ?[7] LC_PAPER=en_US.utf8 ? ? ? LC_NAME=C
>> ?[9] LC_ADDRESS=C ? ? ? ? ? ? ?LC_TELEPHONE=C
>> [11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C
>>
>> attached base packages:
>> [1] stats ? ? graphics ?grDevices utils ? ? datasets ?methods ? base
>>
>> other attached packages:
>> [1] lme4_0.999375-35 ? Matrix_0.999375-40 lattice_0.18-8
>>
>> loaded via a namespace (and not attached):
>> [1] grid_2.11.1 ? nlme_3.1-96 ? stats4_2.11.1 tcltk_2.11.1 ?tools_2.11.1
>>
>>
>>
>>
>> --
>> Christopher David Desjardins
>> Ph.D. student, Quantitative Methods in Education
>> M.S. student, Statistics
>> University of Minnesota
More information about the R-sig-mixed-models
mailing list