For years, I have been trying to find a definition for fixed and random effects. I often see statements like this:
- Fixed effects are constant across individuals. - almost universal
- We define effects (or coefficients) in a multilevel model as constant if they are identical for all groups in a population... - Andrew Gelman
- Parameters that describe the effects of a factor in ordinary GLMs are called fixed effects. They apply to all categories of interest, such as genders or treatments. - Alan Agresti
To put it simply: If a variable is categorical, how can its effect be constant for all individuals/groups? Each category has its own estimation, therefore at the first glance, I see an effect being constant only within the particular group.
For more background: I can (hopefully) understand the definition holds true in simple linear regression. In this simplest FE model, we estimate one intercept and one slope that apply to all observations. (As opposed to a mixed model, where I would allow the intercept/slope to vary according to a grouping factor.)
However, I am struggling to project the definition into a slightly more complex scenario, like this one:
- Let us say we measured the height two plants, both of them at five time points. [The data I used: 100, 101, 103, 104, 105 for plant_A; 85, 88, 93, 98, 102 for plant_B.]
- Even though I probably violate some assumptions, I can still run general linear model...
- height = plant_ID (class) + time (covariate)
- FE solutions: b0 = 84.65; b1 (time) = 2.85; plant_A = 9.40; plant_B = 0.00
- Time is still constant accross all the observations. However, I would say the effect of plant_A only influences the measurements within that class. In other words, the effect ("the class intercept") varies from class to class, which in my mind defies the definitions.
To wrap my head around it, I am trying two explanations, but I do not know if at least one of them is correct:
- Every categorical variable can be transformed to dummy variables, which in this case would lead to an equation:
y = 85.65 + 2.84*x1 + 9.40*x2 + 0.00*x3
, where x1 is time, x2 is plant_A (zeros and ones), x3 is plant_B (zeros and ones). Then, I can say that all the coefficients are constant for all individuals. The only particularity is that the coefficients b2 (9.40) and b3 (0.00) are "switch on/off" depending on the class an individual happens to fall in. - The "constant effect" means the degree of change when going from group_A to group_B (-9.40 cm in this case). This effect would influence each observation changing its group with the same intensity and direction. (Perhaps a more semantic explanation based on the previous one.)
I would like to add that I have read the major topis regarding mixed models on this forum and I have learned a lot from them, but this is still causing me a headache. So, I would really appreciate direct replies.