I am trying to write the mathematical notation for the following mixed effect model:
lmer(Y ~ 0 + A + B + C + (0 + B | A)
With subjects nested in A and a stratified intercept for every A should be estimated.
So what I think this means is:
Stratified Intercept for A
Fixed Effect for A, B and C
Varying Random Slope for B
But I struggle to set up the mathematical notation for this formula. My first attempt was this:
\begin{aligned} \operatorname{Y}_{ij} &\sim N \left(\mu_{i}, \sigma^2\right) \\ \end{aligned}
\begin{aligned} E(\operatorname{Y{ij}}) = \beta_{0j}(A) + \beta_{1j} (A) + \beta_{2j} (B) + \beta_{3} (C) + \epsilon_{ij} \end{aligned}
\begin{aligned} E(Y_{ij}) = (\beta_0(A) + \upsilon_{0j}(A)) + (\beta_{1}(A) + \upsilon_{1j}(A)) + (\beta_{2}(B) + \upsilon_{2j}(B)) + \beta_{3}(C) + \epsilon_{ij} \end{aligned}
\begin{aligned} E(Y_{ij}) = \beta_0(A) + \beta_{1}(A) + \beta_{2}(B) + \beta_{3}(C) + \upsilon_{0j}(A) + \upsilon_{1j}(A)+ \upsilon_{2j}(B) + \epsilon_{ij} \end{aligned}
\begin{aligned} \upsilon_{0j} \sim N(0, \tau^2_{\upsilon_{0j}}) \\ \upsilon_{1j} \sim N(0, \tau^2_{\upsilon_{1j}}) \\ \upsilon_{2j} \sim N(0, \tau^2_{\upsilon_{2j}}) \end{aligned}
\begin{aligned} Cov(\sigma^2_{\upsilon_{0j}}, \sigma^2_{\upsilon_{2j}}) = \sigma^2_{\upsilon_{0j}, \upsilon_{2j}} \end{aligned}
\begin{aligned} \left( \begin{array}{c} \beta_{0j} \\ \beta_{2j} \end{array} \right) &\sim N \left( \left( \begin{array}{c} \mu_{\beta_{0j}} \\ \mu_{\beta_{2j}} \end{array} \right) , \left( \begin{array}{c} \sigma_{\beta_{0j}} & \rho_{\beta_{0j}\beta_{2j}} \\ \rho_{\beta_{2j}\beta_{0j}} & \sigma_{\beta_{0j}} \end{array}\right) \right) , for \ A \ j = 1, ...,J \end{aligned}
I really struggle with the intercepts, especially with the random elements of A, so I am thankful for every kind of help!