I have two samples of variables $\{y_{1i},y_{2i},x_i,s_i\}$. Where $y_1$ and $y_2$ are binary variables, $x$ is a continuous variable and $s$ is a sample indicator, taking the value 0 in one sample and the value 1 in the other.
I can test whether means are different for $y_1$$y_{1i}$ and $y_2$$y_{2i}$ separately using a simple t-test or equivalently by estimating this linear equation using OLS$$y_i=\alpha+\beta x_i+\tau s_i + \varepsilon_i$$The regression has the advantage of providing a test of differences in the conditional means $E[y_i|x]$$E[y_i1|x_i,s_i=0]-E[y_i1|x_i,s_i=1]$
Now I also want to test whether the relationship between $y_1$ and $y_2$ is the same in both samples. For example I want to test whether:$$Corr[y_{1i},y_{2i}|x_i,s_i=0]=Corr[y_{1i},y_{2i}|x_i,s_i=1]$$ To me this seems like it should be a textbook statistical test, but I can't seem to find what the default procedure/test for this would be.