1

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?

goldisfine
  • 4,742
  • 11
  • 59
  • 83
  • 1
    I would have thought it should be possible to discover the answer by examining `str(LMER_MIXED)`and the output of `print(m2)` ... neither of which has been offered. – IRTFM Mar 24 '15 at 19:53
  • Thanks @BondedDust. I updated to provide the top of the output. Maybe is the issue is that the intercept is not linearly separable? – goldisfine Mar 24 '15 at 20:10
  • It might be. I think you might have created your own dummy variables. I suspect it you `month` variables that are causing the problem. That's not usually good practice in R regression situations. – IRTFM Mar 24 '15 at 20:19
  • Reproducible example? – alexwhitworth Mar 25 '15 at 03:59

0 Answers0