Announcement

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

  • Time series analysis to panel data(?!?!?)

    Hi,

    I have a dataset, which spans 25 years. I want to analyze which factors lead to immigration into Germany. Therefore my dependent variable is the absolute number of immigrants coming to Germany. For further analysis I also got the number of immigrants of each continent in each year, so I can check for differences between immigrants coming from different regions of the world.

    If I now perform regressions (first for the total, than for each continent) I of course get a very low N.

    My question now:
    Can I treat each Continent as it would be an extra oberservation?
    Thus my sample would look like:

    Region of Immigrants Year Immigrants IV1 IV2 IV3
    Europe 1991 100 2 3 6
    Europe 1992 98 4 5 8
    Asia 1991 20 2 3 6
    Asia 1992 18 4 5 8
    America 1991 25 2 3 6
    America 1992 27 4 5 8

    The numbers are made up now, but the IVs would stay of course for each region and year the same, as I just change as DV the region and do not change the IVs (they have to be the same as Germany is the region they immigrate to).

    Thanks for your help!
    Kind regards,
    Konstantin
    That is what my data now looks like....

  • #2
    I just did it and it totally washes out any significance....which is natural given the same values for each of the IVs.


    Could you think of any other possibility in order to enhance my analysis with the given data set?

    Attached Files

    Comment


    • #3
      Konstantin:
      please post attachments in Stata format only. Thanks.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        Of course...here they are...
        Attached Files

        Comment


        • #5
          Konstantin:
          I've considered only 3 variables of your dataset: Jahr; Europa; Afrika.
          I have copied and pasted them on an empty .dta files an delete all the missing values with the following code:

          Code:
          drop if _n>24
          Then I've run the following code, which sholuld be tweaked for including more countried from which immigrants come into Germany.
          Due to the limited number of continents (Europa and Afrika) i did not cluster the standard errors but I would take this option into account if I include more continents in my regression.
          Eventually, I've performed both -regress- and -xtreg, fe-.

          Code:
          . expand 2
          (24 observations created)
          
          . g Immigrants= Europa in 1/24
          (24 missing values generated)
          
          . replace Immigrants= Afrika if Immigrants==.
          (24 real changes made)
          
          . g Country_Abroad=0 in 1/24
          (24 missing values generated)
          
          . replace Country_Abroad=1 if Country_Abroad==.
          (24 real changes made)
          
          . label define Country_Abroad 0 Europe 1 Afrika
          
          . label val Country_Abroad
          
          . label val Country_Abroad Country_Abroad
          
          . drop Europe Afrika
          
          . sort Jahr
          
          . reg Imm i.Country_Abroad i.Jahr
          
                Source |       SS       df       MS              Number of obs =      48
          -------------+------------------------------           F( 24,    23) =   11.69
                 Model |  5.7483e+12    24  2.3951e+11           Prob > F      =  0.0000
              Residual |  4.7105e+11    23  2.0481e+10           R-squared     =  0.9243
          -------------+------------------------------           Adj R-squared =  0.8452
                 Total |  6.2194e+12    47  1.3233e+11           Root MSE      =  1.4e+05
          
          --------------------------------------------------------------------------------
                     Imm |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          ---------------+----------------------------------------------------------------
          Country_Abroad |
                 Afrika  |  -655129.4   41312.45   -15.86   0.000    -740590.7   -569668.1
                         |
                    Jahr |
                   1992  |   128969.5   143110.5     0.90   0.377    -167077.2    425016.2
                   1993  |    10445.5   143110.5     0.07   0.942    -285601.2    306492.2
                   1994  |     -96717   143110.5    -0.68   0.506    -392763.7    199329.7
                   1995  |   -92631.5   143110.5    -0.65   0.524    -388678.2    203415.2
                   1996  |  -153497.5   143110.5    -1.07   0.295    -449544.2    142549.2
                   1997  |    -224046   143110.5    -1.57   0.131    -520092.7    72000.67
                   1998  |    -226631   143110.5    -1.58   0.127    -522677.7    69415.67
                   1999  |  -196852.5   143110.5    -1.38   0.182    -492899.2    99194.17
                   2000  |    -218598   143110.5    -1.53   0.140    -514644.7    77448.67
                   2001  |    -208064   143110.5    -1.45   0.159    -504110.7    87982.67
                   2002  |    -216123   143110.5    -1.51   0.145    -512169.7    79923.67
                   2003  |    -241212   143110.5    -1.69   0.105    -537258.7    54834.67
                   2004  |  -238156.5   143110.5    -1.66   0.110    -534203.2    57890.17
                   2005  |    -250443   143110.5    -1.75   0.093    -546489.7    45603.67
                   2006  |  -266631.5   143110.5    -1.86   0.075    -562678.2    29415.17
                   2007  |    -256081   143110.5    -1.79   0.087    -552127.7    39965.67
                   2008  |    -259225   143110.5    -1.81   0.083    -555271.7    36821.67
                   2009  |  -247642.5   143110.5    -1.73   0.097    -543689.2    48404.17
                   2010  |  -211427.5   143110.5    -1.48   0.153    -507474.2    84619.17
                   2011  |    -140511   143110.5    -0.98   0.336    -436557.7    155535.7
                   2012  |   -83065.5   143110.5    -0.58   0.567    -379112.2    212981.2
                   2013  |   -21929.5   143110.5    -0.15   0.880    -317976.2    274117.2
                   2014  |    58918.5   143110.5     0.41   0.684    -237128.2    354965.2
                         |
                   _cons |   846880.2   103281.1     8.20   0.000     633226.9     1060533
          --------------------------------------------------------------------------------
          
          . xtset Country_Abroad Jahr
                 panel variable:  Country_Abroad (strongly balanced)
                  time variable:  Jahr, 1991 to 2014
                          delta:  1 unit
          
          . xtreg Imm i.Jahr, fe
          
          Fixed-effects (within) regression               Number of obs      =        48
          Group variable: Country_Ab~d                    Number of groups   =         2
          
          R-sq:  within  = 0.5594                         Obs per group: min =        24
                 between =      .                                        avg =      24.0
                 overall = 0.0961                                        max =        24
          
                                                          F(23,23)           =      1.27
          corr(u_i, Xb)  = 0.0000                         Prob > F           =    0.2859
          
          ------------------------------------------------------------------------------
                   Imm |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                  Jahr |
                 1992  |   128969.5   143110.5     0.90   0.377    -167077.2    425016.2
                 1993  |    10445.5   143110.5     0.07   0.942    -285601.2    306492.2
                 1994  |     -96717   143110.5    -0.68   0.506    -392763.7    199329.7
                 1995  |   -92631.5   143110.5    -0.65   0.524    -388678.2    203415.2
                 1996  |  -153497.5   143110.5    -1.07   0.295    -449544.2    142549.2
                 1997  |    -224046   143110.5    -1.57   0.131    -520092.7    72000.67
                 1998  |    -226631   143110.5    -1.58   0.127    -522677.7    69415.67
                 1999  |  -196852.5   143110.5    -1.38   0.182    -492899.2    99194.17
                 2000  |    -218598   143110.5    -1.53   0.140    -514644.7    77448.67
                 2001  |    -208064   143110.5    -1.45   0.159    -504110.7    87982.67
                 2002  |    -216123   143110.5    -1.51   0.145    -512169.7    79923.67
                 2003  |    -241212   143110.5    -1.69   0.105    -537258.7    54834.67
                 2004  |  -238156.5   143110.5    -1.66   0.110    -534203.2    57890.17
                 2005  |    -250443   143110.5    -1.75   0.093    -546489.7    45603.67
                 2006  |  -266631.5   143110.5    -1.86   0.075    -562678.2    29415.17
                 2007  |    -256081   143110.5    -1.79   0.087    -552127.7    39965.67
                 2008  |    -259225   143110.5    -1.81   0.083    -555271.7    36821.67
                 2009  |  -247642.5   143110.5    -1.73   0.097    -543689.2    48404.17
                 2010  |  -211427.5   143110.5    -1.48   0.153    -507474.2    84619.17
                 2011  |    -140511   143110.5    -0.98   0.336    -436557.7    155535.7
                 2012  |   -83065.5   143110.5    -0.58   0.567    -379112.2    212981.2
                 2013  |   -21929.5   143110.5    -0.15   0.880    -317976.2    274117.2
                 2014  |    58918.5   143110.5     0.41   0.684    -237128.2    354965.2
                       |
                 _cons |   519315.5   101194.4     5.13   0.000     309978.9    728652.1
          -------------+----------------------------------------------------------------
               sigma_u |  463246.45
               sigma_e |  143110.52
                   rho |   .9128773   (fraction of variance due to u_i)
          ------------------------------------------------------------------------------
          F test that all u_i=0:     F(1, 23) =   251.47               Prob > F = 0.0000
          
          .
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Thanks a lot for your help....but my problem is more that all other variables stay the same for the years....
            My interest is to see whether immigrants of other continents react differently to the same pull-factors...

            Lets say: Unemployment is 9,5% in Germany in 2013. How will that affect Immigration of each continent? Thus my dependent variable is immigration of each continent in Year 2013, while the independent variable ist the same for every observation.

            It would look like this:

            Year Region Immigrants into Germany Unemployment in Germany
            2013 Europe 100.000 9.5
            2013 Africa 20.000 9.5
            2013 Asia 50.000 9.5
            2013 America 10.000 9.5
            2013 Rest of World 10.000 9.5
            2012 Europe 120.000 9.0
            2012 Africa 30.000 9.0
            2012 Asia 40.000 9.0
            2012 America 20.000 9.0
            2012 Rest of World 20.000 9.0


            And this does not function at all. Again those numbers are made up, not real.

            Am I right or does it make any sense to convert the data set like you did?

            Comment


            • #7
              Konstantin:
              regardless the number of predictors, if you have more depvars you may want to take a look at -mvreg- or -manova-.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment

              Working...
              X