1
$\begingroup$
scores <- c(26, 25, 14, 13, 10, 8, 22, 13, 10, 8, 8, 5, 
            30, 25, 10, 10, 7, 5, 43, 31, 12, 8, 2, 4,
            45, 31, 31, 10, 10, 4, 53, 23, 10, 1, 1, 1, 
            12, 16, 15, 16, 37, 28, 21, 20, 21, 15, 21, 17, 
            23, 27, 47, 27, 24, 59, 9, 23, 21, 12, 13, 14, 
            18, 17, 13, 18, 19, 21, 14, 14, 17, 21, 12, 13)
dat <- data.frame(Subject=rep(c(1,2,3,4,5,6), each=6), 
           Condition=rep(c("A","B"),each=6*6), Score=scores, 
           Day=rep(c(1,2,3,4,5,6),times=6))

I thought convergence and singularity issues mostly arise due to overly complex models. However it seems in my case, a simpler model is more problematic than a more complex one:

Simpler model (fails to converge, singular fit):

fm <- lmer(Score ~ Condition + (Condition|Subject), dat)
boundary (singular) fit: see ?isSingular
Warning message:
Model failed to converge with 1 negative eigenvalue: -9.0e-01 

More complicated model (no errors or warnings):

fm <- lmer(Score ~ Day*Condition + (Condition|Subject), dat)
$\endgroup$

1 Answer 1

3
$\begingroup$

Seems like the folk theorem of statistical computing might apply here, as it nearly always does.

When you have computational problems, often there’s a problem with your model.

Have you tried plotting the data?

For Condition==A there is a negative, linear relation of Score vs Day, for Condition==B no.

It looks like both conditions differ pretty much, so your "more complicated" model in fact makes more sense.

You also don't have much data, which can lead to problems. The simple model to consider first might be the one without random effects.

$\endgroup$
7
  • 1
    $\begingroup$ +1. For example, the model wouldn't be singular if we had more subjects but less readings per subject with the same overall sample size. $\endgroup$
    – usεr11852
    Commented May 13, 2022 at 11:57
  • $\begingroup$ thanks @usεr11852 But then why does it not complain when I add the interactions? It's the same data... $\endgroup$
    – locus
    Commented May 13, 2022 at 12:15
  • $\begingroup$ @locus the optimizer is designed to do its best regardless of what the data is, it will work in many cases, something it will fail. You've hit the edge case like this, but the underlying cause is that your model is misspecified. $\endgroup$
    – Tim
    Commented May 13, 2022 at 12:18
  • $\begingroup$ Thanks @Tim. You mention to test a model without random effects. But since I have repeated measures wouldn't I necessarily need to use multilevel? $\endgroup$
    – locus
    Commented May 13, 2022 at 12:24
  • 2
    $\begingroup$ To somewhat over-simplify what Tim said: The extra interaction makes the optimisation problem easier as it makes the optimum more obvious. $\endgroup$
    – usεr11852
    Commented May 13, 2022 at 12:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.