Announcement

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

  • Independent variables change signs when interaction is included

    Hey stata experts, I am currently writing my master thesis, therefore using stata. I have a question about an interpretation of my interactions. I wanna do a logistic regression, my dependent var is stock market participation (binary), my independent var are five personality traits (continuous), and my interactions are quality of government (continuous) with each trait. I also have several controls. It happens for two traits that the interaction is significant and positive, however, the respective independent variables change signs, but only for the regression in which the respective interaction is included. In all other regression with the other interactions, the sign remains the same. I have tried demeaned variables, probit, xtlogit, I have let stata calculate the interactions, and used a non-normed meancountryeqi, but results remain the same.

    How is it possible to interpret these results?

    This is what I regress:
    logit smp bfi10_open bfi10_consc bfi10_extra bfi10_agree bfi10_neuro meancountrynormeqi CV, vce(robust)
    logit smp bfi10_open bfi10_consc bfi10_extra bfi10_agree bfi10_neuro meancountrynormeqi oqog CV, vce(robust)
    logit smp bfi10_open bfi10_consc bfi10_extra bfi10_agree bfi10_neuro meancountrynormeqi cqog CV, vce(robust)
    logit smp bfi10_open bfi10_consc bfi10_extra bfi10_agree bfi10_neuro meancountrynormeqi eqog CV, vce(robust)
    logit smp bfi10_open bfi10_consc bfi10_extra bfi10_agree bfi10_neuro meancountrynormeqi aqog CV, vce(robust)
    logit smp bfi10_open bfi10_consc bfi10_extra bfi10_agree bfi10_neuro meancountrynormeqi nqog CV, vce(robust)

    This is the stata output:
    Column 1 Column 2 Column 3 Column 4 Column 5 Column 6
    Openness -.054***
    (.011)
    .449***
    (.060)
    -.054***
    (.011)
    -.051***
    (.011)
    -.051***
    (.011)
    -.053***
    (.011)
    Conscientiousness -.101***
    (.014)
    -.103***
    (.014)
    -.114
    (.070)
    -.100***
    (.014)
    -.100***
    (.014)
    -.100***
    (.014)
    Extraversion -.024**
    (.012)
    -.025**
    (.012)
    -.024**
    (.012)
    -.427***
    (.060)
    -.026**
    (.012)
    -.025**
    (.012)
    Agreeableness .063***
    (.014)
    .059***
    (.014)
    .063***
    (.014)
    .059***
    (.014)
    -.229***
    (.072)
    .063***
    (.014)
    Neuroticism -.004
    (.011)
    -.001
    (.011)
    -.004
    (.011)
    -.000
    (.012)
    -.003
    (.012)
    .075
    (.061)
    QOG .047***
    (.001)
    .071***
    (.003)
    .047***
    (.004)
    .027***
    (.003)
    .031***
    (.004)
    .050***
    (.002)
    O*QOG -.007***
    (.001)
    C*QOG .000
    (.001)
    E*QOG .006***
    (.001)
    A*QOG .004***
    (.001)
    N*QOG -.001
    (.001)
    Best, Sophie

  • #2
    Sophie:
    welcome to this forum.
    As per FAQ, please post what you typed and what Stata gave you back via CODE delimiters (otherwise, as in your post, the output is hardly readable).
    You performed different regression specification: hence, no wonder that results changed.
    For good reasons (see -margins- and -marginsplot-) is far better to exploit -fvvarlist- notation for creating categorical variables and interactions.
    All the regression approaches that you mentioned fit different datasets and are by no means interchangeable: while -logistic- seems right if your regressand in a yes/no one, you do not say if you're dealing with cross-sectional or panel data.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thanks for your reply and sorry for that. I have an unbalanced panel with data from 2011, 2013, 2015, 2017. The independent variables are time-invariant. This is what I typed:
      logit smp bfi10_open bfi10_consc bfi10_extra bfi10_agree bfi10_neuro meancountrynormeqi age gender maritalstatus ch001_ health incomextile unemployed secondaryeducation tertiaryeducation cf016tot GDP, vce(robust)
      logit smp bfi10_open bfi10_consc bfi10_extra bfi10_agree bfi10_neuro meancountrynormeqi oqog age gender maritalstatus ch001_ health incomextile unemployed secondaryeducation tertiaryeducation cf016tot GDP, vce(robust)
      logit smp bfi10_open bfi10_consc bfi10_extra bfi10_agree bfi10_neuro meancountrynormeqi aqog age gender maritalstatus ch001_ health incomextile unemployed secondaryeducation tertiaryeducation cf016tot GDP, vce(robust)

      and the output:

      Code:
      Iteration 0:   log pseudolikelihood = -31348.683  
      Iteration 1:   log pseudolikelihood = -26606.692  
      Iteration 2:   log pseudolikelihood = -26172.303  
      Iteration 3:   log pseudolikelihood = -26169.621  
      Iteration 4:   log pseudolikelihood =  -26169.62  
      
      Logistic regression                             Number of obs     =     61,215
                                                      Wald chi2(17)     =    8138.25
                                                      Prob > chi2       =     0.0000
      Log pseudolikelihood =  -26169.62               Pseudo R2         =     0.1652
      
      ------------------------------------------------------------------------------------
                         |               Robust
                     smp |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------------+----------------------------------------------------------------
              bfi10_open |  -.0542844   .0111898    -4.85   0.000    -.0762161   -.0323527
             bfi10_consc |  -.1007209   .0137165    -7.34   0.000    -.1276047   -.0738371
             bfi10_extra |  -.0239048   .0117969    -2.03   0.043    -.0470263   -.0007834
             bfi10_agree |   .0634871   .0139709     4.54   0.000     .0361046    .0908695
             bfi10_neuro |  -.0036259   .0114864    -0.32   0.752    -.0261387     .018887
      meancountrynormeqi |   .0473813   .0009422    50.29   0.000     .0455345     .049228
                     age |   .0197396   .0012675    15.57   0.000     .0172552    .0222239
                  gender |   .4089045   .0232394    17.60   0.000     .3633561    .4544529
           maritalstatus |    .226495   .0249527     9.08   0.000     .1775886    .2754013
                  ch001_ |  -.0892244   .0088333   -10.10   0.000    -.1065373   -.0719115
                  health |   .5623931   .0263517    21.34   0.000     .5107446    .6140415
             incomextile |   .2577227   .0108987    23.65   0.000     .2363615    .2790838
              unemployed |  -.2722945   .0422908    -6.44   0.000     -.355183   -.1894061
      secondaryeducation |   .2129277   .0287005     7.42   0.000     .1566757    .2691797
       tertiaryeducation |    .628529   .0302036    20.81   0.000      .569331    .6877271
                cf016tot |   .0787095   .0058097    13.55   0.000     .0673227    .0900963
                     GDP |  -.0396268   .0060792    -6.52   0.000    -.0515418   -.0277117
                   _cons |  -6.967406   .1551552   -44.91   0.000    -7.271505   -6.663308
      ------------------------------------------------------------------------------------
      (est1 stored)
      Code:
      Iteration 0:   log pseudolikelihood = -31348.683  
      Iteration 1:   log pseudolikelihood = -26588.512  
      Iteration 2:   log pseudolikelihood = -26134.689  
      Iteration 3:   log pseudolikelihood = -26130.529  
      Iteration 4:   log pseudolikelihood = -26130.526  
      
      Logistic regression                             Number of obs     =     61,215
                                                      Wald chi2(18)     =    8091.34
                                                      Prob > chi2       =     0.0000
      Log pseudolikelihood = -26130.526               Pseudo R2         =     0.1665
      
      ------------------------------------------------------------------------------------
                         |               Robust
                     smp |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------------+----------------------------------------------------------------
              bfi10_open |   .4491226   .0603116     7.45   0.000      .330914    .5673312
             bfi10_consc |  -.1032261   .0137261    -7.52   0.000    -.1301288   -.0763233
             bfi10_extra |  -.0252594   .0118044    -2.14   0.032    -.0483957   -.0021232
             bfi10_agree |   .0588091   .0139633     4.21   0.000     .0314416    .0861766
             bfi10_neuro |  -.0005631   .0114728    -0.05   0.961    -.0230495    .0219232
      meancountrynormeqi |   .0713167   .0030043    23.74   0.000     .0654284    .0772049
                    oqog |  -.0072044   .0008514    -8.46   0.000    -.0088731   -.0055358
                     age |   .0195976   .0012688    15.45   0.000     .0171107    .0220844
                  gender |   .4112678   .0232462    17.69   0.000      .365706    .4568296
           maritalstatus |   .2259649   .0249495     9.06   0.000     .1770648     .274865
                  ch001_ |  -.0885206   .0088501   -10.00   0.000    -.1058664   -.0711748
                  health |   .5637663   .0263721    21.38   0.000     .5120779    .6154547
             incomextile |   .2578155   .0109171    23.62   0.000     .2364183    .2792127
              unemployed |   -.260796   .0423551    -6.16   0.000    -.3438106   -.1777815
      secondaryeducation |   .2002678   .0287733     6.96   0.000     .1438732    .2566624
       tertiaryeducation |   .6201373   .0301399    20.58   0.000     .5610643    .6792104
                cf016tot |   .0774748   .0058114    13.33   0.000     .0660846    .0888649
                     GDP |  -.0426493   .0060595    -7.04   0.000    -.0545258   -.0307728
                   _cons |  -8.604982   .2521623   -34.12   0.000    -9.099211   -8.110753
      ------------------------------------------------------------------------------------
      (est2 stored)
      Code:
      Iteration 0:   log pseudolikelihood = -31348.683  
      Iteration 1:   log pseudolikelihood = -26600.082  
      Iteration 2:   log pseudolikelihood = -26163.359  
      Iteration 3:   log pseudolikelihood =  -26160.62  
      Iteration 4:   log pseudolikelihood = -26160.619  
      
      Logistic regression                             Number of obs     =     61,215
                                                      Wald chi2(18)     =    8176.81
                                                      Prob > chi2       =     0.0000
      Log pseudolikelihood = -26160.619               Pseudo R2         =     0.1655
      
      ------------------------------------------------------------------------------------
                         |               Robust
                     smp |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------------+----------------------------------------------------------------
              bfi10_open |  -.0513248   .0112198    -4.57   0.000    -.0733151   -.0293344
             bfi10_consc |  -.0999784   .0137182    -7.29   0.000    -.1268655   -.0730912
             bfi10_extra |  -.0261673   .0118237    -2.21   0.027    -.0493413   -.0029933
             bfi10_agree |  -.2293127   .0724726    -3.16   0.002    -.3713565    -.087269
             bfi10_neuro |  -.0031551   .0115059    -0.27   0.784    -.0257062    .0193961
      meancountrynormeqi |   .0311246   .0040561     7.67   0.000     .0231748    .0390745
                    aqog |    .004279   .0010439     4.10   0.000     .0022329    .0063251
                     age |   .0198574   .0012686    15.65   0.000      .017371    .0223438
                  gender |    .411454   .0232624    17.69   0.000     .3658606    .4570475
           maritalstatus |   .2275482   .0249727     9.11   0.000     .1786027    .2764938
                  ch001_ |  -.0898966   .0088472   -10.16   0.000    -.1072369   -.0725564
                  health |   .5616802    .026354    21.31   0.000     .5100273    .6133331
             incomextile |   .2583767   .0109117    23.68   0.000     .2369901    .2797633
              unemployed |  -.2678391    .042318    -6.33   0.000     -.350781   -.1848973
      secondaryeducation |   .2127965   .0287029     7.41   0.000     .1565397    .2690532
       tertiaryeducation |   .6262872   .0302214    20.72   0.000     .5670544      .68552
                cf016tot |   .0788237   .0058117    13.56   0.000      .067433    .0902143
                     GDP |  -.0415255   .0061026    -6.80   0.000    -.0534864   -.0295647
                   _cons |  -5.876958   .3049331   -19.27   0.000    -6.474616     -5.2793
      ------------------------------------------------------------------------------------
      (est5 stored)
      I hope I have presented it in the right way now, I am new to the forum.

      Kind regards
      Sophie

      Comment


      • #4
        Sophie:
        thanks for providing further details and Stata outcome within CODE delimiters.
        The first comment, before considering Stata outcome, refers to your -logit- choice.
        If you have panel data, you should consider -xtlogit-. Moreover, you -logit- code does not take into account intraclass correlation within the same panel: you should have imposed -cluster()- for that.
        Moreover: which one of the models you have tested gives the faires and truest view of the data generating process?
        And, last but not least, what's your supervisor's take about the entire matter?
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Hi Carlo, thanks for your fast reply. Okay, I have changed my data to panel data with random effects. I have 60,215 observations from 30,286 individuals and will therefore cluster my data on individual level? I now have the following equations and outcomes, do you mean that with fvvarlist? Is there still anything wrong?

          Code:
           eststo: xtlogit smp bfi10_open bfi10_consc bfi10_extra bfi10_agree bfi10_neuro meancountryno
          > rmeqi age i.gender i.maritalstatus ch001_ i.health incomextile i.unemployed i.secondaryeduca
          > tion i.tertiaryeducation cf016tot GDP, re vce(cluster mergeid)
          
          Fitting comparison model:
          
          Iteration 0:   log pseudolikelihood = -31348.683  
          Iteration 1:   log pseudolikelihood = -26606.692  
          Iteration 2:   log pseudolikelihood = -26172.303  
          Iteration 3:   log pseudolikelihood = -26169.621  
          Iteration 4:   log pseudolikelihood =  -26169.62  
          
          Fitting full model:
          
          tau =  0.0     log pseudolikelihood =  -26169.62
          tau =  0.1     log pseudolikelihood =  -25824.26
          tau =  0.2     log pseudolikelihood = -25475.721
          tau =  0.3     log pseudolikelihood =  -25129.63
          tau =  0.4     log pseudolikelihood = -24794.768
          tau =  0.5     log pseudolikelihood = -24485.659
          tau =  0.6     log pseudolikelihood = -24228.504
          tau =  0.7     log pseudolikelihood = -24076.658
          tau =  0.8     log pseudolikelihood = -24159.875
          
          Iteration 0:   log pseudolikelihood = -24076.626  
          Iteration 1:   log pseudolikelihood = -22851.827  
          Iteration 2:   log pseudolikelihood = -22762.731  
          Iteration 3:   log pseudolikelihood = -22757.576  
          Iteration 4:   log pseudolikelihood = -22757.576  (backed up)
          Iteration 5:   log pseudolikelihood = -22757.146  
          Iteration 6:   log pseudolikelihood = -22757.145  
          
          Calculating robust standard errors:
          
          Random-effects logistic regression              Number of obs     =     61,215
          Group variable: mergeidnew                      Number of groups  =     30,286
          
          Random effects u_i ~ Gaussian                   Obs per group:
                                                                        min =          1
                                                                        avg =        2.0
                                                                        max =          4
          
          Integration method: mvaghermite                 Integration pts.  =         12
          
                                                          Wald chi2(17)     =    3151.89
          Log pseudolikelihood  = -22757.145              Prob > chi2       =     0.0000
          
                                             (Std. Err. adjusted for 30,286 clusters in mergeid)
          --------------------------------------------------------------------------------------
                               |               Robust
                           smp |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
          ---------------------+----------------------------------------------------------------
                    bfi10_open |  -.0708362    .027664    -2.56   0.010    -.1250567   -.0166157
                   bfi10_consc |  -.1498915   .0341088    -4.39   0.000    -.2167435   -.0830395
                   bfi10_extra |  -.0649633   .0290136    -2.24   0.025    -.1218289   -.0080977
                   bfi10_agree |   .1223087   .0341575     3.58   0.000     .0553613    .1892561
                   bfi10_neuro |  -.0247047   .0278416    -0.89   0.375    -.0792733    .0298639
            meancountrynormeqi |   .0893142   .0023895    37.38   0.000     .0846308    .0939976
                           age |   .0255978    .002951     8.67   0.000     .0198139    .0313817
                      1.gender |   .7921669   .0576142    13.75   0.000     .6792451    .9050886
               1.maritalstatus |   .5010448     .05925     8.46   0.000      .384917    .6171727
                        ch001_ |  -.1561766   .0201011    -7.77   0.000    -.1955741   -.1167792
                      1.health |   .7423534    .050929    14.58   0.000     .6425344    .8421725
                   incomextile |   .3880567   .0221899    17.49   0.000     .3445652    .4315482
                  1.unemployed |   -.423053   .0828855    -5.10   0.000    -.5855057   -.2606003
          1.secondaryeducation |   .5111052   .0684194     7.47   0.000     .3770056    .6452048
           1.tertiaryeducation |   1.500836   .0763593    19.65   0.000     1.351174    1.650497
                      cf016tot |   .1096531   .0113788     9.64   0.000     .0873511    .1319551
                           GDP |  -.0411016   .0104685    -3.93   0.000    -.0616195   -.0205838
                         _cons |  -12.38511   .3822477   -32.40   0.000     -13.1343   -11.63592
          ---------------------+----------------------------------------------------------------
                      /lnsig2u |   2.181268   .0365193                      2.109691    2.252844
          ---------------------+----------------------------------------------------------------
                       sigma_u |    2.97616   .0543436                      2.871532      3.0846
                           rho |   .7291709   .0072118                      .7148064    .7430719
          --------------------------------------------------------------------------------------
          (est1 stored)
          Code:
          . eststo: xtlogit smp bfi10_open bfi10_consc bfi10_extra bfi10_agree bfi10_neuro meancountryno
          > rmeqi c.meancountryeqi#c.bfi10_open age i.gender i.maritalstatus ch001_ i.health incomextile
          >  i.unemployed i.secondaryeducation i.tertiaryeducation cf016tot GDP, re vce(cluster mergeid)
          
          Fitting comparison model:
          
          Iteration 0:   log pseudolikelihood = -31348.683  
          Iteration 1:   log pseudolikelihood = -26591.309  
          Iteration 2:   log pseudolikelihood = -26139.504  
          Iteration 3:   log pseudolikelihood =  -26135.47  
          Iteration 4:   log pseudolikelihood = -26135.468  
          
          Fitting full model:
          
          tau =  0.0     log pseudolikelihood = -26135.468
          tau =  0.1     log pseudolikelihood = -25790.652
          tau =  0.2     log pseudolikelihood =  -25442.68
          tau =  0.3     log pseudolikelihood = -25097.162
          tau =  0.4     log pseudolikelihood = -24762.823
          tau =  0.5     log pseudolikelihood = -24454.084
          tau =  0.6     log pseudolikelihood = -24196.997
          tau =  0.7     log pseudolikelihood = -24044.722
          tau =  0.8     log pseudolikelihood = -24126.819
          
          Iteration 0:   log pseudolikelihood = -24044.693  
          Iteration 1:   log pseudolikelihood = -22827.205  
          Iteration 2:   log pseudolikelihood = -22737.304  
          Iteration 3:   log pseudolikelihood = -22732.222  
          Iteration 4:   log pseudolikelihood = -22732.222  (backed up)
          Iteration 5:   log pseudolikelihood =  -22731.81  
          Iteration 6:   log pseudolikelihood =  -22731.81  
          
          Calculating robust standard errors:
          
          Random-effects logistic regression              Number of obs     =     61,215
          Group variable: mergeidnew                      Number of groups  =     30,286
          
          Random effects u_i ~ Gaussian                   Obs per group:
                                                                        min =          1
                                                                        avg =        2.0
                                                                        max =          4
          
          Integration method: mvaghermite                 Integration pts.  =         12
          
                                                          Wald chi2(18)     =    3136.87
          Log pseudolikelihood  =  -22731.81              Prob > chi2       =     0.0000
          
                                             (Std. Err. adjusted for 30,286 clusters in mergeid)
          --------------------------------------------------------------------------------------
                               |               Robust
                           smp |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
          ---------------------+----------------------------------------------------------------
                    bfi10_open |   .1020189   .0371511     2.75   0.006     .0292041    .1748337
                   bfi10_consc |  -.1543348   .0341384    -4.52   0.000    -.2212449   -.0874248
                   bfi10_extra |  -.0662919   .0290251    -2.28   0.022      -.12318   -.0094039
                   bfi10_agree |   .1123927    .034126     3.29   0.001      .045507    .1792785
                   bfi10_neuro |  -.0185169   .0278194    -0.67   0.506    -.0730419    .0360081
            meancountrynormeqi |   .1335231   .0070848    18.85   0.000     .1196371    .1474092
                               |
              c.meancountryeqi#|
                  c.bfi10_open |  -.2752699   .0404522    -6.80   0.000    -.3545546   -.1959851
                               |
                           age |   .0253113    .002952     8.57   0.000     .0195255    .0310971
                      1.gender |    .795764    .057634    13.81   0.000     .6828034    .9087246
               1.maritalstatus |   .4998696   .0592283     8.44   0.000     .3837844    .6159549
                        ch001_ |  -.1548665    .020114    -7.70   0.000    -.1942892   -.1154438
                      1.health |   .7442974   .0509628    14.60   0.000     .6444122    .8441826
                   incomextile |   .3870699   .0222078    17.43   0.000     .3435435    .4305964
                  1.unemployed |  -.4049214   .0829809    -4.88   0.000     -.567561   -.2422819
          1.secondaryeducation |    .486414   .0685167     7.10   0.000     .3521238    .6207042
           1.tertiaryeducation |   1.486696   .0761562    19.52   0.000     1.337432    1.635959
                      cf016tot |   .1080253    .011371     9.50   0.000     .0857385    .1303121
                           GDP |  -.0430037    .010446    -4.12   0.000    -.0634774   -.0225299
                         _cons |  -15.29172   .5927366   -25.80   0.000    -16.45346   -14.12998
          ---------------------+----------------------------------------------------------------
                      /lnsig2u |   2.180808   .0365854                      2.109102    2.252515
          ---------------------+----------------------------------------------------------------
                       sigma_u |   2.975477   .0544295                      2.870686    3.084092
                           rho |   .7290802   .0072264                      .7146864     .743009
          --------------------------------------------------------------------------------------
          (est2 stored)
          Also, which models do you mean with which one gives the fairest and truest view? Before I test the interaction efffect, I regress my personality traits on smp without the interaction variable meancountrynormeqi. This model is my baseline model, and then I try to interact meancountrynormeqi. Do you think my baseline model is then the one with the fairest view?:

          Code:
           eststo: xtlogit smp bfi10_open bfi10_consc bfi10_extra bfi10_agree bfi10_neuro age gender ma
          > ritalstatus ch001_ health incomextile unemployed secondaryeducation tertiaryeducation cf016t
          > ot GDP, re vce(cluster mergeid)
          
          Fitting comparison model:
          
          Iteration 0:   log pseudolikelihood = -31348.683  
          Iteration 1:   log pseudolikelihood = -28128.419  
          Iteration 2:   log pseudolikelihood = -27914.818  
          Iteration 3:   log pseudolikelihood = -27914.221  
          Iteration 4:   log pseudolikelihood = -27914.221  
          
          Fitting full model:
          
          tau =  0.0     log pseudolikelihood = -27914.221
          tau =  0.1     log pseudolikelihood = -27527.051
          tau =  0.2     log pseudolikelihood = -27134.029
          tau =  0.3     log pseudolikelihood = -26742.092
          tau =  0.4     log pseudolikelihood =  -26360.75
          tau =  0.5     log pseudolikelihood = -26004.129
          tau =  0.6     log pseudolikelihood = -25696.062
          tau =  0.7     log pseudolikelihood = -25483.493
          tau =  0.8     log pseudolikelihood = -25479.446
          
          Iteration 0:   log pseudolikelihood = -25483.514  
          Iteration 1:   log pseudolikelihood = -24105.494  
          Iteration 2:   log pseudolikelihood = -23913.228  
          Iteration 3:   log pseudolikelihood =  -23896.97  
          Iteration 4:   log pseudolikelihood = -23896.905  
          Iteration 5:   log pseudolikelihood = -23896.905  (backed up)
          Iteration 6:   log pseudolikelihood = -23896.057  
          Iteration 7:   log pseudolikelihood = -23896.057  
          
          Calculating robust standard errors:
          
          Random-effects logistic regression              Number of obs     =     61,215
          Group variable: mergeidnew                      Number of groups  =     30,286
          
          Random effects u_i ~ Gaussian                   Obs per group:
                                                                        min =          1
                                                                        avg =        2.0
                                                                        max =          4
          
          Integration method: mvaghermite                 Integration pts.  =         12
          
                                                          Wald chi2(16)     =    2701.80
          Log pseudolikelihood  = -23896.057              Prob > chi2       =     0.0000
          
                                           (Std. Err. adjusted for 30,286 clusters in mergeid)
          ------------------------------------------------------------------------------------
                             |               Robust
                         smp |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
          -------------------+----------------------------------------------------------------
                  bfi10_open |  -.2476276    .028503    -8.69   0.000    -.3034924   -.1917628
                 bfi10_consc |  -.0476146   .0350198    -1.36   0.174    -.1162521    .0210229
                 bfi10_extra |   .0967788   .0299448     3.23   0.001      .038088    .1554696
                 bfi10_agree |   .3094504    .035304     8.77   0.000     .2402559    .3786449
                 bfi10_neuro |  -.1364359   .0287281    -4.75   0.000    -.1927418   -.0801299
                         age |   .0313484   .0029949    10.47   0.000     .0254785    .0372184
                      gender |   .9076036   .0575142    15.78   0.000     .7948779    1.020329
               maritalstatus |   .4199228   .0593549     7.07   0.000     .3035894    .5362563
                      ch001_ |  -.1061121   .0201479    -5.27   0.000    -.1456013   -.0666228
                      health |   .8794781   .0509739    17.25   0.000     .7795711     .979385
                 incomextile |   .2980869   .0218804    13.62   0.000     .2552021    .3409716
                  unemployed |  -.5488034   .0832166    -6.59   0.000     -.711905   -.3857019
          secondaryeducation |   1.043227   .0679658    15.35   0.000     .9100161    1.176437
           tertiaryeducation |   2.397791   .0793968    30.20   0.000     2.242177    2.553406
                    cf016tot |   .1662276   .0114159    14.56   0.000     .1438528    .1886024
                         GDP |  -.0678701    .009567    -7.09   0.000     -.086621   -.0491192
                       _cons |  -8.682553   .3539683   -24.53   0.000    -9.376318   -7.988788
          -------------------+----------------------------------------------------------------
                    /lnsig2u |   2.311664    .037046                      2.239056    2.384273
          -------------------+----------------------------------------------------------------
                     sigma_u |   3.176666   .0588414                      3.063407    3.294112
                         rho |   .7541402   .0068688                      .7404307    .7673532
          ------------------------------------------------------------------------------------
          (est2 stored)
          Kind regards,
          Sophie

          Comment


          • #6
            Sophie:
            - your code for interaction code is incomplete,as it shoud have been (see examples under -help fvvarlist-):
            Code:
            c.meancountryeqi##c.bfi10_open
            ;
            - with fairest and truest model I meant what the model that accounts for all predictors considered in the literature of your research field for the topic you're studying;
            - while imposing clustered standard errors is manadatory if you go pooled -logit- (as you did in your first example), clustered standard errors in -xtlogit- make sense if you detected/suspected heteroskedasticity and/or autocorrelation in your dataset. Otherwise, you can stay with default standard errors.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Thanks a lot, this is probably very basic stuff but helps a lot. The fairest model is:
              xtlogit smp bfi10_open bfi10_consc bfi10_extra bfi10_agree bfi10_neuro age i.gender i.maritalstatus ch001_ i.health incomextile i.unemployed i.secondaryeducation i.tertiaryeducation cf016tot GDP, re
              or with the interaction variable (that hasnt been done before in this way):
              xtlogit smp bfi10_open bfi10_consc bfi10_extra bfi10_agree bfi10_neuro age i.gender i.maritalstatus ch001_ i.health incomextile i.unemployed i.secondaryeducation i.tertiaryeducation cf016tot GDP meancountrynormeqi, re

              Comment


              • #8
                Is there anything else I need to do? In order to have same datasets?

                Comment


                • #9
                  Sophie:
                  what do you mean by
                  In order to have same datasets?
                  As an aside, I recommend you to discuss with your supervisor any choice related to regression model (that I assume is one of the pivotal parts of your master thesis).
                  Kind regards,
                  Carlo
                  (Stata 19.0)

                  Comment


                  • #10
                    Just a side note: using margins followed by marginsplot will give you an insightful display of the influence concerning interaction terms.
                    Best regards,

                    Marcos

                    Comment


                    • #11
                      thanks for all the help. I'd like to ask one more question. This is my stata output:
                      Code:
                      . eststo: xtlogit smp bfi10_open bfi10_consc bfi10_extra bfi10_agree bfi10_neuro meancountryno
                      > rmeqi age i.gender i.maritalstatus ch001_ i.health incomextile i.unemployed i.secondaryeduca
                      > tion i.tertiaryeducation cf016tot GDP, re
                      
                      Fitting comparison model:
                      
                      Iteration 0:   log likelihood = -31348.683  
                      Iteration 1:   log likelihood = -26606.692  
                      Iteration 2:   log likelihood = -26172.303  
                      Iteration 3:   log likelihood = -26169.621  
                      Iteration 4:   log likelihood =  -26169.62  
                      
                      Fitting full model:
                      
                      tau =  0.0     log likelihood =  -26169.62
                      tau =  0.1     log likelihood =  -25824.26
                      tau =  0.2     log likelihood = -25475.721
                      tau =  0.3     log likelihood =  -25129.63
                      tau =  0.4     log likelihood = -24794.768
                      tau =  0.5     log likelihood = -24485.659
                      tau =  0.6     log likelihood = -24228.504
                      tau =  0.7     log likelihood = -24076.658
                      tau =  0.8     log likelihood = -24159.875
                      
                      Iteration 0:   log likelihood = -24076.626  
                      Iteration 1:   log likelihood = -22851.827  
                      Iteration 2:   log likelihood = -22762.731  
                      Iteration 3:   log likelihood = -22757.576  
                      Iteration 4:   log likelihood = -22757.576  (backed up)
                      Iteration 5:   log likelihood = -22757.146  
                      Iteration 6:   log likelihood = -22757.145  
                      
                      Random-effects logistic regression              Number of obs     =     61,215
                      Group variable: mergeidnew                      Number of groups  =     30,286
                      
                      Random effects u_i ~ Gaussian                   Obs per group:
                                                                                    min =          1
                                                                                    avg =        2.0
                                                                                    max =          4
                      
                      Integration method: mvaghermite                 Integration pts.  =         12
                      
                                                                      Wald chi2(17)     =    3207.56
                      Log likelihood  = -22757.145                    Prob > chi2       =     0.0000
                      
                      --------------------------------------------------------------------------------------
                                       smp |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                      ---------------------+----------------------------------------------------------------
                                bfi10_open |  -.0708362   .0279704    -2.53   0.011    -.1256573   -.0160151
                               bfi10_consc |  -.1498915   .0345134    -4.34   0.000    -.2175366   -.0822465
                               bfi10_extra |  -.0649633   .0296218    -2.19   0.028    -.1230209   -.0069057
                               bfi10_agree |   .1223087   .0343919     3.56   0.000     .0549018    .1897156
                               bfi10_neuro |  -.0247047     .02828    -0.87   0.382    -.0801324    .0307231
                        meancountrynormeqi |   .0893142   .0022403    39.87   0.000     .0849233    .0937051
                                       age |   .0255978   .0030169     8.48   0.000     .0196849    .0315108
                                  1.gender |   .7921669   .0577119    13.73   0.000     .6790537      .90528
                           1.maritalstatus |   .5010448    .059325     8.45   0.000     .3847699    .6173198
                                    ch001_ |  -.1561766   .0206171    -7.58   0.000    -.1965853   -.1157679
                                  1.health |   .7423534   .0504947    14.70   0.000     .6433856    .8413213
                               incomextile |   .3880567   .0222795    17.42   0.000     .3443897    .4317237
                              1.unemployed |   -.423053   .0814924    -5.19   0.000    -.5827752   -.2633308
                      1.secondaryeducation |   .5111052   .0682887     7.48   0.000     .3772618    .6449487
                       1.tertiaryeducation |   1.500836   .0759614    19.76   0.000     1.351954    1.649717
                                  cf016tot |   .1096531   .0114142     9.61   0.000     .0872816    .1320246
                                       GDP |  -.0411016   .0104534    -3.93   0.000    -.0615899   -.0206134
                                     _cons |  -12.38511   .3818587   -32.43   0.000    -13.13354   -11.63668
                      ---------------------+----------------------------------------------------------------
                                  /lnsig2u |   2.181268   .0352956                      2.112089    2.250446
                      ---------------------+----------------------------------------------------------------
                                   sigma_u |    2.97616   .0525227                      2.874977    3.080903
                                       rho |   .7291709   .0069702                      .7152951    .7426138
                      --------------------------------------------------------------------------------------
                      LR test of rho=0: chibar2(01) = 6824.95                Prob >= chibar2 = 0.000
                      (est1 stored)
                      
                      .
                      . eststo: xtlogit smp bfi10_open bfi10_consc bfi10_agree bfi10_neuro c.meancountrynormeqi##c.b
                      > fi10_extra age i.gender i.maritalstatus ch001_ i.health incomextile i.unemployed i.secondary
                      > education i.tertiaryeducation cf016tot GDP, re
                      
                      Fitting comparison model:
                      
                      Iteration 0:   log likelihood = -31348.683  
                      Iteration 1:   log likelihood = -26587.059  
                      Iteration 2:   log likelihood = -26148.257  
                      Iteration 3:   log likelihood = -26145.465  
                      Iteration 4:   log likelihood = -26145.464  
                      
                      Fitting full model:
                      
                      tau =  0.0     log likelihood = -26145.464
                      tau =  0.1     log likelihood = -25800.877
                      tau =  0.2     log likelihood =  -25453.19
                      tau =  0.3     log likelihood = -25108.059
                      tau =  0.4     log likelihood = -24774.289
                      tau =  0.5     log likelihood = -24466.424
                      tau =  0.6     log likelihood = -24210.678
                      tau =  0.7     log likelihood = -24060.411
                      tau =  0.8     log likelihood = -24145.432
                      
                      Iteration 0:   log likelihood = -24060.395  
                      Iteration 1:   log likelihood = -22835.042  
                      Iteration 2:   log likelihood = -22748.502  
                      Iteration 3:   log likelihood = -22743.408  
                      Iteration 4:   log likelihood = -22743.408  (backed up)
                      Iteration 5:   log likelihood =  -22742.99  
                      Iteration 6:   log likelihood =  -22742.99  
                      
                      Random-effects logistic regression              Number of obs     =     61,215
                      Group variable: mergeidnew                      Number of groups  =     30,286
                      
                      Random effects u_i ~ Gaussian                   Obs per group:
                                                                                    min =          1
                                                                                    avg =        2.0
                                                                                    max =          4
                      
                      Integration method: mvaghermite                 Integration pts.  =         12
                      
                                                                      Wald chi2(18)     =    3214.16
                      Log likelihood  =  -22742.99                    Prob > chi2       =     0.0000
                      
                      ---------------------------------------------------------------------------------------
                                        smp |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                      ----------------------+----------------------------------------------------------------
                                 bfi10_open |  -.0654562   .0279893    -2.34   0.019    -.1203143   -.0105981
                                bfi10_consc |  -.1466294   .0344997    -4.25   0.000    -.2142475   -.0790112
                                bfi10_agree |   .1149852   .0343945     3.34   0.001     .0475733    .1823972
                                bfi10_neuro |  -.0179483   .0283008    -0.63   0.526    -.0734169    .0375203
                         meancountrynormeqi |   .0531095   .0070284     7.56   0.000     .0393341    .0668849
                                bfi10_extra |  -.7557818   .1326727    -5.70   0.000    -1.015815   -.4957481
                                            |
                       c.meancountrynormeqi#|
                              c.bfi10_extra |   .0103843    .001943     5.34   0.000     .0065761    .0141926
                                            |
                                        age |   .0256358    .003016     8.50   0.000     .0197245    .0315471
                                   1.gender |   .7941819     .05769    13.77   0.000     .6811115    .9072523
                            1.maritalstatus |   .4976177   .0593004     8.39   0.000     .3813912    .6138443
                                     ch001_ |  -.1564929   .0206128    -7.59   0.000    -.1968932   -.1160926
                                   1.health |   .7386956   .0504871    14.63   0.000     .6397428    .8376484
                                incomextile |     .38772    .022277    17.40   0.000     .3440579    .4313822
                               1.unemployed |  -.4170344   .0814684    -5.12   0.000    -.5767096   -.2573592
                       1.secondaryeducation |   .5075014     .06827     7.43   0.000     .3736945    .6413082
                        1.tertiaryeducation |    1.49563   .0759425    19.69   0.000     1.346785    1.644474
                                   cf016tot |    .110062   .0114133     9.64   0.000     .0876923    .1324316
                                        GDP |  -.0394278   .0104552    -3.77   0.000    -.0599197   -.0189359
                                      _cons |  -10.01745   .5752783   -17.41   0.000    -11.14497   -8.889921
                      ----------------------+----------------------------------------------------------------
                                   /lnsig2u |   2.178962   .0353249                      2.109727    2.248198
                      ----------------------+----------------------------------------------------------------
                                    sigma_u |   2.972731   .0525057                      2.871583    3.077442
                                        rho |   .7287154   .0069834                      .7148137    .7421839
                      ---------------------------------------------------------------------------------------
                      LR test of rho=0: chibar2(01) = 6804.95                Prob >= chibar2 = 0.000
                      (est2 stored)
                      Can someone help me interpreting the interaction term? And as an additional question: can and when yes how do I interpret the interaction term when the independent variable is not significant? For example, if bfi10_erxtra is not significant in model 2.

                      Thank you a lot and kind regards,
                      Sophie

                      Comment

                      Working...
                      X