Hello,
I have a question about using margins command after sem command (structural equation model) with categorical variables.
For example, let's assume that I have two variables, sex and group. Sex has two values, male and female. Group has three values, 1,2 and 3. Since sem does not allow factor-variable notation, I need to create several new variables (e.g. one variable for sex, two for group, and 6 for the interaction between sex and group) in order to use sem.
After the regression, I want to obtain the margins of the two variables and all possible combination of the two. If factor-variable notation is allowed, it would be "margins sex group sex#group." Since the notation is NOT allowed (and I have 9 new variables instead), I am wondering if anyone knows how to obtain the margins.
Thank you very much!
I have a question about using margins command after sem command (structural equation model) with categorical variables.
For example, let's assume that I have two variables, sex and group. Sex has two values, male and female. Group has three values, 1,2 and 3. Since sem does not allow factor-variable notation, I need to create several new variables (e.g. one variable for sex, two for group, and 6 for the interaction between sex and group) in order to use sem.
After the regression, I want to obtain the margins of the two variables and all possible combination of the two. If factor-variable notation is allowed, it would be "margins sex group sex#group." Since the notation is NOT allowed (and I have 9 new variables instead), I am wondering if anyone knows how to obtain the margins.
Thank you very much!

Comment