Question: Suppose each model syntax below, as well as the data structure used to fit them, precisely represent the study design by a researcher, THEN: In each model, can we determine which random effects are taken as NESTED and which one(s) as CROSSED?
Clarified in the comments:
So, I'm asking how could one understand the nature (i.e., crossed vs. nested) such random-effects by examining the model syntax used to fit them.
No. There is no way to determine whether factors are nested by inspecting the formula. This is because nesting and crossing are properties of the study design, not the model.
If we use:
(1 | therapist) + (1 | therapist:subject)
then the intention is often to specify that subject
is nested in therapist
.
However, if the reality of the study design is that subject
is crossed with therapist
, then this model would be incorrect. The model cannot tell us whether the factors or nested or crossed.
If we write:
(1 | therapist) + (1 | subject)
then there can be ambiguity because the results will depend on how the data are encoded. There are two scenarios:
In the former case then (1 | therapist) + (1 | subject)
is correct. We can of course still fit (1 | therapist) + (1 | therapist:subject)
however this would be wrong. Note that the model formula cannot tell us whether the factors are nested or crossed.
In the latter case, it depends on how the data are encoded. For example, suppose we have 3 therapists, each of whom sees 3 subjects, and each subject is unique. So there are 9 unique subjects. If these are coded like this:
subject therapist
1 1 1
2 2 1
3 3 1
4 1 2
5 2 2
6 3 2
7 1 3
8 2 3
9 3 3
here subject
is encoded such thateach therapist "shares" the same subject ID numbers, even though they are different individuals. So here we can see that even looking at the data, there is no way to know whether these factors are crossed or nested - the only way to know is with reference to the study design. Obviously it follows that if the data cannot tell us whether the factors are crossed or nested, then the model formulae also cannot. In this case (1 | therapist) + (1 | subject)
is incorrect, and (1 | therapist) + (1 | therapist:subject)
should be used.
If subject is coded like this:
subject therapist
1 1 1
2 2 1
3 3 1
4 4 2
5 5 2
6 6 2
7 7 3
8 8 3
9 9 3
then (1 | therapist) + (1 | subject)
and (1 | therapist) + (1 | therapist:subject)
will yield exactly the same results. Again, the model formulae cannot inform us about whether the factors are nested or crossed.