I have the following model: salary ~ age + sex

with sex: a dummy variable with male 1 and female 0 and age a continue variable.

I want to transform the model to know whether the coe􏰐fficient of age is statically di􏰎fferent for the male and the female.

I thought about to fit age in function of salary and sex:

age ~ salary + sex

and after to check if the coefficient sex is significant.

Or an other way: to add a new variable age x sex in the model:

salary ~ age + sex + agesex

and to check if the coefficient of agesex is significant.

Which one is true?


1 Answer 1


The easiest way is to simply add the interaction term and use the model

salary ~ age + sex + age * sex

If the interaction term is significant, then the slope for males is different from the slope for females.

  • $\begingroup$ ok thanks, the other way is true or not? $\endgroup$
    – tssssddde
    Dec 8, 2015 at 12:55
  • $\begingroup$ The other way analyses the effect of the salary on age, allowing for different intercepts for male and female. Not really what you are looking for ;) $\endgroup$
    – tho_mi
    Dec 8, 2015 at 12:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.