R “singular fit” / Rank Deficient Model — Troubleshooting Guide (NYC)

R shows “singular fit” or “model matrix is rank deficient” when your regression includes predictors that are perfectly or nearly perfectly collinear. This is common in econometrics and regression courses. For broader graduate statistics and software support, visit our main page: Statistics Tutoring NYC.

Why this happens

Your design matrix X does not have full column rank. Some predictors are linear combinations of others, so R cannot estimate separate coefficients.

Common causes

  • Dummy variable trap (all categories + intercept)
  • Totals and components included together
  • Perfect multicollinearity
  • Zero-variance predictors

How to diagnose the issue

1. Inspect the summary

Look for coefficients with NA or huge standard errors.

2. Check VIF

library(car)
vif(model)

3. Look for exact relationships

Example: x3 = x1 + x2

4. Check variation

sapply(df, function(z) length(unique(z)))

How to fix it

  • Drop one dummy category (reference group)
  • Remove redundant predictors
  • Avoid including totals and components together
  • Explain dropped variables in your write-up

Need help?

If you’re unsure which variables to drop or how to justify your model, you can get direct help with regression diagnostics.

Call or text: 646‑543‑0832
WhatsApp: 206‑384‑1336
Email: tutor@mytutornyc.com