You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've run into an issue where I get the following error:
contrasts can be applied only to factors with 2 or more levels
from the lmerTest::lmer function, specifically the call here.
I called ancombc2 with the both a fixed effects formula and a random effects formula, specifically: body.site + (1 | subject). The body.site factor has two levels, and the subject factor has four levels. What happened is that the feature chosen by the expression y_crt = y[1, ] (see the link above) happened to only represent one level of the body.site factor, and thus the error above.
It seems like the first row of the feature table/OTU table is chosen as a matter of convenience, but by chance this feature may not represent multiple levels of the variables in the model. Choosing a different feature by changing the feature selection to y_crt = y[2, ] resolved the issue, and ancombc2 ran successfully. Note also that I did not encounter the issue with the same input data but no random effects formula.
Perhaps there is a way to make the call to lmerTest::lmer robust to such edge cases.
I've run into an issue where I get the following error:
from the
lmerTest::lmer
function, specifically the call here.I called
ancombc2
with the both a fixed effects formula and a random effects formula, specifically:body.site + (1 | subject)
. Thebody.site
factor has two levels, and thesubject
factor has four levels. What happened is that the feature chosen by the expressiony_crt = y[1, ]
(see the link above) happened to only represent one level of thebody.site
factor, and thus the error above.It seems like the first row of the feature table/OTU table is chosen as a matter of convenience, but by chance this feature may not represent multiple levels of the variables in the model. Choosing a different feature by changing the feature selection to
y_crt = y[2, ]
resolved the issue, and ancombc2 ran successfully. Note also that I did not encounter the issue with the same input data but no random effects formula.Perhaps there is a way to make the call to
lmerTest::lmer
robust to such edge cases.Possibly the cause of #271.
The text was updated successfully, but these errors were encountered: