Announcement

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

  • Interaction terms and main effects

    Greetings,

    I have tried to search different forums for an answer but without luck. Therefore, I am hoping that you can be of assistance and help clarify a few things related to interaction terms. It should be said that I am fairly new at using STATA so I apologize beforehand if this seems like an odd question.

    Basically, I am looking at the moderation of population density on municipality size in order to explain the variation in the level of internal political efficacy of the population. If I include the interaction term by itself then many of the dummies are statistically significant together with all the control variables. However, if I include the main effects then it seems to change the coefficients of the dummies in my interaction term a lot and many of my dummies are no longer significant. My hypothesis is that the effect of the municipality size is moderated by the population density (how far or how close people live to each other). Therefore, I would also expect that larger municipality size combined with higher population density would result in lower internal political efficacy. The main effects are both negative for all categories. My dependent variable consists of an index which I have created from five different items/variables.

    My question is why my interaction term changes so much when I include the main effects? Some of the dummies are omitted because of collinearity which is kind of expected. I just do not understand how the effects of larger municipality size and larger population density can suddenly go from negative to positive when the main effects are included? All the coefficients are negative in the main effects and you would expect both size and density to correlate negatively with internal political efficact. I am just trying to understand what mechanisms are at play here. Perhaps population density generally has a positive effect in the smaller municipalities but a negative in the larger ones but I still find it kind of odd that it seemingly changes so much.

    I run the regression with the interaction term like this:

    Code:
    regress IPE_Index i.size##i.density i.householdinc i.age i.education gender interest, r



  • #2
    Keith.
    and interested listers cannot say either, without taking a look at what Stata gave you back!
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Originally posted by Carlo Lazzaro View Post
      Keith.
      and interested listers cannot say either, without taking a look at what Stata gave you back!
      You are right. I forgot to paste the output.


      Code:
      regress IPE_Index i.population##i.density gender i.age i.houseinc i.education interest,
      note: 4.population#1b.density identifies no observations in the sample
      note: 4.population#5.density omitted because of collinearity
      note: 5.population#1.density identifies no observations in the sample
      note: 5.population#5.density omitted because of collinearity
      
      Linear regression                               Number of obs     =      3,635
                                                      F(34, 3600)       =      53.43
                                                      Prob > F          =     0.0000
                                                      R-squared         =     0.3127
                                                      Root MSE          =     13.483
      
      ----------------------------------------------------------------------------------------------------------
                                               |               Robust
                                  Index_final2 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      -----------------------------------------+----------------------------------------------------------------
                              Population |
                                            2  |  -1.203093   1.711106    -0.70   0.482    -4.557927    2.151741
                                            3  |  -.9653496   2.186496    -0.44   0.659    -5.252245    3.321546
                                            4  |   -1.54708   2.760275    -0.56   0.575    -6.958939    3.864779
                                            5  |  -3.539752   2.658007    -1.33   0.183    -8.751101    1.671598
                                               |
                          Density |
                                            2  |  -3.164964   2.096126    -1.51   0.131    -7.274678    .9447504
                                            3  |  -1.189188   2.160251    -0.55   0.582    -5.424626    3.046249
                                            4  |   .0810769   1.963531     0.04   0.967    -3.768668    3.930822
                                            5  |  -.9754596   2.651923    -0.37   0.713    -6.174882    4.223962
                                               |
          population#density |
                                          2 2  |   4.410701    2.37051     1.86   0.063    -.2369761    9.058378
                                          2 3  |   .7289825   2.386338     0.31   0.760    -3.949726    5.407691
                                          2 4  |    .870919   2.221493     0.39   0.695    -3.484591    5.226429
                                          2 5  |  -.9159924   2.952114    -0.31   0.756    -6.703976    4.871991
                                          3 2  |   3.422871   2.651113     1.29   0.197    -1.774964    8.620705
                                          3 3  |   2.000992   2.907799     0.69   0.491    -3.700106    7.702089
                                          3 4  |  -.6244531   2.606113    -0.24   0.811    -5.734059    4.485152
                                          3 5  |   1.359347   3.288904     0.41   0.679    -5.088954    7.807648
                                          4 1  |          0  (empty)
                                          4 2  |   3.000925    3.63175     0.83   0.409    -4.119568    10.12142
                                          4 3  |  -2.480697   3.338342    -0.74   0.457    -9.025928    4.064535
                                          4 4  |   1.337307    3.23351     0.41   0.679    -5.002387    7.677001
                                          4 5  |          0  (omitted)
                                          5 1  |          0  (empty)
                                          5 2  |   4.318754   3.223256     1.34   0.180    -2.000835    10.63834
                                          5 3  |     1.9591   3.158833     0.62   0.535    -4.234182    8.152382
                                          5 4  |  -1.682416    3.12099    -0.54   0.590    -7.801501     4.43667
                                          5 5  |          0  (omitted)
                                               |
                          gender (dummy) |  -4.288134   .4562564    -9.40   0.000    -5.182681   -3.393587
                                               |
                                        age |
                                            2  |   3.279238   1.412703     2.32   0.020     .5094599    6.049017
                                            3  |   6.005941   1.345288     4.46   0.000     3.368338    8.643543
                                            4  |   7.394357   1.299757     5.69   0.000     4.846023    9.942692
                                            5  |   6.016979   1.415449     4.25   0.000     3.241818     8.79214
                                               |
                                   Householdinc |
                          300.000-500.000 DKK  |   2.006163   .6035302     3.32   0.001     .8228682    3.189459
                             over 500.000 DKK |   4.483428   .6216588     7.21   0.000     3.264589    5.702266
                                               |
                               Education (Danish) |
                                    Gymnasial  |   2.452193   1.146994     2.14   0.033     .2033706    4.701016
                           Erhvervsuddannelse  |   1.682316   .5643337     2.98   0.003     .5758704    2.788762
                            Kort videregående  |   3.656304   1.221744     2.99   0.003     1.260924    6.051684
      Mellemlang/lang videregående uddannelse  |   6.373123   .6687478     9.53   0.000     5.061961    7.684285
                                               |
                                     Interest |   14.64081   .4893321    29.92   0.000     13.68142    15.60021
                                         _cons |   46.47089   2.142255    21.69   0.000     42.27074    50.67105
      ----------------------------------------------------------------------------------------------------------

      And without the main effects it looks as follows:

      Code:
       regress IPE_Index i.population#i.density gender i.age i.householdinc i.education interest, r
      note: 4.population#1b.density identifies no observations in the sample
      note: 5.population#1b.density identifies no observations in the sample
      
      Linear regression                               Number of obs     =      3,635
                                                      F(34, 3600)       =      53.43
                                                      Prob > F          =     0.0000
                                                      R-squared         =     0.3127
                                                      Root MSE          =     13.483
      
      ----------------------------------------------------------------------------------------------------------
                                               |               Robust
                                  Index_final2 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      -----------------------------------------+----------------------------------------------------------------
          population#density |
                                          1 2  |  -3.164964   2.096126    -1.51   0.131    -7.274678    .9447504
                                          1 3  |  -1.189188   2.160251    -0.55   0.582    -5.424626    3.046249
                                          1 4  |   .0810769   1.963531     0.04   0.967    -3.768668    3.930822
                                          1 5  |  -.9754596   2.651923    -0.37   0.713    -6.174882    4.223962
                                          2 1  |  -1.203093   1.711106    -0.70   0.482    -4.557927    2.151741
                                          2 2  |   .0426448   1.861469     0.02   0.982    -3.606995    3.692285
                                          2 3  |  -1.663298   1.811259    -0.92   0.359    -5.214494    1.887897
                                          2 4  |  -.2510967   1.811128    -0.14   0.890    -3.802036    3.299842
                                          2 5  |  -3.094545   1.978626    -1.56   0.118    -6.973885    .7847959
                                          3 1  |  -.9653496   2.186496    -0.44   0.659    -5.252245    3.321546
                                          3 2  |  -.7074423   1.748242    -0.40   0.686    -4.135086    2.720201
                                          3 3  |  -.1535462   2.052019    -0.07   0.940    -4.176782    3.869689
                                          3 4  |  -1.508726   1.821056    -0.83   0.407    -5.079129    2.061678
                                          3 5  |  -.5814622   2.036481    -0.29   0.775    -4.574234    3.411309
                                          4 1  |          0  (empty)
                                          4 2  |  -1.711118    2.52133    -0.68   0.497    -6.654495    3.232259
                                          4 3  |  -5.216965   1.998609    -2.61   0.009    -9.135484   -1.298446
                                          4 4  |  -.1286964   2.036168    -0.06   0.950    -4.120855    3.863462
                                          4 5  |   -2.52254   2.393925    -1.05   0.292    -7.216124    2.171044
                                          5 1  |          0  (empty)
                                          5 2  |  -2.385961   2.051347    -1.16   0.245    -6.407879    1.635956
                                          5 3  |   -2.76984   1.862071    -1.49   0.137    -6.420659    .8809785
                                          5 4  |  -5.141091   2.017349    -2.55   0.011    -9.096352   -1.185829
                                          5 5  |  -4.515212   2.279124    -1.98   0.048    -8.983714    -.046709
                                               |
                                     gender |  -4.288134   .4562564    -9.40   0.000    -5.182681   -3.393587
                                               |
                                       age |
                                            2  |   3.279238   1.412703     2.32   0.020     .5094599    6.049017
                                            3  |   6.005941   1.345288     4.46   0.000     3.368338    8.643543
                                            4  |   7.394357   1.299757     5.69   0.000     4.846023    9.942692
                                            5  |   6.016979   1.415449     4.25   0.000     3.241818     8.79214
                                               |
                                   householdinc |
                          300.000-500.000 DKK  |   2.006163   .6035302     3.32   0.001     .8228682    3.189459
                             over 500.000 DKK  |   4.483428   .6216588     7.21   0.000     3.264589    5.702266
                                               |
                                education (Danish) |
                                    Gymnasial  |   2.452193   1.146994     2.14   0.033     .2033706    4.701016
                           Erhvervsuddannelse  |   1.682316   .5643337     2.98   0.003     .5758704    2.788762
                            Kort videregående  |   3.656304   1.221744     2.99   0.003     1.260924    6.051684
      Mellemlang/lang videregående uddannelse  |   6.373123   .6687478     9.53   0.000     5.061961    7.684285
                                               |
                                     interest |   14.64081   .4893321    29.92   0.000     13.68142    15.60021
                                         _cons |   46.47089   2.142255    21.69   0.000     42.27074    50.67105
      Last edited by Keith Richardson; 15 Apr 2020, 09:03.

      Comment


      • #4
        Keith:
        thanks for posting what Stata gave you back via -dataex-.
        I think that the right model, methiodologically speaking, is the first one. It is seldom the case that interaction lives without the so called conditinal main effect of the interacted predictors.
        That said, I guess that the main issue with your regression is that it is too heavy loaded with predictors: I would consider a more parsimonious model.
        Perhaps you can replace the first interaction with density only
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Just thinking about it...why not presenting population and density as continuous variables, instead of categories. Among the advantages, a) preserving information b) producing a cleaner display of covariates.
          Best regards,

          Marcos

          Comment


          • #6
            Originally posted by Carlo Lazzaro View Post
            Keith:
            thanks for posting what Stata gave you back via -dataex-.
            I think that the right model, methiodologically speaking, is the first one. It is seldom the case that interaction lives without the so called conditinal main effect of the interacted predictors.
            That said, I guess that the main issue with your regression is that it is too heavy loaded with predictors: I would consider a more parsimonious model.
            Perhaps you can replace the first interaction with density only
            Thank you both for your input. I agree that methodologically speaking, the first model is the best option. However, it seems strange to me that the coefficients change so much compared to the second model that I posted. Regarding your second point, would you then advice me to remove some of the predictors from the model to see if this affects the coefficients? Obviously, I would not be able to maintain the same R^squared value but it would be more suitable for my model specification.
            Last edited by Keith Richardson; 16 Apr 2020, 05:42.

            Comment


            • #7
              Originally posted by Marcos Almeida View Post
              Just thinking about it...why not presenting population and density as continuous variables, instead of categories. Among the advantages, a) preserving information b) producing a cleaner display of covariates.
              Thanks for your reply. That could also be a possible solution. I have already thought about this. However, I am mainly interested in certain groups or categories of municipalities and not all municipalities as a whole. I am primarily interested in the smallest and the largest municipalities. I would like to catch the nuances that other models have not been able to in the sense that I want to see how the population density moderates the effect of size in certain municipalities.

              Comment


              • #8
                Keith:
                most depends on the data generating process.
                Hopefully the literature in your research field can give you some clues.
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment

                Working...
                X