2

Suppose we fit a linear model $$y_{i}=\beta_{0}+\beta_{1}x_{i}+e_{i}$$ where $e_{i}\sim N(0,\sigma^{2})$. Suppose we also fit a random intercepts model $$y_{ij}=\alpha_{0}+\alpha_{1}x_{ij}+u_{j}+e_{ij}$$ where $e_{ij}\sim N(0,\sigma_{e}^{2})$ and $u_{j}\sim N(0,\sigma_{u}^{2})$.

Is the OLS estimator $\hat{\beta}_{1}$ equal to $\hat{\alpha}_{1}$?

Kian
  • 477
  • 2
  • 16

1 Answers1

1

No.

Here's a counterexample in R:

library(lme4)

x = c(1, 2, 3, 4)
unit = factor(c(1, 1, 2, 2))
y = x + c(.1, .2, -.1, -.2)

print(unname(coef(lm(y ~ x))["x"]))
print(coef(lmer(y ~ x + (1|unit)))$unit[1,"x"])

The output is:

[1] 0.88
[1] 0.9333333
Kodiologist
  • 20,116