4

I usually work in SAS or R, so when I code a GLM with a random intercept, it's usually pretty easy. However, I've been running into a few problems (too complicated to get into here) where it might be useful to code my own random intercept in python.

However, I'm not sure how to code a random intercept, or even how it differs from a dummy variable. Does it? I've always been told that fixed and random effects need to be treated separately and there are lots of theoretical reasons why that's true. I understand the theoretical reasons.

So what's the difference on the back end? Would my GLM be that different if I replaced a random intercept with a dummy variable?

If they are substantially different, how can I approximate a random intercept without a pre-defined random-intercept function?

Reid
  • 521
  • 5
  • 12
  • 2
    Some of the information you need can be gleaned from my answer here: [Why do the estimated values from a Best Linear Unbiased Predictor (BLUP) differ from a Best Linear Unbiased Estimator (BLUE)?](http://stats.stackexchange.com/a/122587/7290) – gung - Reinstate Monica Nov 09 '15 at 19:02
  • This question was already answered here, wasn't it? https://stats.stackexchange.com/questions/313103/whats-the-difference-between-random-intercepts-model-and-linear-model-with-dumm – Chris-Gabriel Islam Jan 03 '21 at 19:54

0 Answers0