Giozz Lau
2023-Apr-20 08:11 UTC
[R] Warning message: In length(barlist) == 1 && as.character(barlist[[1]][[2]]) == "1"
Hello, I am writing to seek assistance regarding a warning message that I encountered while running a CLMM with two main factors and one random factor ("participants"). One of the main factors consists of six levels that can be either categorical or numerical. As this is my first time running this type of model, I would greatly appreciate your expertise in understanding and resolving this issue. Thank you in advance for your time and support. Sincerely, Gio.
Ivan Krylov
2023-Apr-21 11:43 UTC
[R] Warning message: In length(barlist) == 1 && as.character(barlist[[1]][[2]]) == "1"
On Thu, 20 Apr 2023 10:11:03 +0200 Giozz Lau <giozzlau at gmail.com> wrote:> I am writing to seek assistance regarding a warning message that I > encountered while running a CLMM with two main factors and one random > factor ("participants"). One of the main factors consists of six > levels that can be either categorical or numerical.Debugging, like the CLMM modelling that you're trying to perform here, can be described as a kind of inverse problem: given experimental data ('Some kind of warning is raised by length(barlist) == 1 && as.character(barlist[[1]][[2]]) == "1"'), one intends to model the state of the program at the time when the problem happens (since it's the whole expression that raises the warning and not any of its parts, perhaps barlist[[1]][[2]] is of length() > 1? But that's an error in recent versions of R, and used to be a warning in a few older versions...) and go about solving the problem from there. Sometimes, there's not enough experimental data, and the problem becomes ill-posed: strictly speaking, given the information above, there can be too many possible explanations for what you're experiencing. I see you've provided some information, but it's better to start with the full error message, the code you're running and a small piece of data that would reproduce the error on a different computer. Sometimes, it's possible to apply one's psychic debugging skills (read: make educated guesses and hope they are right) to regularise the ill-posed problem and solve it anyway. Searching CRAN for "clmm" yields the "ordinal" package, which has a clmm() function, which calls another function to operate on a variable called "barlist" and which also has been recently (November 2022) changed to read:>> length(barlist) == 1 && as.character(barlist[[1]][[2]])[1] == "1"(Note the extra [1] compared to the expression in your warning message.) Have you tried upgrading to ordinal version 2022.11-16? If that doesn't help, please provide the full warning, the code and the data to reproduce it, and the sessionInfo() output. -- Best regards, Ivan