Hi experts,
I am trying to examine "homophily" in school students. That is, I am examining whether pairwise similarity in various traits correlates with closeness in social networks.
Each row of my spreadsheet contains data for following columns: child_1_id, child_2_id, social closeness of child_1_id and child_2_id, pairwise similarity in trait of interest of child_1_id and child_2_id. This repeats for all pairwise combinations of children. The simplest form of my model is therefore the following:
trait similarity ~ social closeness + (1 | child_1_id) + (1 | child_2_id)
However, I would like to nest within classrooms. Importantly, trait similarity and social closeness were only calculated for children in the same classroom, and therefore child_1 and child_2 are always from the same classroom.
How do I go about nesting the crossed random effects for child id within a term for classroom?
Thanks in advance,
Luke