Skip to content
Prev 19380 / 20628 Next

Is crossed random-effect the only choice?

The "crossed vs random" terminology is only relevant in models with 
more than one grouping variable.  I would call (1|X) " a random effect 
of X" or more precisely "a random-intercept model with grouping variable X"

   However, your question is a little unclear to me.  Is X a grouping 
variable or a predictor variable (numeric or categorical) that varies 
across groups?

   I can think of four possibilities.

  1. X is the grouping variable (e.g. "hospital"). Then ~ (1|X) is a 
model that describes variation in the model intercept / baseline value, 
across hospitals.

  2. X is a continuous covariate (e.g. annual hospital budget).  Then if 
H is the factor designating hospitals, we want  ~ X + (1|H) (plus any 
other fixed effects of interest. (It doesn't make sense / isn't 
identifiable to fit a random-slopes model ~ (H | X) because budgets 
don't vary within hospitals.

3. X is a categorical / factor predictor (e.g. hospital size class 
{small, medium, large} with multiple hospitals measured in each size 
class:  ~ X + (1|H) (the same as #2).

4. X is a categorical predictor with unique values for each hospital 
(e.g. postal code).  Then X is redundant with H, you shouldn't try to 
include them both in the same model.
On 7/10/21 4:55 PM, Jack Solomon wrote: