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 coefficient of age is statically different 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?