0

As I'm studying random effects, I wonder why we use random effects but not just add a covariate to the fixed model? For example, if I treat 'school' as random effects, why don't I just add school as a categorical variable in the fixed model ?

Anna
  • 1

1 Answers1

1

Here's one example: Let's say that you have data at the school level (class size) and at the child level (score). Your data might look like:

School   Class_Size Score
 1        25         12
 1        25         17
 2        32         15
 2        32         11
 ....

What will happen if you have a regression model with score regressed on class_size? Your model will be wrong, because you have violated independence - kids come from the same school.

OK, I'll add school as a categorical predictor. What happens now? Class size falls out of the model due to collinearity. If you know the school, you know the class size, so class size doesn't tell you anything.

This is the basis of what are called fixed effects models* - and they have the very nice feature that if you add school as a categorical predictor, you control for all school level variables, whether you measured them or not. But they have the disadvantage that you can no longer use a school level predictor in your model.

*The terminology is confusing. Stata, in particular, uses these terms, and there are a couple of nice books by Paul Allison with this title.

Jeremy Miles
  • 13,917
  • 6
  • 30
  • 64
  • Because a variable at one level, say income, might have different effects than at a higher level. The average mean income of a school might have different impact than the income of a student. – user54285 Sep 28 '21 at 02:22
  • Yep, that's another reason. – Jeremy Miles Sep 28 '21 at 15:54
  • I think unfortunately that a lot of the focus in classes is the standard errors, that is dealing with independence. I don't think that is really what is important about multilevel models. Another problem is focusing on random versus fixed effects which confuses people - and which has many different definitions. I think the way to approach multilevel models is a method that allows you to see things you won't with other forms of regression. – user54285 Sep 29 '21 at 16:08