I am working with mixed effects models and I am still a bit confused.
While I have read multiple explanations of what the differences between nested and crossed random effects are, I am not sure how to apply them to my data. I have read the following explanation already: Crossed vs nested random effects: how do they differ and how are they specified correctly in lme4?
My dataset is about people living in different cities. Thus, I have multiple nationalities as one variable (nationality of the person living in a city) and cities as another variable (the city the person lives in). What I want to see with my model is whether nationalities differ overall and whether they also differ between each city (e.g. whether someone with the nationality "Japan" living in San Francisco is different in terms of my dependent variable when compared to other Japanese that live somewhere else).
To answer this question, I thought about using a nested model, but I am not sure whether this is possible in my scenario. What is confusing to me is the example about class rooms and schools as described in the link above. While I understand that one class is part of only one school (nested), I am not sure whether this can also be said for nationalities. Especially in regards to the following: In my dataset, one and the same individual can only be observed in one city but the overall nationality factor can be observed in multiple cities. In other words: Person A134 lives in San Francisco and is Japanese. However, he is not the only Japanese person and I have Japanese people living in Tokyo, but also living in, London and other cities)
Would it still be possible to use a nested model or is it an issue that the nationality "Japan" appears across all cities? If not, I am not sure how else to answer my question.
The nested random effect I thought of would look like:
lmer(dependent_variable ~ variable1 + variable2 + (1|nationality/city), data=data)
Furthermore, what would the difference in interpretation be if the following model was used? What would change in terms of interpretation?
lmer(dependent_variable ~ variable1 + variable2 + (1|nationality) * (1|city), data=data)
EDIT: I am not sure, but maybe the following is what I am looking for? How does it differ from the two above?:
lmer(dependent_variable ~ variable1 + variable2 + (1|nationality:city), data=data)