# Testing if a correlation between two ordinal variables depends on a third variable

I have two ordinal variables : $y_1$ (a dummy) and $y_2$ (five categories). I know they are correlated, but I have reasons to believe this correlation depends on a third variable ($z$). An interaction would normally do the job with a regression like this : $y_1 = \beta_0 + \beta_1 z + \beta_2 y_2 + \beta_3 zy_2$. However, $y_1$ and $y_2$ are joint outcomes and I cannot assume that one causes the other. How can I modelize this problem and how can I test for the impact of $z$ on the correlation between $y_1$ and $y_2$? I also have control variables which need to be included in the statistical model.

My first idea was to use a bivariate ordered probit. however, I don't know if it is possible to include a coefficient that measures the impact of $z$ on the correlation between the two dependent variables $y_1$ and $y_2$ (the rho estimate).