I'm following up on this great answer. Given the structure of my data (below), is it possible to add a random-effect for H (a cluster ID variable) and X (a categorical variable not varying in H) as represented by the lme4 formula: ~ (1|H) + (1|X)?
If yes, would that indicate that H and X are crossed random-effects even though NO value of X is capable of meeting every value of H as suggested by this answer?
Finally, under nested random-effects, we say correlations exist among observations coming from the same cluster, but how do correlations come about under crossed random-effects as in my case?
H X
1 2
1 2
2 1
2 1
2 1
3 2
4 1
Xis NOT capable of meeting every value ofHas suggested by linked answer for my random-effect to be crossed, so how come we still callXandHcrossed? (2) (To clarify on what you said didn't understand) In nesting, we say correlations exist among observations coming from the same cluster, but how do correlations come about under crossed random-effects as in my case? (3) Under this random structure, neitherHnorXcan have an additional fixed effect in the model (H + X + (1|H) + (1|X)), correct? – rnorouzian Jul 17 '21 at 13:27H + X + (1|H) + (1|X)but specifying a variable as both random and fixed makes almost no sense to me and I would recommend not doing it. – Robert Long Jul 17 '21 at 20:49Hcluster are correlated with each other and separately observations belonging to the sameXare correlated with each other, right? Can we also confirm partial crossing by:m = "H X 1 2 1 2 2 1 2 1 2 1 3 2 4 1"; dat=read.table(text=m,header=T); xtabs(~H+X,data = dat)? – rnorouzian Jul 18 '21 at 00:16