# Full dataset with few repeated measures

I am dealing with a dataset with the majority of entries with one value per individual but, with three cases with 2 repeated measures each. My first approach would be to pursue linear mixed models, to account for the repeated entries.

I've recreated a workable example:

set.seed(123)
ss<-data.frame(ID=c(paste0("ID",seq(1:100)),rep(c("ID101","ID102","ID103"),2)),
expl=rnorm(106),dep=rnorm(106))

lmerTest::lmer(dep~expl+(1+expl|ID),data=ss)


This model makes sense to me, considering that for each measure of ID101, 102 and 103 the intercept and the slope for 'expl" may be different. Nevertheless, as it is expected, an error is produced:

Error: number of observations (=106) <= number of random effects (=206) for term (1 + expl | ID); the random-effects parameters and the residual variance (or scale parameter) are probably unidentifiable


Should I try to simplify the mixed model to include only the intercept? Or should I try another approach?

dep ~ expl + (1|ID)

dep ~ expl + (0 + expl|ID)

• Your data do not support a model with random slopes and random intercepts. The usual approach is to omit the random slopes. You could also investigate how important random slopes are by fitting the model without the intercepts - you might want to consider centering the expl variable in that case. But ultimately if you don't have enough data, there is nothing you can do – Robert Long Jun 19 at 10:50