Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Question on interaction terms

    Hello everyone, I am running two multiple linear regression models where the first one needs to have an interaction term between the dummy variable female (1 = female, 0=male) and a categorical variable beauty. The first model needs to have the interaction term between female and beauty, and the second one between male and beauty. I've read that i.female##c.beauty will give me the interaction term between the two variables but how should I write the regress in order to have an interaction term between female and beauty and male and beauty? I have tried the following: for the model with the interaction term between female and beauty I used regress with 1.female##c.beauty and 0.female##c.beauty for the second model but I don't know if this is the correct way to write it and if this is giving me the results I want. I also don't really understand the difference between # and ##.

  • #2
    Type -help factor variables- in Stata and you will get an explanation regarding the difference between # and ##. If not enough, click on the link to the pdf file at the top and this will provide you with even more details.
    On Edit: If beauty is a categorical variables you could also use i.beauty instead of c.beauty. Once again the pdf file provides ample explanation.
    Last edited by Eric de Souza; 07 Mar 2020, 08:09.

    Comment


    • #3
      You probably don't need the two interactions. When you have a main effect and dummy interaction, the main effect is the value if the dummy equal zero. The effect when the dummy equals one is the main effect plus the parameter on the interaction. Since zero appears to be male your data, the effects for males will be the main effect on beauty.

      Note that the margins command after the regression will calculate these easily.

      Comment

      Working...
      X