Announcement

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

  • introducing fixed effetcs into the regression- issue with data?

    Dear Community

    Dear Joao Santos Silva

    I regressed bilateral trade between the two countries on their GDP and exchange rate. I have my data quarterly. To check if everything is ok with my data I added time-fixed effects. Stata didn't omit the exchange rate. I was sure I made a mistake when preparing data. I started from scratch, but the result is the same. I assumed that there is multicollinearity between exchange rate and time fixed effects. Therefore after adding time fixed effects Stata should drop exchange rate. Am I correct and should look at the data to find my mistake?

  • #2
    Dear Guest,

    Can you please post exactly the command you used and (if possible) the results?

    Best wishes,

    Joao
    Last edited by sladmin; 28 Aug 2023, 08:30. Reason: anonymize original poster

    Comment


    • #3
      In the beginning, I want to mention that I know I might consider ppml. This regression was only the test. I used a command:

      Code:
      reg trade GDP_USA GDP_E USD_EUR i.time if flow=="export"

      The results are as follows:

      Code:
      . reg trade GDP_USA GDP_DE USD_EUR i.time if flow=="export"
      note: 249.time omitted because of collinearity.
      note: 250.time omitted because of collinearity.
      note: 251.time omitted because of collinearity.
      
            Source |       SS           df       MS      Number of obs   =     8,910
      -------------+----------------------------------   F(91, 8818)     =      1.13
             Model |  3.2802e+13        91  3.6046e+11   Prob > F        =    0.1923
          Residual |  2.8192e+15     8,818  3.1971e+11   R-squared       =    0.0115
      -------------+----------------------------------   Adj R-squared   =    0.0013
             Total |  2.8520e+15     8,909  3.2012e+11   Root MSE        =    5.7e+05
      
      ------------------------------------------------------------------------------
             trade | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
      -------------+----------------------------------------------------------------
           GDP_USA |   9.210681   242.1453     0.04   0.970    -465.4506    483.8719
            GDP_DE |   .2612964   8.449234     0.03   0.975    -16.30117    16.82376
           USD_EUR |   537245.9    1465499     0.37   0.714     -2335474     3409966
                   |
              time |
              161  |  -30539.35   129293.4    -0.24   0.813    -283984.5    222905.8
              162  |  -40825.79   175058.5    -0.23   0.816    -383981.3    302329.7
              163  |   -57637.3   252519.2    -0.23   0.819    -552633.8    437359.1
              164  |  -27697.36     129952    -0.21   0.831    -282433.5    227038.8
              165  |  -59691.88   212224.6    -0.28   0.779    -475701.5    356317.7
              166  |  -46206.02   177212.2    -0.26   0.794    -393583.3    301171.2
              167  |  -56440.83   168660.9    -0.33   0.738    -387055.5    274173.8
              168  |  -71477.73   208449.5    -0.34   0.732    -480087.3    337131.8
              169  |   -39014.9   146971.1    -0.27   0.791    -327112.4    249082.6
              170  |   8453.732   80420.86     0.11   0.916    -149189.9    166097.4
              171  |   516.4518   79603.26     0.01   0.995    -155524.5    156557.4
              172  |   32671.26   138639.3     0.24   0.814    -239094.1    304436.7
              173  |   59001.44   198871.7     0.30   0.767    -330833.4    448836.3
              174  |   59198.71   189327.2     0.31   0.755    -311926.8    430324.2
              175  |   65929.37   252933.9     0.26   0.794    -429880.1    561738.8
              176  |   99272.45   306330.1     0.32   0.746      -501206    699750.9
              177  |   89770.18   268922.3     0.33   0.739    -437380.2    616920.6
              178  |   90448.73   301225.3     0.30   0.764    -500023.1    680920.6
              179  |   113650.8   374187.2     0.30   0.761    -619843.3    847144.9
              180  |   114795.1   405111.2     0.28   0.777    -679317.3    908907.6
              181  |   100597.6   382688.4     0.26   0.793      -649561    850756.1
              182  |   86793.15   370730.7     0.23   0.815    -639925.5    813511.8
              183  |   82524.81   368027.8     0.22   0.823    -638895.5    803945.1
              184  |    87142.1   393596.1     0.22   0.825      -684398    858682.2
              185  |   93293.68   369688.7     0.25   0.801    -631382.2    817969.6
              186  |   108704.5   371946.8     0.29   0.770    -620397.9      837807
              187  |   120880.4   354212.6     0.34   0.733    -573458.9    815219.7
              188  |   105849.3   365510.2     0.29   0.772      -610636    822334.5
              189  |   110040.9   383516.3     0.29   0.774    -641740.4    861822.2
              190  |   121457.8   398771.1     0.30   0.761    -660226.5    903142.2
              191  |   131925.3   441971.3     0.30   0.765    -734441.4    998291.9
              192  |     148763     469157     0.32   0.751    -770894.1     1068420
              193  |   162068.9   507578.8     0.32   0.750    -832903.8     1157042
              194  |   151377.9   476482.3     0.32   0.751    -782638.5     1085394
              195  |   94438.86   360546.9     0.26   0.793    -612317.1    801194.9
              196  |   88437.22   442467.5     0.20   0.842    -778902.2    955776.6
              197  |   104200.6   446907.7     0.23   0.816    -771842.7    980243.9
              198  |   115564.9   464085.1     0.25   0.803      -794150     1025280
              199  |   131279.1   486328.4     0.27   0.787      -822038     1084596
              200  |   102362.6   429044.8     0.24   0.811    -738665.1    943390.3
              201  |   71796.68   345862.7     0.21   0.836    -606174.8    749768.2
              202  |   81108.15   340354.7     0.24   0.812    -586066.3    748282.6
              203  |   96139.55   379357.5     0.25   0.800    -647489.5    839768.6
              204  |    97279.1   378883.2     0.26   0.797    -645420.2    839978.4
              205  |   121114.5   428110.7     0.28   0.777    -718082.2    960311.3
              206  |   115032.5   413018.2     0.28   0.781    -694579.3    924644.4
              207  |   101666.1   362003.9     0.28   0.779    -607945.8    811278.1
              208  |   102637.7   335054.4     0.31   0.759    -554146.9    759422.3
              209  |   84186.61   313240.4     0.27   0.788    -529837.5    698210.7
              210  |   84090.75   283946.5     0.30   0.767    -472510.5      640692
              211  |    84251.3   322332.1     0.26   0.794    -547594.7    716097.3
              212  |   96682.09   344549.9     0.28   0.779      -578716    772080.2
              213  |   85328.07   326480.7     0.26   0.794    -554650.2    725306.4
              214  |   95434.82   340192.1     0.28   0.779    -571421.1    762290.7
              215  |   113039.9   367274.5     0.31   0.758    -606903.7    832983.5
              216  |   103353.2   386197.7     0.27   0.789    -653684.2    860390.7
              217  |   101372.6     376871     0.27   0.788    -637382.4    840127.7
              218  |   108386.8   337483.9     0.32   0.748    -553160.3      769934
              219  |   74495.15   276630.8     0.27   0.788    -467765.8    616756.1
              220  |   40454.12   158455.7     0.26   0.798    -270155.9    351064.1
              221  |   33159.96     137617     0.24   0.810    -236601.5    302921.4
              222  |   36720.24   145324.1     0.25   0.801      -248149    321589.4
              223  |   22743.34   137627.8     0.17   0.869    -247039.3      292526
              224  |   22731.36   180463.9     0.13   0.900    -331019.9    376482.6
              225  |   23022.55   210032.6     0.11   0.913    -388690.3    434735.4
              226  |   13703.19     188705     0.07   0.942    -356202.6      383609
              227  |   1749.909   155481.7     0.01   0.991    -303030.5    306530.3
              228  |   19122.85   187354.9     0.10   0.919    -348136.4    386382.1
              229  |   8763.371   264604.2     0.03   0.974    -509922.5    527449.2
              230  |    38194.4   343216.7     0.11   0.911    -634590.2      710979
              231  |   46324.82     354682     0.13   0.896    -648934.6    741584.2
              232  |   68704.33   339507.3     0.20   0.840    -596809.1    734217.8
              233  |   42454.71   313396.7     0.14   0.892    -571875.9    656785.3
              234  |   33192.81     245765     0.14   0.893    -448563.9    514949.5
              235  |   20966.79   280198.5     0.07   0.940    -528287.5    570221.1
              236  |   23547.96   286585.6     0.08   0.935    -538226.6    585322.6
              237  |   15815.88   248812.7     0.06   0.949      -471915    503546.8
              238  |      24152   245128.3     0.10   0.922    -456356.6    504660.6
              239  |   20509.74   254235.3     0.08   0.936    -477850.8    518870.2
              240  |   12823.56     235993     0.05   0.957    -449777.7    475424.9
              241  |  -15441.79     130245    -0.12   0.906    -270752.4    239868.8
              242  |   24865.58   229722.2     0.11   0.914    -425443.5    475174.7
              243  |   47406.11   265213.4     0.18   0.858    -472473.9    567286.1
              244  |   51078.77   220211.9     0.23   0.817    -380587.9    482745.4
              245  |   44233.59   217850.2     0.20   0.839    -382803.6    471270.8
              246  |   38432.36   203163.9     0.19   0.850    -359816.1    436680.9
              247  |   21693.83   157446.5     0.14   0.890      -286938    330325.7
              248  |   17479.66   137136.2     0.13   0.899    -251339.3    286298.6
              249  |          0  (omitted)
              250  |          0  (omitted)
              251  |          0  (omitted)
                   |
             _cons |    -677017    2127317    -0.32   0.750     -4847054     3493020
      ------------------------------------------------------------------------------
      I was surprised that Stata didn't dropped exchange rate after adding time fixed effects since my data is quarterly.

      Comment


      • #4
        Dear Guest,

        The exchange rate does not drop possibly because some time effects are dropped. Indeed, I suggest you use PPML and the command ppmlhdfe, which will keep the fixed effects and drop variables that are collinear with them.

        Best wishes,

        Joao
        Last edited by sladmin; 28 Aug 2023, 08:31. Reason: anonymize original poster

        Comment


        • #5
          Thank you Professor Silva! I will follow your advice

          Comment

          Working...
          X