I am fitting the following logit model in lme4 (R):
dummy ~ ind_var1 + state_var2 + country_var3 + (1 | country/state)
This specifies varying intercepts for countries and states, with states nested within countries. I am using the following notation to represent this model:
\begin{align*} p(y_{ijk} = 1) & = {logit}^{-1}(\beta_{1}\cdot{x_{1ijk}} + \beta_{2}\cdot{x_{2jk}} + \beta_{3}\cdot{x_{3k}} + country_{k} + state_{jk}), \end{align*}
\begin{align*} country_{k} &\sim N(0,\sigma^2_{country}) \end{align*}
\begin{align*} state_{jk} &\sim N(0,\sigma^2_{state}) \end{align*}
However, this seems wrong. The nested intercept (states in countries) don't appear as nested in the model. I am just adding an index to show the nesting. Can someone help me understand how this model is best represented? Any references related to this is appreciated as well. Most of the stat books I have read focus heavily on non-nested models/notation. Thanks!