Singularity in backsolve at level 0, block 1 in LME model

Mohammed Ahmed

dput for data, copy from https://pastebin.com/1f7VuBkx (too large to include here)

data.frame':    972 obs. of  7 variables:
$ data_mTBS : num  20.3 22.7 0 47.8 58.7 ...
$ data_tooth: num  1 1 1 1 1 1 1 1 1 1 ...
$ Adhesive  : Factor w/ 4 levels "C-SE2","C-UBq",..: 2 2 2 2 2 2 2 2 2 2 ...
$ Approach  : Factor w/ 2 levels "ER","SE": 1 1 1 1 1 1 1 1 1 1 ...
$ Aging     : Factor w/ 2 levels "1w","6m": 1 1 1 1 1 1 2 2 2 2 ...
$ data_name : Factor w/ 40 levels "C-SE2-1","C-SE2-10",..: 11 11 11 11 11 11 11 11 11 11 ...
$ wait      : Factor w/ 2 levels "no","yes": 1 1 1 1 1 1 1 1 1 1 ...
head(Data)


   data_mTBS data_tooth Adhesive Approach Aging data_name wait
1     20.27          1    C-UBq       ER    1w   C-UBq-1   no
2     22.73          1    C-UBq       ER    1w   C-UBq-1   no
3      0.00          1    C-UBq       ER    1w   C-UBq-1   no
4     47.79          1    C-UBq       ER    1w   C-UBq-1   no
5     58.73          1    C-UBq       ER    1w   C-UBq-1   no
6     57.02          1    C-UBq       ER    1w   C-UBq-1   no

when I run the following code without "wait", it works perfectly, but when I try run it with "wait" included in the model it gives the singularity problem.

LME_01<-lme(data_mTBS ~ Adhesive*Approach*Aging*wait, na.action=na.exclude,data = Data, random = ~ 1|data_name);

Error in MEEM(object, conLin, control$niterEM) : Singularity in backsolve at level 0, block 1

contrast_Aging<-contrast(LME_01,a = list(Aging =c("1w"),Adhesive = levels(Data$Adhesive),Approach = levels(Data$Approach) ),b = list(Aging =c("6m"), Adhesive = levels(Data$Adhesive),Approach = levels(Data$Approach)))

c1<-as.matrix(contrast$X)
Contrastsi2<-summary(glht(LME_01, c1))

&

contrast_Approach<-contrast(LME_01,
                                    a = list(Approach = c("SE"), Aging =levels(Data$Aging)   ,Adhesive = levels(Data$Adhesive)),
                                    b = list(Approach = c("ER"), Aging =levels(Data$Aging)   ,Adhesive = levels(Data$Adhesive)))

c2<-as.matrix(contrast$X)
Contrastsi3<-summary(glht(LME_01, c2))

Thanks in advance.

Ben Bolker

tl;dr as @HongOoi is telling you, wait and Adhesive are confounded in your model. lme is a little stupider/more stubborn than many of the other modeling functions in R, which will either warn you explicitly that you have confounded fixed effects or automatically drop some of them for you.

It's a bit easier to see this if you plot the data:

## source("SO50505290_data.txt")

library(ggplot2)
ggplot(dd,aes(Adhesive,data_mTBS,
              fill=Aging,
              alpha=Approach))+
  facet_grid(.~wait,scale="free_x",space="free",
             labeller=label_both)+
  guides(alpha = guide_legend(override.aes = list(fill = "darkgray")))+
  geom_boxplot()
ggsave("SO50505290.png")

enter image description here

This shows you that knowing that wait=="no" is the same as knowing that Adhesive=="C-UBq".

It would probably make more sense to back up and think about the questions you're asking, but if you do this with lme4::lmer it will tell you

fixed-effect model matrix is rank deficient so dropping 16 columns / coefficients

library(lme4)
LME_02<-lmer(data_mTBS ~ Adhesive*Approach*Aging*wait+
               (1|data_name), 
            na.action=na.exclude,data = dd)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Difference between reading from /dev/block/mmcblk0 and /dev/block/mmcblk0p1

Is <img> element block level or inline level?

Django model.BooleanField value as 0/1

bootstrapping with lme4 model and missing values

How to Block Requests at the Rack Level?

Float and block level elements

Block Level Element vs Block Formatting Context

Block instances of a class at the JVM level?

Python Pandas Multi-index: keeping same length of level=1 with all level=0 indexes

Custom sorting of the level 1 index of a multiindex Pandas DataFrame according to the level 0 index

Fill gaps in DataFrame MultiIndex level 1, differently for each level 0

Python ValueError: Duplicated level name: "REPORTED_DATE", assigned to level 1, is already used for level 0

Covariance structure in lme - AR(1)

Naive Bayes model NOT predicting anything on applying model- Predict function returning with 0 factor level

Extracting confidence intervals from lme model

Pandas turn level1 of index to level 0 of column

Sorting Multi level dataframe index level0, based on value of index level1 at specific column

How to block ads at router level

Block Level Elements Overlapping

Can API Management tool help attain Level 3(RMM-Richardson Maturity Model) from Level 0?

Backward selection in LME, singularity in backsolve occured

Block a URL at browser level

Counting 3 Level Model

Ashes Of The Singularity Escalation Can't start because api-ms-win-core-rtlsupport-l1-2-0.dll is missing

why there is no response on level 0,1 in ajax (onreadystatechange)

pandas MultiIndex on columns select columns from level 0 (outside) as well as level 1 (inside)

Pandas: Duplicated level name: <Column Name>, assigned to level 1, is already used for level 0."

Error in MEEM(object, conLin, control$niterEM) : Singularity in backsolve at level 0, block 1... Linear mixed model, nlme, R

lme4::lmer() With A -1?