Solved – R: Test significance of difference in slopes of same correlations in different groups

rregression

Say I have two groups of observations A and B. Each group contains the SAME two set of observations a_1,a_2 and b_1,b_2. For group A, I estimate how well a_1 and a_2 are correlated by computing Spearman's Correlation Coefficient between a_1 and a_2 and likewise for group B. How do I assess the magnitude of the difference?

E.g. think of it this way: Group A is women and group B is men. a_1 is weight and so is b_1. Likewise a_2 and b_2 are heights. How do I asses sif there is a significant difference in how weight and height are connected in men and women?

I guess it comes down to assuming linearity and then constructing and comparing two linear models, one for men and one for women?

Best Answer

You should rather construct one linear model, containing the sex and the height as explanatory variables plus their interaction. (The response being the weight.) Then, the significance of the interaction term tells you whether there is a ''difference in how weight and height are connected in men and women''. (Given, of course, the model is diagnostically correct.)

In R:

 summary( lm( Weight ~ Height * Sex, data = YourData ) )

and then look for the Height:Sex term.

Related Question