Skip to main content

Timeline for R's lmer cheat sheet

Current License: CC BY-SA 3.0

12 events
when toggle format what by license comment
Oct 28, 2021 at 17:18 history made wiki Post Made Community Wiki by whuber
Oct 2, 2021 at 2:44 comment added Douglas Wiley This isn't just a great answer. This represents the best of what can be found on SE: no snark, no pissing contests, no smugness, but a gentleman who took some serious time out of his day to help us Data Science students - now going on 10 years! Thank you @Mike Lawrence!
Jun 28, 2018 at 14:47 comment added russellpierce re: P4... 'while enforcing a zero correlation between the intercept deviations and V3 effect deviations across levels of V2'. I think this is definitionally true, but I want to cast light doubt on what lme4 does for this foruma. I remember elsewhere on this site someone speaking of simulation results that lme4 (at least for some versions) doesn't enforce 0 correlation - it just fails to estimate the correlation. I'm sorry that I can't find the entry off hand.
Jan 27, 2016 at 19:33 comment added Antoni Parellada @MikeLawrence Great! Thank you. It makes sense, then, to expect different intercepts. I will work on tweaking my dataset.
Jan 27, 2016 at 19:26 comment added Mike Lawrence @AntoniParellada Ah, I think what's happened here is that in evaluating m2 for your data, lmer has decided that the intercept sd is basically zero, so all the individual coefficients for the intercept are nearly zero (the e-13 in ranef(m2) is likely attributable to floating point computation error). Note that coef(m2)$Intercept == fixef(m2)$Intercept + ranef(m2)$Intercept
Jan 26, 2016 at 17:34 comment added Antoni Parellada Yes, it does. You can find the code here ready to copy and paste. This is confusing... The intercepts running ranef(m2) seem crazy...$e^{-13}$?
Jan 26, 2016 at 17:26 comment added Mike Lawrence @AntoniParellada Hm, I haven't looked at lmer in a while and it looks like they've changed how they access the estimates. Does ranef(m2) give you anything different from coefficients(m2)?
Jan 25, 2016 at 16:42 comment added Antoni Parellada @MikeLawrence I've used your answer many times as everybody else, but I do have a nagging question. In the M2 model it sounds as though you should get different intercepts for every V2 level. Yet this doesn't seem to be the case when I try to reproduce it here. Please note that I exchange V2 for V3 in my notation.
Jul 20, 2015 at 4:47 comment added ABC Say I have one independent variable (X) at individual level and one independent variable (Z) at group level . Both are continuous variable . If the model is $$Y_{ij}=\gamma_{00}+\gamma_{10}X_{ij}+\gamma_{01}Z_{j}+\gamma_{11}X_{ij}Z_{j}+u_{1j}X_{ij}+u_{0j}+e_{ij}$$, where subscript $i$ denotes $i$th individual and $j$ denotes $j$th group . then using lmer syntex will the model be Y~X+Z+(1|group)+(0+X|Z) ,where group is another variable in the data frame to indicate in which group the individual belongs to ?
Jul 20, 2011 at 20:07 comment added Mike Lawrence I think DBR is referring to levels in the hierarchy. What I described is a 2-level hierarchical model, with observations nested within subjects, and DBR is asking about 3-level hierarchies, an example of which might be test items within students within schools where you want to model both students and schools as random effects, with students nested within schools. In such cases I presume that the school level deviations are first computed then the student-from-school deviations.
Jul 18, 2011 at 23:52 comment added DBR @Mike Lawrence Thanks for the answer! how is a 3 level model estimated then? where one grouping factor is nested within another?
Jul 18, 2011 at 1:46 history answered Mike Lawrence CC BY-SA 3.0