# Testing whether subject-level slopes in two different random slopes models are correlated across-subjects

Sorry for this poor title.

Let's say 50 subjects each did 20 trials of an experiment, and I recorded 4 variables from each trial, W, X, Y, Z. For each subject, I want to measure the correlation between W with X and between Y with Z. This will give me two correlation/regression values for each subject (let's call them A and B). So I have 50 values of A and 50 of B, one of each for every subject. I then want to measure whether A is correlated with B.

Is there any approach to this, which uses "better math?" This approach feels crude.

Another way of framing this (B_i is the random slopes coefficient from the top equation, and I am measuring whether it can be used to predict Z from Y):

$X&space;=&space;B_i&space;*&space;(W&space;+&space;1)&space;*&space;subject_i&space;\\&space;Z&space;=&space;B_2&space;*&space;(Y&space;+&space;1)&space;+&space;B_3*(Y&space;+&space;1)*B_i$

I think I can't just do an interaction model because it would only let me test whether the relationship between W and X is modulated by Y or Z. It wouldn't account for a relationship between Y and Z

Thanks