Fixed-effect model matrix is rank deficient

2.4k Views Asked by At

I get the following error when I try to run a mixed effects model:

> LMER_MIXED <- as.data.frame(LMER_MIXED)
> m2 <- lmer(log_bid_price ~ . - state + (1|state), data = LMER_MIXED)
fixed-effect model matrix is rank deficient so dropping 1 column / coefficient

This is after using findLinearCombos from the caret package to see if there are any linearly combinable columns:

> LMER_MIXED <- cbind(cbind(LMER_DESIGN, state), log_bid_price)
> findLinearCombos(LMER_MIXED)
$linearCombos
list()

$remove
NULL

Any thoughts on how to remove this warning and find a column that is not linearly separable?

    > str(LMER_MIXED)
'data.frame':   11697 obs. of  63 variables:
 $ (Intercept)                                : num  1 1 1 1 1 1 1 1 1 1 ...
 $ month10                                    : num  0 0 0 0 0 0 0 0 0 0 ...
 $ month11                                    : num  0 0 0 0 0 0 0 0 0 0 ...
 $ month12                                    : num  0 0 0 0 0 0 0 0 0 0 ...
 $ month2                                     : num  0 0 0 0 0 0 0 0 0 0 ...
 $ month3                                     : num  0 0 0 0 0 0 0 0 0 0 ...
 $ month4                                     : num  1 1 0 0 0 0 1 0 0 0 ...
 $ month5                                     : num  0 0 1 1 1 1 0 1 0 0 ...
 $ month6                                     : num  0 0 0 0 0 0 0 0 1 1 ...
 $ month7                                     : num  0 0 0 0 0 0 0 0 0 0 ...
 $ month8                                     : num  0 0 0 0 0 0 0 0 0 0 ...
 $ month9                                     : num  0 0 0 0 0 0 0 0 0 0 ...
 $ weekend1                                   : num  0 0 1 1 0 0 0 0 0 0 ...
 $ weekendNone                                : num  0 0 0 0 0 0 0 0 0 0 ...
 $ day_of_week1                               : num  0 0 0 0 0 0 0 0 1 0 ...
...

I guess the issue is that the Intercept column is a linear combination?

0

There are 0 best solutions below