I am running a multilevel log odds regression on a dataset that is at the individual level. Each individual belongs to a district, and there are both individual level variables (which vary by individual) and district level variables (which are constant per district). Let's call our explanatory variables ind_var1, ind_var2, dis_var1, dis_var2, our district dis, and our output variable out
I've been looking for the proper syntax on how to code this, and this is how far I've gotten:
mod1 = glmer(out ~ ind_var1 + ind_var2 + dis_var1 + dis_var2 + (1|dis), data = data, family = binomial(link = 'logit'))
My question is, is the above code correct syntax for construction the model, or does the syntax for the district level explanatory variables (dis_var1 and dis_var2) need to be edited?