I saw the previous post on "Crossed vs nested random effects: how do they differ and how are they specified correctly in lme4?" with a very nice descriptive response from @RobertLong (Crossed vs nested random effects: how do they differ and how are they specified correctly in lme4?). We have a crossed design similar to the example of 3 schools crossed with 3 classes, but we have 4 sets of this crossing design. By that I mean we have 4 sets of 3 groups that are fully crossed back into 3 groups. In our case, these are populations of plants coming from different habitats (3 different habitat types, 4 populations of each) and transplanted back into the 3 different habitats. We used this model for e.g., final height:
modfinheight<-lmer(final.height~SOURCE.type+GARDEN.type+SOURCE.type:GARDEN.type+ (1|Origin.site)+(1|Transplant.site),data=datrmna.finalheight,REML=F)
where Origin.site is the population where the plant came from (4 from each type of habitat). Transplant.site is the population where they were planted (4 for each type of habitat) Source.type is the habitat type of the origin (3 levels: beach, marsh, road) Garden.type is the habitat type of the transplant (3 levels: beach, marsh, road)
It seems that we have the same setup as for the crossing example, but we have 4 sets of them. Should this be the way to model the four together? It seems to work, until we try to get components of variance for the random and fixed effects in the same analysis (using partR2). Perhaps we should have both random effects nested within Transplant.group? e.g., (1|Transplant.group) + (1|Transplant.group:Origin.site) + (1|Transplant.group:Transplant.site)
Origin.site
andTransplant.site
have only 4 levels each ? That's not really sufficient for fitting random intercepts since you will be asking the software to estimate variances for 2 normally distributed variables from only 4 observations each. $\endgroup$