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.

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?

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.

## Best Answer

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.