# How does including a random effect, change the parameter estimate for a group level covariate?

I'll try and explain where I am getting stuck.

I wish to model delay to treatment. I observe patients nested in hospitals. I have a mixture of patient and hospital level covariates. I suspect that there are unmeasured covariates that induce correlation between patients being treated in the same hospital. This would violate the basic assumptions about independent and identically distributed variables, and to get round this I add a random or fixed effect to the model.

Without this, then the unmeasured covariates will be operating through the measured hospital level covariates and induce bias. If estimate a fixed effects model then I would have an individual mean 'delay' for each hospital, but am I correct in thinking that these would be 'collinear' with any measured site level variable, and therefore not identifiable. Does this also apply to a random effects model? And if it does then is the aforementioned bias completely partioned to the 'random effect' or is some still operating through the measured site level covariates?

I have had a look at this great answer, and read the Bafumi and Gelman reference that was suggested, but I would very much appreciate any guidance.

No reply so I have just re-read 'Multi-level and longitudinal modelling using Stata' by Rabe-Hesketh and Skrondal (2nd edition) pp.109-114. I think I have a better understanding now which I'll jot down here.

Without including the random-effect, the independence assumptions mentioned in the question are violated. In a multi-level model, the final reported co-efficient is a weighted average of the 'within' and 'between' effects. For a covariate that varies only at hospital level, then there are no 'within' effects, and so the co-efficient in the random-effects model represents only the between effects.

It is possible to estimate the between effects separately by creating a data set of the patient response and the covariates averaged over each hospital (collapsing my dataset from 12 000 patient level observations to 50 hospital level observations in my particular case). One can then simply run the original regression model in this collapsed data set to retrieve the between effects.

Note that the co-efficients for the hospital level covariates will not exactly match those retrieved from the random effects model if there are other covariates that vary both within and between hospitals, as in this collapsed model only the 'between' aspect of these will be estimated, and this will not necessarily have the same 'confounding' effect as the weighted average of the 'between' and 'within' effects in the full random effects model.