I need help correctly writing out this mixed model for an academic paper. I'm a bit dyslexic and really struggle with math notation more complicated than multiplication and division!
Lets say the score of a pupil is correlated to their height (fixed effects) and an additional term of height^-1. I've formulated the dataset so that every pupil is assigned to a unique class which is nested in a unique school and nested in a unique school district. I dont need to explicitly nest the random effects in the lmer formula so long as they are nested in the dataset per -> Multilevel model with 4 levels?
I also want to incorporate two other random effects which are effectively crossed as these do not cluster inside of any other level. These are each student's Music_Taste and Favourite_Food
lmer(score ~ 1 + pupil_height + I(pupil_height^-1) + (1|Class) + (1|School) + (1|School_District) + (1|Music_Taste) + (1|Favourite_Food), data=data_file)
From Gelman and Hill, 2006 (p263) I think I need something like this formulae but with additional terms for the crossed random effects;
yi = αj[i] + β1Xi1 + β2Xi2 + e
Can anyone help out with the formula?
Its something like this but different to account for the nested random effects.
scorei jklmn=α + β₁⋅ heighti jklmn + β2⋅ heighti jklmn-1 + uj + uk + ul + um + un + εi jklmn
where Uj,k,l,m,n are the seperate random intercepts for class, school, school_district, music_taste and favorite_food.
As discussed the class, school and school district are nested in the dataset by virtue of unique IDs. The others are music_taste and favorite_food to be crossed random effects.