0

I am having an issue with running a linear mixed effects model. I'm constantly presented with the same warning message and I'm unsure how to go about tackling this issue.

The code:

model_CRP <- lmer(mem ~ binding*time_years + AGE + GENDER + EDU_VERHAGE_YEARS +  
                        (1 | famnr) + (1+time_years|famnr:EMI), 
                        data=df_long_final, REML=T) 

summary(model_CRP)

Produces the warnings:

fixed-effect model matrix is rank deficient so dropping 60 columns / coefficients
Warning messages:
1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model failed to converge with max|grad| = 2.50252 (tol = 0.002, component 1)
2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model is nearly unidentifiable: very large eigenvalue
Rescale variables?

Any ideas where this warning message is originating from and how I may solve the issue?

I've tried to remove different parameters but this is the bare minimum number of variables i want to include in the analysis and its still presenting with the warning message shown above.

A sample of the data:

dput(head(df_long_final))
structure(list(AGE = c(71, 71, 71, 65.5, 65.5, 65.5), GENDER = c(0, 
0, 0, 1, 1, 1), EDU_VERHAGE_YEARS = c(13, 13, 13, 9, 9, 9), famnr = c(1, 
1, 1, 2, 2, 2), binding = c("0.116957518", "0.116957518", 
"0.116957518", "0.040922909", "0.040922909", "0.040922909"), 
    EMI = c("EMI_301", "EMI_301", "EMI_301", "EMI_303", "EMI_303", 
    "EMI_303"), Twin_Number = c(1, 1, 1, 1, 1, 1), time_years = c(-6.8, 
    -6.8, -6.8, -6.8, -6.8, -6.8), mem = c(-0.1278462, -0.1278462, 
    -0.1278462, -0.523100556, -0.523100556, -0.523100556), CRP = c(1, 
    1, 1, 1, 1, 1), age_neuro = c(70.9, 75.3, 77.7, 65.5, 69.9, 
    72.3), variable = c("AGE_NEURO", "AGE_NEURO", "AGE_NEURO", 
    "AGE_NEURO", "AGE_NEURO", "AGE_NEURO"), follow_up = c(1, 
    2, 3, 1, 2, 3), CRP_Tertiles = structure(c(1L, 1L, 1L, 1L, 
    1L, 1L), .Label = c("Low", "Medium", "High"), class = "factor")), row.names = c(NA, 
-6L), class = c("tbl_df", "tbl", "data.frame"))
user20650
  • 24,654
  • 5
  • 56
  • 91
  • 1
    If this is the extent of your data, you are getting these warnings because you have too few cases and there is not enough variability in the data. – Phil May 27 '23 at 04:36
  • i have 200 cases this is just a redacted version – Nick Caruana May 27 '23 at 13:52
  • Nonetheless, the responses you are getting suggest that there is an issue with the variability of the variables. See here for a possible solution: https://stackoverflow.com/a/53053309/5221626 or https://stats.stackexchange.com/a/243225/87002 There is also this you may find useful https://stackoverflow.com/a/37094040/5221626 – Phil May 27 '23 at 14:45
  • 1
    is binding meant to be a character, It looks like a numeric ? (this is one potential source of why there are so many columns e.g. from warning "dropping 60 columns") – user20650 May 27 '23 at 15:43
  • Agree with @user20650. Try `df_long_final$binding <- as.numeric(df_long_final$binding)` ?? – Ben Bolker May 27 '23 at 15:49
  • Yes I had tried that and that fixed the multiple columns issue but this still presents with a warning. The major issue is that I'm not sure if the warning will impact my graph plotting and further analysis – Nick Caruana May 27 '23 at 16:57
  • Please edit your question to update it to the current version (i.e. a new version of `dput()`, and update the warnings to whatever they say now). Have you read the `?lme4::convergence` help file? – Ben Bolker May 29 '23 at 18:32

0 Answers0