Announcement

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

  • Times series regression

    Hello, I'm running time series OLS regression. I have one DV measured at one time period (1970-2000) and 5-6 IVs and covariates measured at a different time period (1950-2000). I was wondering if it is ok to run the regression with variables measured at different time periods? Thank you for any help you can give.

  • #2
    Brian:
    welcome to this forum.
    Due to listwise deletion, the -e(sample)- will consider 1970-2022 timespan.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Thank you very much Carlo (and for the reply).
      I have one other question: I have one IV measuring an event that took place in the mid 1960s and coded it as dummy (1 in 1961-64, 0 otherwise). I have a second IV (also a dummy) measuring a different event that is coded 1 in some years in the 1950s, 60s, 80s and 90s and 0 otherwise. I have a third IV (also a dummy) which is coded 1 for some years in the 2000s and 0 otherwise. Since the DV only begins in 1970, I am correct in assuming that the first IV should not be included in the model (as it took place before the DV data begin) but that it is ok to include the second IV (which measures an event that took place before and after 1970) and third IV (which measures an event that took place after 1970) in the model?
      Kind regards, Brian

      Comment


      • #4
        Brian:
        as a general rule, due to listwise deletion if any of your observations has any missing values, it will be ruled out from -e(sample). Therefore, you should have missing values (not zeros) for your regressand for 1950 to 1970 timespan.
        If I'm right in guessing what above, you should not do anything, as Stata will omit those observations for you.
        Last but not least, should me reply be not that helpful, please share an example/excerpt of your dataset via -dataex-, as recommended by the FAQ. Thanks.
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          Carlo: below is excerpt from the dataset. I wasn't sure what you meant: should I omit the first IV and just include the other IVs? Kinds regards


          input float(year recruitment departures visit economy departuretrainee) byte(1960s1 1960s2 visit1 visit2) float text byte(text1 text2) float(notext gdppc perpop perrpop politics incident incident1 incident2 leadership1 leadership2 leadership lgdppc)
          1950 .020292 . 0 0 1070 . 1 0 1 0 0 1 0 1 1.623 90.32701 83.12701 .346 0 1 0 1 0 0 .4842763
          1951 .024186995 . 0 0 1151 . 1 0 1 0 0 1 0 1 1.68 90.24117 83.24117 .348 0 1 0 1 0 0 .51879376
          1952 .02642295 . 0 0 1186 . 1 0 1 0 0 1 0 1 1.744 90.15314 83.35314 .348 0 1 0 1 0 0 .5561813
          1953 .031700928 . 0 0 1254 . 1 0 1 0 0 1 0 1 1.835 90.06232 83.46231 .351 0 1 0 1 0 0 .6070445
          1954 .0391764 . 0 0 1308 . 1 0 1 0 0 1 0 1 1.911 89.96802 83.56802 .37 0 1 0 1 0 0 .6476267
          1955 .034712106 . 0 0 1358 . 1 0 1 0 0 1 0 1 1.994 89.86952 83.66953 .379 0 1 0 1 0 0 .6901426
          1956 .04825608 . 0 0 1410 . 1 0 1 0 0 1 0 1 2.046 89.76524 83.76524 .379 0 1 0 0 1 1 .7158867
          1957 .0299362 . 0 0 1442 . 1 0 1 0 0 1 0 1 2.102 89.65493 83.85493 .38 0 1 0 1 0 0 .7428893
          1958 .032238986 . 0 0 1448 . 1 0 1 0 0 1 0 1 2.132 89.53635 83.93635 .386 0 1 0 1 0 0 .7570605
          1959 .04300926 . 0 0 1501 . 1 0 1 0 0 1 0 1 2.208 89.40922 84.00922 .386 0 1 0 0 1 1 .7920871
          1960 .03766916 . 0 0 1476 . 1 0 1 0 0 1 0 1 2.231 89.27186 84.07185 .408 0 1 0 1 0 0 .8024499
          1961 .04978413 . 0 0 1512 . 1 0 1 0 0 1 0 1 2.268 88.65874 83.59134 .405 0 1 0 1 0 0 .8188983
          1962 .04122373 . 0 1 1537 . 0 1 1 0 0 1 0 1 2.321 88.04723 83.11243 .401 0 1 0 1 0 0 .8419982
          1963 .04885098 . 0 1 1595 . 0 1 1 0 0 1 0 1 2.374 87.39717 82.59499 .401 0 1 0 1 0 0 .8645763
          1964 .05103647 . 0 1 1600 . 0 1 1 0 0 1 0 1 2.382 86.78252 82.11294 .401 0 1 0 1 0 0 .8679405
          1965 .04390197 . 0 1 1633 . 0 1 1 0 0 1 0 1 2.424 86.13086 81.59388 .407 0 1 0 1 0 0 .8854191
          1966 .036723465 . 0 0 1654 . 1 0 1 0 0 1 0 1 2.452 85.46367 81.0593 .393 0 1 0 1 0 0 .896904
          1967 .034393694 . 0 0 1690 . 1 0 1 0 0 1 0 1 2.502 84.80412 80.53235 .393 0 1 0 0 1 1 .9170905
          1968 .03609395 . 0 0 1722 . 1 0 1 0 1 0 1 0 2.553 84.15143 80.01227 .395 0 1 0 1 0 0 .9372692
          1969 .036508974 12.868632 0 0 1750 98.31613 1 0 1 0 0 1 0 1 2.623 83.50498 79.49842 .389 0 1 0 0 1 1 .9643187
          1970 .029008863 7.816317 1 0 1764 104.61881 1 0 0 1 0 1 0 1 2.684 82.86427 78.99032 .358 0 1 0 0 1 1 .9873082
          1971 .01113987 4.757374 0 0 1808 91.79794 1 0 1 0 0 1 0 1 2.745 82.68432 78.87305 .332 0 1 0 1 0 0 1.009781
          1972 .021226043 9.407338 0 0 1853 104.80124 1 0 1 0 0 1 0 1 2.833 82.80954 79.06094 .142 0 1 0 0 1 1 1.0413362
          1973 .02045302 7.910656 0 0 1964 93.15492 1 0 1 0 0 1 0 1 2.962 82.93926 79.25334 .078 0 1 0 0 1 1 1.0858647
          1974 .032803357 5.560704 0 0 1979 110.43233 1 0 1 0 0 1 0 1 3.026 83.07283 79.44958 .077 0 1 0 0 1 1 1.1072416
          1975 .03625731 7.602862 0 0 2033 115.0722 1 0 1 0 0 1 0 1 3.125 83.2096 79.64903 .077 0 1 0 0 1 1 1.13




          Comment


          • #6
            Brian:
            you can leave things as they are.
            Stata will omit observations with any missing value by default.
            Kind regards,
            Carlo
            (StataNow 18.5)

            Comment


            • #7
              Carlo: I ran the regression and stata did drop the 1960s variable. It mentioned in a note that the variable was "omitted because of collinearity" and in the reg table its coefficient was 0 and (omitted) was in the SE column. Is this how listwise deletion is normally reported? Kind regards

              Comment


              • #8
                Brian:
                no it is not.
                1) Toy-example with missing observations in -rep78- (-regress- use 69 instead of theoretical 74 observations):
                Code:
                . sum price rep78 foreign
                
                    Variable |        Obs        Mean    Std. dev.       Min        Max
                -------------+---------------------------------------------------------
                       price |         74    6165.257    2949.496       3291      15906
                       rep78 |         69    3.405797    .9899323          1          5
                     foreign |         74    .2972973    .4601885          0          1
                
                     . regress price i.rep78 i.foreign
                
                      Source |       SS           df       MS      Number of obs   =        69
                -------------+----------------------------------   F(5, 63)        =      0.19
                       Model |  8372481.37         5  1674496.27   Prob > F        =    0.9670
                    Residual |   568424478        63  9022610.75   R-squared       =    0.0145
                -------------+----------------------------------   Adj R-squared   =   -0.0637
                       Total |   576796959        68  8482308.22   Root MSE        =    3003.8
                
                ------------------------------------------------------------------------------
                       price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
                -------------+----------------------------------------------------------------
                       rep78 |
                          2  |   1403.125   2374.686     0.59   0.557    -3342.306    6148.556
                          3  |   1861.058   2195.967     0.85   0.400    -2527.232    6249.347
                          4  |   1488.621   2295.176     0.65   0.519    -3097.921    6075.164
                          5  |   1318.426   2452.565     0.54   0.593    -3582.634    6219.485
                             |
                     foreign |
                    Foreign  |    36.7572   1010.484     0.04   0.971    -1982.533    2056.048
                       _cons |     4564.5   2123.983     2.15   0.035     320.0579    8808.942
                ------------------------------------------------------------------------------
                
                .
                2) Toy-example with omission due to collinearity:
                Code:
                . gen reverse_foreign=0 if foreign==1
                
                . replace reverse_foreign=1 if foreign==0
                
                . regress price i.foreign i.rep78 i.reverse_foreign
                note: 1.reverse_foreign omitted because of collinearity.
                
                      Source |       SS           df       MS      Number of obs   =        69
                -------------+----------------------------------   F(5, 63)        =      0.19
                       Model |  8372481.37         5  1674496.27   Prob > F        =    0.9670
                    Residual |   568424478        63  9022610.75   R-squared       =    0.0145
                -------------+----------------------------------   Adj R-squared   =   -0.0637
                       Total |   576796959        68  8482308.22   Root MSE        =    3003.8
                
                -----------------------------------------------------------------------------------
                            price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
                ------------------+----------------------------------------------------------------
                          foreign |
                         Foreign  |    36.7572   1010.484     0.04   0.971    -1982.533    2056.048
                                  |
                            rep78 |
                               2  |   1403.125   2374.686     0.59   0.557    -3342.306    6148.556
                               3  |   1861.058   2195.967     0.85   0.400    -2527.232    6249.347
                               4  |   1488.621   2295.176     0.65   0.519    -3097.921    6075.164
                               5  |   1318.426   2452.565     0.54   0.593    -3582.634    6219.485
                                  |
                1.reverse_foreign |          0  (omitted)
                            _cons |     4564.5   2123.983     2.15   0.035     320.0579    8808.942
                -----------------------------------------------------------------------------------
                .
                Kind regards,
                Carlo
                (StataNow 18.5)

                Comment


                • #9
                  Carlo: I ran sum v1 v2 v3 v4 and the obs reported were 40 61 61 61. v1 is the DV. The 1960s variable (v2) is all 0 in the 1970-2010 timespan: maybe that's why there is issue with it but I'm not sure. Kind regards.

                  Comment


                  • #10
                    Brian:
                    the lowest sample size rules.
                    Therefore, Stata should have deleted 1 observations (those that have a missing value for -v1-, that is your dependent variable).
                    But what above does not explain the omission due to perfect collinearity.
                    Kind regards,
                    Carlo
                    (StataNow 18.5)

                    Comment


                    • #11
                      Carlo: I checked for multicollinearity and the VIFs seemed not to be a cause of concern (i..e, < 10) but the condition number in a couple of cases was about 300. I dropped one "offending" variable and this brought the condition number to < 20. However, dropping this variable reduces the number of controls from 2 to just 1. Is dropping the variable the best way to proceed? Thank you.

                      Comment


                      • #12
                        Brian:
                        dropping or not the "offending" control should be considered in the light of your OLS results and the way the data generating process is fairly represented in the right-hand side of your regression equation as far as the independent variables are concerned.
                        Kind regards,
                        Carlo
                        (StataNow 18.5)

                        Comment


                        • #13
                          I was wondering what I should look out for in the OLS results? Thank you

                          Comment


                          • #14
                            Brian:
                            I meant the -regress- outcome table.
                            Kind regards,
                            Carlo
                            (StataNow 18.5)

                            Comment


                            • #15
                              Carlo: I dropped the offending variable and replaced with another which reduced the condition number to 18. The regress table is:

                              x1 -6290241 (.438656)
                              x2 .0238257 (.5671192)
                              x3 1.297117 (.6985307)
                              x4 -7.484386 (6.34182)
                              x5 .0159325 (.01883)
                              _cons 4.475438 (3.413618)

                              Is condition number of 18 a concern (I've seen some mentions of 30 as threshold for concern and other mention of 100). Thank you!
                              Last edited by Brian Conway; 03 Feb 2024, 07:25.

                              Comment

                              Working...
                              X