Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rank-deficient models in lme4 produce errors #21

Open
matthewravery opened this issue Feb 12, 2018 · 2 comments
Open

Rank-deficient models in lme4 produce errors #21

matthewravery opened this issue Feb 12, 2018 · 2 comments

Comments

@matthewravery
Copy link
Collaborator

Warning message produced by lme4::lmer

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

Result with add_ci/add_pi

Error in X %*% vcovBetaHat : non-conformable arguments

Likely what is happening is that lmer is taking your specified model, noticing that the covariance matrix won't properly invert, and is thus dropping some columns so that it behaves better. When ciTools tries to do the same thing, it attempts to use the original, un-reduced matrix and thus produces the above error.

@jthaman
Copy link
Owner

jthaman commented Feb 12, 2018

Good catch! Some thoughts:

  1. I'm surprised lmer doesn't throw an error if the model matrix is not full rank.
  2. I wonder how lmer chooses which columns to drop.
  3. Can you provide a small reproducible example?

@jthaman
Copy link
Owner

jthaman commented Feb 18, 2018

I have opened a new branch that addresses this bug. But now I'm wondering if we need to implement similar fixes for lm, glm, etc.
41f3c65

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants