Covariance mixed model Hi I'm learning about mixed model (2x2 cross over trial) and I don't understand how this works; How do we get to the last part of Covariance where Cov(Ek(i), Ek(i)) = Var(Ek(i)) = between subject variability.
Please can you explain step by step how we get this. Thanks so much!


In this model, the covariance between two responses from the same subject in different periods is the same as the covariance between two responses from two subjects in the same group (in the same or different periods).
The reason is that (a) the group random component $\xi_{k(i)}$ for subject $k$ in group $i$ doesn't change with time: it's shared by all subjects in $i$ across all periods; and (b) there is no subject random component that would be shared by all responses by the same subject.
Let's derive three covariances:
group $i$ / subject $k$ / period $j$
$$
\operatorname{Cov}\left( y_{ijk},y_{ijk} \right) = \operatorname{Var}\left( y_{ijk} \right) = \operatorname{Var}\left( \xi_{k(i)} \right) + \operatorname{Var}\left( \epsilon_{ijk} \right) = \sigma_B^2 + \sigma_W^2
$$
group $i$ / subjects $k_1$ and $k_2$ / period $j$
$$
\operatorname{Cov}\left( y_{ijk_1},y_{ijk_2} \right) =  \operatorname{Cov}\left( \xi_{k_1(i)} + \epsilon_{ijk_1} , \xi_{k_2(i)} + \epsilon_{ijk_2} \right) = \operatorname{Var}\left( \xi_{k(i)} \right) + \operatorname{Cov}\left( \epsilon_{ijk_1}, \epsilon_{ijk_2} \right) = \sigma_B^2
$$
group $i$ / subject $k$ / periods $j_1$ and $j_2$
$$
\operatorname{Cov}\left( y_{ij_1k},y_{ij_2k} \right) =  \operatorname{Cov}\left( \xi_{k(i)} + \epsilon_{ij_1k} , \xi_i + \epsilon_{ij_2k} \right)  = \operatorname{Var}\left( \xi_{k(i)} \right) + \operatorname{Cov}\left( \epsilon_{ij_1k}, \epsilon_{ij_2k} \right) = \sigma_B^2
$$
