I have a data frame (df) where I see correlation between two continuous variables (c1 and c2). I need to know whether the observed correlation between the two variables differs between groups, which are identified with a categorical variable (v1)?
I tried to find interaction using lm function in R. I tried lm(c1~c2*v1,data=df) and looked for p value of the interaction c2:v1. I am not sure if this is correct. Please correct me if I am wrong.