I'm new when it comes to regressions, and I really need help with a regression in connection with a school assignment, and I've tried to google this problem here, but I cant really find the answer to the problem with "2 not defined because of singularities" - I understand that this is because two or more of the independent variables are perfectly collinear. enter image description here

I have checked my whole dataset and I cant understand how "largegroup" can be perfectly collinear when "1" only occur once each date. Wouldnt it be perfecly collinear if "medium" and "large" both had "1" at the same date?

enter image description here

Is the regression valid if I only remove largegroup and othertimes from the lm function or how can I fix the problem? Thank you for the time.


1 Answer 1


The problem is that smallgroup + medgroup + largegroup = 1 which means these three variables are perfectly multicollinear with the intercept. You should drop one of them from your regression. The one you drop will be your baseline. You can then interpret the coefficients on the other two variables as the change relative to the variable that you dropped.

You can look up the "dummy variable trap" for more information.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.