Questions tagged [lme4-nlme]

lme4 and nlme are R packages used for fitting linear, generalized linear and nonlinear mixed effects models. For general questions about mixed models use [mixed-model] tag.

lme4 and nlme are R packages used for fitting linear, generalized linear and nonlinear mixed-effects models. For further information check Bates (June 25, 2010), Bates et al (2014), and Pinheiro and Bates (2000).

For questions asking about mixed effects models in general please use tag.


Bates, D. (June 25, 2010). lme4: Mixed-effects modeling with R. (unpublished)

Bates, D., Mächler, M., Bolker, B., & Walker, S. (2014). Fitting linear mixed-effects models using lme4. arXiv preprint arXiv:1406.5823.

Pinheiro, J.C., and Bates, D.M. (2000). Mixed-Effects Models in S and S-PLUS. Springer.

3457 questions
5
votes
1 answer

the differences of interaction mark in lme4

I want to make a model including interaction term of factor 1 and factor 2. But i don't understand difference of models like m <- lmer(RT ~ fac1 * fac2 + (1+fac1*fac2|subject), data = df) and m<- lmer(RT ~ fac1 : fac2 + (1|subject) +…
3
votes
1 answer

Random effect variance differs between glmer() and lmer() function

I'm studying the difference of feed intake between more than 150 horses. From each horse we have their feed intake at different week points. My data is not normal-distributed. Therefore, in order to construct a linear mixed model (fixed effect:…
3
votes
1 answer

why pdLogChol initialised at a model fit does not match the pdLogChol of the fitted model?

I'm trying to build and initialize a pdLogChol object from a fitted lme model. However, although the pdLogChol is started from the model fit, the VarCorr function gives different values when compared with that of the model fit. I expected to see…
utobi
  • 11,726
3
votes
1 answer

glmer error: pwrssUpdate did not converge in 30 iterations

I am using R 3.2.0 and lme4 1.1.7. With a particular glmer run, the function keeps halting announcing that "pwrssUpdate did not converge in 30 iterations." I have tried every combination I can think of to increase the iterations and it seems like…
bachlaw
  • 31
3
votes
0 answers

Instability in glmer model at zero random effect variance

I am getting very different results from glmer (using version 0.999375.37 of lme4) when running in different environments (I can't pinpoint the source of discrepancy, but let's assume some floating point precision difference in the input data). Here…
stewbasic
  • 173
2
votes
1 answer

Fitting random intercept and slope in lmer for lme4.

If I would like to fit random intercept and slope and if I write it as (color|writer) compared to (1+color|writer), are they the same?
user3288202
  • 1,325
  • 6
  • 17
  • 27
2
votes
1 answer

Variance-covariance matrix of the residuals of an object of class merMod (R package lme4)

I am trying to extract the variance-covariance matrix of the residuals of a generalized linear mixed-effects model that was fitted using lmer (of the R package lme4), but this does not seem to be straightforward. Does anybody knows how this can be…
Willem
  • 93
2
votes
1 answer

Can you help me to find the difference between ~ 1 | and ~ in lme?

I m running a mixed model for 2 treatments and I run these 2 scripts which gave me different results mixedmRV19R<-lme(RH ~ Flax*Row, random = ~ 1 | Month/Day/Hour, data = RV19, na.action=na.exclude) versus mixedmRV19RR<-lme(RH ~ Flax*Row, random =…
2
votes
1 answer

LMM repeated measures (dependent) accounted for by my model?

I want to compare X between different groups "material". Material is a categorical variable with four groups A,B,C,D. patient_ID is a subject specific identifier -> I use this as a random effect. lmer(X~ material + (1|patient_ID), data) Now my…
2
votes
1 answer

Different coding for nested and crossed random effects in lmer

I want to use liner mixed effect model to analyse data from a within-subject experiment. In my experiment, each participant (PP, 30-level factor) watch 6 videos (Video), and each video contains 50 sentences (Sentence) and each sentence has 100 words…
Chloe
  • 363
2
votes
1 answer

How to get confidence intervals for modeled data of lmer model in R with Bootmer function

I want to get confidence intervals around modelled data from a lmer model. I found that Bootmer is the way to go. There seem to be 3 ways to do this: 1.parametrically resampling both the “spherical” random effects u and the i.i.d. errors ϵ (use.u =…
2
votes
1 answer

Zero random intercept variance for glmer mixed model

I'm running the following glmer model in lme4: fit <- glmer(outcome ~ var1 + var2 + var3 + var4 + var5 + CONDITION + (1 | ranint), family = binomial(), data = data) summary(fit) The predictors are all…
R-Rex
  • 25
2
votes
0 answers

Correlated random factors in lmer

We are about to measure the quality of a conversation in several ways and have some possible predictors. We would like to have each of 10 people have a conversation with each of the other nine people giving us 45 conversations. I plan to carry out…
2
votes
1 answer

Lme model: general question on the formula

This is the model: lme(score ~ 0 + rule, random=~1|subject, data=mydata) My response variable is called score, my explanatory variable is called rule. The same subjects were tested on all the rules, so random=~1|subject accounts for the subject…
2
votes
1 answer

Specifying random effects for individual differences data

I am using the lmer function in R to examine the effect of skill (continuous) and context on eye movement data. I am new to lmer and not by nature statistically inclined. It is my understanding that it is best to include random intercepts and…
Ashley
  • 21
1
2 3