Discern between- and within person correlation in longitudinal data There's a known between-person association of X and Y, and I'm trying to find out whether this association also holds on the within-person level by conducting a longitudinal study with 4 measurement occasions. My question is: How can I analyse both between- and within-person correlations at the same time? I'm hypothesizing two possible scenarios: A) there is a within-person association of X and Y, or B), as X changes, Y doesn't change (with Y beeing pretty constant in general), but within-person mean levels of X are associated with Y.
If I were only interested in the within-person correlation, I could specify a multilevel model as follows, with $\gamma_1$ giving the average within-person association (correct?):
$$Y_{it} = \beta_{oi} + \beta_{1i}X_{it}$$
$$ \beta_{ot}=\gamma_{0} + u_{0i} $$
$$ \beta_{1t}=\gamma_{1} + u_{1i} $$
But I'm not sure how to analyse between-person associations within this framework. Basically, I'm looking for something like a random-intercept cross-lagged panel model, but without the cross-effects.

One way to do this, related to my response to this somewhat different question, is to include two predictors in your mixed model: $\bar x_i$, which is the mean value of $x$ for person $i$, and $\delta = x - \bar x_i$, which is how far $x$ is above or below that person's mean (e.g. it is mean centred for each person).
Leaving aside the longitudinal bit, which I don't fully understand from the question, your model is something like
y ~ 1 + mean_x + delta_x + (1 + delta_x | person)
where mean_x captures the between-person effect of x on y, and delta_x captures with within-person effect (which is allowed to vary across people as a random effect).
