Intuition
First, let’s consider the random-intercept, fixed slope model again.
All slopes are held constant, i.e. in each group we assume the same effect of x on y.
Is this really a reasonable assumption?
Instead we may introduce random slopes and let the slope vary by group.
We can see that it some groups the relationship is differs in strength or even becomes negative when allowing the slopes to vary.
That is because in addition to all previous error terms, we are also adding an error term for each slope.
The dotted lines are fixed slopes. The arrows show the added error term for each random slope.
\[ y_{ij}=\gamma_{00}+\gamma_{10}x_{ij}+U_{0j}+\varepsilon_{ij} \]
The model can be expressed in 2 different levels, as follows:
Level 1:
\[ y_{ij}=\beta_{0j}+\beta_{1j}x+\varepsilon_{ij} \]
Level 2:
\[ \beta_{0j}=\gamma_{00}+U_{0j} \]
\[ \beta{ij}=\gamma_{10} \]
The model includes predictors and slopes that relate them to the dependent variable, \(\gamma_{10}\) at level 1 with subscript \(10\). \(\gamma_{10}\) is defined similarly to \(\beta_1\) in the regression model, which is a measure of the effect on \(y\) of a 1-unit change in \(x\).
In addition, in this model \(\gamma_{10}\) and \(\gamma_{00}\) are fixed models, while \(\sigma^2\) and \(\tau^2\) are random models.
One implication of the model in prior equation is that the dependent variable is influenced by variation between individuals (\(\sigma^2\)), variation between groups (\(\tau^2\)), the average across all groups (\(\gamma_{00}\)), and the effect of the independent variable measured by \(\gamma_{10}\) which is also common to all clusters.
In practice there is no reason that the effect of \(x\) on \(y\) should be common to all clusters, but it is possible that one \(\gamma_{10}\) is common to all clusters. There is a unique cluster effect \(\gamma_{10}+U_{1j}\), where \(\gamma_{10}\) is the average relationship of \(x\) to \(y\) across clusters and \(U_{1j}\) is the variation in the relationship between the two variables. \(\gamma_{10}+U_{1j}\) is assumed to have a mean ) and vary randomly around \(\gamma_{10}\).
\[ y_{ij}=\gamma_{00}+\gamma_{10}x_{ij}+U_{0j}+U_{1j}x_{ij}+\varepsilon_{ij} \]
From equation above, the fixed model and the random model can be written as follows.
Fixed model: \(\gamma_{00}+\gamma_{10}x_{ij}\)
Random model: \(U_{0j}+U_{1j}x_{ij}+\varepsilon_{ij}\)
The model in the equation above has an interaction between cluster and \(x\), so the relationship between \(x\) and \(y\) is not constant across all clusters.
Data centering is commonly approached by calculating the difference between an individual’s score and the overall mean across the sample.
Another approach, called group mean centering, involves calculating the difference between an individual’s score and the mean of the group they belong to. For example, in schools, overall mean centering would involve finding the difference between each score and the overall mean across the entire school, while group mean centering would entail finding the difference between each score and the mean of the specific school.
The choice between these two approaches should be based on the relationship between variables \(x\) and \(y\).
Overall mean centering allows for the comparison of individuals across the sample, while group mean centering places each individual in their relative position within a group. For instance, using group mean centered ESCS in the analysis for schools means investigating the relationship between students’ relative ESCS scores within their school and their mathematics achievement.
In contrast, overall mean centering would examine the relationship between students’ relative standing in the overall sample on the ESCS and mathematics achievement
Previously we learned about the random slope model:
\[ y_{ij}=\gamma_{00}+\gamma_{10}x_{ij}+U_{0j}+U_{1j}x_{ij}+\varepsilon_{ij} \] For example, \(y_{ij}\) is the dependent variable of mathematics achievement, \(x_{ij}\) is the independent variable of ESCS score, and random error at the student and school levels.
We can extend the random slope model above by including several independent variables at both level 1 and level 2.
In addition to knowing the relationship between ESCS scores and students’ mathematics achievement, we can also find out the extent to which the average ESCS at the school level is related to the students’ ESCS scores.
This model basically has two parts, the first model explains the relationship between individual ESCS (\(x_{ij}\)) and mathematics achievement, and the other model explains the coefficient at level 1 as a function of the level 2 predictor, namely the average ESCS (\(Z_j\)).
Level 1:
\[ y_{ij}=\beta_{0j}+\beta_{1j}x_{ij}+\varepsilon_{ij} \]
and level 2: \[ \beta_{hj}=\gamma_{h0}+\gamma_{h1}Z_j+U_{hj} \]
\[ y_{ij}=\gamma_{00}+\gamma_{10}x_{ij}+\gamma_{01}Z_j+\gamma_{1001}x_{ij}Z_j+U_{0j}+U_{1j}X_{ij}+\varepsilon_{ij} \]