If I have two continuous variables, and want to check whether their association varies by a categorical variable (e.g. gender), is there a formal statistical test for this?
I know I can create a linear model in R and add an interaction term to the model, but I wanted to check whether there's a statistical test for association between two variables stratified by a third.
Moreover, is there something like the Pearson Correlation coefficient, but stratified by a third categorical variable?