# Linear Mixed-effect Model Could Not Converge (after changing participants' coding)

I ran a linear mixed-effect model with 'participants" and "PV" (phrasal words) as random effect, and the context as the main effect. I found that the model could not converge after I changed the coding of the participants from 1, 0_12 (as characters) to 100,101, 102 (as factors).

Q1. May I know for building the linear mixed effect model, participants should be treated as "factors"? I assume so as I include participants as a random factor in my model.

Q2. May I know why the model failed to converge? Does it have something to do with the coding of my participants? May I have your suggestions? Thank you.

My study design: 3 groups of participants were randomly assigned to one of the 3 contexts, with the same English phrases being presented in each one of the contexts (contexts was coded as 0, 1, and 2). The dependent variable is the reading speed of these phrases.

Beneath is the result of the model:

boundary (singular) fit: see help('isSingular')
Warning: Model failed to converge with 1 negative eigenvalue: -4.1e+01
Linear mixed model fit by maximum likelihood . t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: Word Reading Time1 ~ CONTEXT + (1 | PARTICIPANT) + (1 | PV) + (CONTEXT |  PV)
Data: my_data, REML = FALSE)

AIC      BIC   logLik deviance df.resid
-3489.0  -3412.7   1756.5  -3513.0     4249

Scaled residuals:
Min      1Q  Median      3Q     Max
-3.2751 -0.6372  0.0171  0.6537  3.2502

Random effects:
Groups      Name        Variance  Std.Dev.  Corr
PARTICIPANT (Intercept) 2.256e-03 0.0474982
PV          (Intercept) 8.849e-05 0.0094071
PV.1        (Intercept) 0.000e+00 0.0000000
CONTEXT1    3.553e-04 0.0188494   NaN
CONTEXT2    1.675e-07 0.0004092   NaN -1.00
Residual                2.488e-02 0.1577473
Number of obs: 4261, groups:  PARTICIPANT, 57; PV, 8

Fixed effects:
Estimate Std. Error        df t value Pr(>|t|)
(Intercept)  2.396812   0.013149 55.721539 182.283   <2e-16 ***
CONTEXT1    -0.008018   0.017866 48.111761  -0.449    0.656
CONTEXT2    -0.021970   0.017485 56.041261  -1.257    0.214
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1



These are the results when participants were considered as "characters" and coded as 1, 0_12, and 0_13.

boundary (singular) fit: see help('isSingular')
Linear mixed model fit by maximum likelihood . t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: Word Reading Time2 ~ CONTEXT + (1 | PARTICIPANT_CHARACTERS) + (1 | PV) + (CONTEXT |      PV)
Data: my_data, REML = FALSE)

AIC      BIC   logLik deviance df.resid
-3489.3  -3413.0   1756.6  -3513.3     4249

Scaled residuals:
Min      1Q  Median      3Q     Max
-3.2794 -0.6400  0.0145  0.6531  3.2521

Random effects:
Groups     Name        Variance  Std.Dev.  Corr
PARTICIPANT_CHARACTERS(Intercept) 2.256e-03 4.750e-02
PV         (Intercept) 5.862e-12 2.421e-06
PV.1       (Intercept) 5.808e-05 7.621e-03
CONTEXT1    3.227e-04 1.796e-02  0.32
CONTEXT2    1.118e-05 3.344e-03  0.82 -0.28
Residual               2.488e-02 1.577e-01
Number of obs: 4261, groups:  PARTICIPANT_CHARACTERS, 57; PV, 8

Fixed effects:
Estimate Std. Error        df t value Pr(>|t|)
(Intercept)  2.396845   0.013004 54.523538 184.322   <2e-16 ***
CONTEXT1    -0.008055   0.017752 49.723438  -0.454    0.652
CONTEXT2    -0.022024   0.017525 55.965517  -1.257    0.214
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1