I am investigating how access to water and toilets in the household affects educational attainment in children.

One of the things I want to determine is if there are gender differences in the effects of access. Would it be correct to use subpop to generate estimations for male and female groups and then could I compare coefficients between these two sets of results?

Thank you in advance!