Announcement

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

  • Lagged Independent variables in Pooled OLS

    Dear Statalist users,

    I am runningd Pooled OLS regression and I need to lag the independent variables by one period. I have used the following command (iL.Years) to do so,however I have got most of the years dummies omitted ..This this the command that I have used:

    . regress TotalIndexScore IO_Total Size SGrowth LEV CASH CAPEX MB ROA PPE ANALYST ADR ABNORMAL_RET Q DIV MSCI TURN TAX_DIV TAX_DIV Australia Belgi
    um Canada Denmark Finland France Greece India Ireland Italy Netherland Norway Spain Sweden Switzerland UK Year_2006 Year_2007 Year_2008 Year_200
    9 Year_2010 Year_2011 Year_2012 Industry_1 Industry_2 Industry_3 Industry_4 Industry_5 Industry_6 Industry_7 Industry_8 Industry_9 iL.Years, robust cluster (CountryID)

    Can you please advice me that this code at the end of the command ( iL.Years) is an appropriate code to lag the independent variables by one period? Thank you

  • #2
    Badar:
    As per your code, it seems that your data are in -wide- format. If this were the case, I would recommend you to take a look at -help reshape- and convert them into -long- format. Then, use -fvvarlist- to create year and country categorical variables.
    Eventually, as far as lagged variables are concerned, I find difficult to comment on omission without seeing what Stata gave you back after typing your code.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Dear Carlo - Thank you for your valuable comments. In fact, the variables for years and countries are dummy variables which takes a value of one or zero for all variables indicating years or country in the code. when I type the above code, I get the following results:

      TotalIndex~e Coef. Std. Err. t P>t [95% Conf. Interval]
      IO_Total 0.02274 0.0056 4.06 0.001 0.01081 0.03466
      Size 0.26655 0.23434 1.14 0.273 -0.2329 0.76602
      SGrowth -0.0051 0.00268 -1.92 0.074 -0.0109 0.00056
      LEV -0.0107 0.00716 -1.49 0.157 -0.0259 0.00459
      CASH -0.0094 0.00983 -0.95 0.355 -0.0303 0.01158
      CAPEX -0.048 0.02409 -1.99 0.065 -0.0994 0.00331
      MB -0.0018 0.00779 -0.23 0.824 -0.0184 0.01484
      ROA 0.00474 0.01302 0.36 0.721 -0.023 0.03249
      PPE 0.00735 0.00772 0.95 0.356 -0.0091 0.02381
      ANALYST 0.02295 0.01333 1.72 0.106 -0.0055 0.05137
      ADR 0.24967 0.22044 1.13 0.275 -0.2202 0.71952
      ABNORMAL_RET 0.00014 0.00028 0.5 0.626 -0.0004 0.00072
      Q -0.1366 0.11002 -1.24 0.234 -0.3711 0.09793
      DIV 0.28187 0.23453 1.2 0.248 -0.218 0.78175
      MSCI 0.33606 0.45252 0.74 0.469 -0.6285 1.30058
      TURN 2.76E-06 1.8E-05 0.15 0.882 -4E-05 4.2E-05
      TAX_DIV -0.009 0.02487 -0.36 0.721 -0.062 0.04395
      TAX_DIV 0 (omitted)
      Australia 1.24841 0.278 4.49 0 0.65588 1.84095
      Belgium -2.9039 0.45921 -6.32 0 -3.8826 -1.9251
      Canada 0.92351 0.25341 3.64 0.002 0.38338 1.46364
      Denmark -3.1342 0.36824 -8.51 0 -3.9191 -2.3493
      Finland 0.72927 0.38504 1.89 0.078 -0.0914 1.54995
      France -3.2538 0.17502 -18.59 0 -3.6268 -2.8807
      Greece -5.4859 0.56395 -9.73 0 -6.688 -4.2839
      India -5.7948 0.83262 -6.96 0 -7.5695 -4.0202
      Ireland 0.55394 0.52654 1.05 0.309 -0.5683 1.67623
      Italy -4.9957 0.49464 -10.1 0 -6.05 -3.9414
      Netherland -0.6112 0.24841 -2.46 0.026 -1.1406 -0.0817
      Norway -1.8064 0.28879 -6.26 0 -2.422 -1.1909
      Spain -2.8107 0.32322 -8.7 0 -3.4997 -2.1218
      Sweden -0.9817 0.10412 -9.43 0 -1.2036 -0.7598
      Switzerland -2.4827 0.26446 -9.39 0 -3.0464 -1.919
      UK 0 (omitted)
      Year_2006 0 (omitted)
      Year_2007 -1.2776 0.28034 -4.56 0 -1.8751 -0.6801
      Year_2008 -1.2704 0.24959 -5.09 0 -1.8024 -0.7384
      Year_2009 -0.8687 0.21096 -4.12 0.001 -1.3184 -0.4191
      Year_2010 -0.8444 0.14166 -5.96 0 -1.1463 -0.5424
      Year_2011 -0.4718 0.09565 -4.93 0 -0.6757 -0.268
      Year_2012 0 (omitted)
      Industry_1 -0.7117 0.59497 -1.2 0.25 -1.9799 0.55646
      Industry_2 -0.3551 0.64323 -0.55 0.589 -1.7261 1.01593
      Industry_3 0.06463 0.5041 0.13 0.9 -1.0098 1.13909
      Industry_4 -0.1531 0.75518 -0.2 0.842 -1.7628 1.45649
      Industry_5 -0.68 0.6025 -1.13 0.277 -1.9642 0.60417
      Industry_6 0.2271 0.51397 0.44 0.665 -0.8684 1.3226
      Industry_7 1.54479 0.76108 2.03 0.061 -0.0774 3.167
      Industry_8 -0.3313 0.62923 -0.53 0.606 -1.6724 1.00991
      Industry_9 0 (omitted)
      L.Years
      2007 0 (omitted)
      2008 0 (omitted)
      2009 0 (omitted)
      2010 0 (omitted)
      2011 0 (omitted)
      _cons 13.2514 1.85407 7.15 0 9.29957 17.2033

      Comment


      • #4
        Two remarks
        1. If you are using panel data, make sure that you have -xtset- your data.
        2. 2007 lagged is nothing else that 2006. Therefore, you are introducing the same variable twice.

        Comment


        • #5
          Thank you Eric for the valuable remarks.

          Do I have to xtset all the explanatory variables one by one before running the regression again or there is way to xtset them all in one go. Can you please give me an example of how to xtset Cash variable, for example using stata. Thank you

          Comment


          • #6
            Badar:
            as you may retrieve from -help xtset-, the usual approach is the following one:
            Code:
            xtset panelvar timevar
            .

            Hence, you do not have to -xtset- all the depvar and indepvars.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Thank you Carlo for your clarification, I have xtset the company ID and the years in my case and I have got the following output:

              . xtset CompanyID Years
              panel variable: CompanyID (unbalanced)
              time variable: Years, 2006 to 2012, but with gaps
              delta: 1 unit

              Now, after this step, do I need to create lag variable for each explanatory variable or there is code I can add to my regression like (iL.Years) to indicate that all explanatory variables are lagged by one period. Thank you

              Comment


              • #8
                I haven't been following this thread closely, so forgive me if what I say has already been covered. But as best I can figure, what you want to do is regress the outcome variable TotalIndexScore against the lagged values of all the predictor variables. If that's what you want, the syntax is:

                Code:
                xtreg TotalIndexScore L.(IO_Total Size SGrowth LEV CASH CAPEX MB ROA PPE ANALYS ...etc. )
                If you want to include year indicators, you can do so in the ordinary way as i.Years, but using iL.years does not make sense to me conceptually. In any case, if you do use iL.years, you will get the exact same results as for i.years.

                Comment


                • #9
                  Dear Clyde.. Thank you so much for your valuable comments on the lagged values which I found so useful. I have another query in this regards please. When I include years dummies in the fixed effect models, the first year (2006) and the last year (2012) are getting omitted (please see the below results) !!. Do I need to worry about this or it is normal that the first year and the last years are omitted when I lag all the predictor variables?. On the other hand, when I use regress command I got years 2008 and 2012 omitted. Can you please advise me on these queries. Thank you

                  xtreg INED_Board L.(IO_Total Size SGrowth LEV CASH CAPEX MB ROA PPE ANALYST ADR ABNORMAL_RET Q DIV MSCI TURN TAX_DIV Year_2006 Year_2007
                  > Year_2008 Year_2009 Year_2010 Year_2011 Year_2012),fe robust cluster (CountryID)
                  note: L.MSCI omitted because of collinearity
                  note: L.Year_2006 omitted because of collinearity
                  note: L.Year_2012 omitted because of collinearity

                  Fixed-effects (within) regression Number of obs = 2119
                  Group variable: CompanyID Number of groups = 472

                  R-sq: within = 0.0720 Obs per group: min = 1
                  between = 0.0078 avg = 4.5
                  overall = 0.0136 max = 6

                  F(15,15) = .
                  corr(u_i, Xb) = -0.0225 Prob > F = .

                  (Std. Err. adjusted for 16 clusters in CountryID)

                  Robust
                  INED_Board Coef. Std. Err. t P>t [95% Conf. Interval]

                  IO_Total
                  L1. .0568823 .0296717 1.92 0.074 -.0063614 .120126

                  Size
                  L1. -1.041887 3.696541 -0.28 0.782 -8.920877 6.837104

                  SGrowth
                  L1. -.0034625 .010578 -0.33 0.748 -.0260089 .0190839

                  LEV
                  L1. .0382848 .0402726 0.95 0.357 -.0475542 .1241238

                  CASH
                  L1. -.0473262 .0441902 -1.07 0.301 -.1415155 .046863

                  CAPEX
                  L1. -.2469967 .0576791 -4.28 0.001 -.3699367 -.1240567

                  MB
                  L1. .0640882 .0606527 1.06 0.307 -.06519 .1933663

                  ROA
                  L1. .0485226 .0401473 1.21 0.246 -.0370495 .1340946

                  PPE
                  L1. .0699411 .0403061 1.74 0.103 -.0159692 .1558515

                  ANALYST
                  L1. -.0298481 .0403288 -0.74 0.471 -.1158069 .0561107

                  ADR
                  L1. -2.342386 4.261545 -0.55 0.591 -11.42565 6.740882

                  ABNORMAL_RET
                  L1. .001169 .0117321 0.10 0.922 -.0238374 .0261754

                  Q
                  L1. .004479 .3552729 0.01 0.990 -.7527672 .7617253

                  DIV
                  L1. .844072 2.627741 0.32 0.752 -4.756825 6.444969

                  MSCI
                  L1. 0 (omitted)

                  TURN
                  L1. .000063 .0000687 0.92 0.374 -.0000835 .0002095

                  TAX_DIV
                  L1. .0661991 .0682148 0.97 0.347 -.0791972 .2115955

                  Year_2006
                  L1. 0 (omitted)

                  Year_2007
                  L1. 1.023244 .5923753 1.73 0.105 -.239374 2.285862

                  Year_2008
                  L1. 2.264005 .8968649 2.52 0.023 .3523831 4.175628

                  Year_2009
                  L1. 3.075068 1.007865 3.05 0.008 .9268542 5.223281

                  Year_2010
                  L1. 4.087183 1.043964 3.92 0.001 1.862026 6.312341

                  Year_2011
                  L1. 5.431843 1.22668 4.43 0.000 2.817236 8.04645

                  Year_2012
                  L1. 0 (omitted)

                  _cons 62.76134 25.65667 2.45 0.027 8.075438 117.4472

                  sigma_u 21.669954
                  sigma_e 7.7381368
                  rho .88690718 (fraction of variance due to u_i)


                  .

                  Comment


                  • #10
                    In brief, the omissions you are seeing are normal. GIven what you are doing, two of your year indicators will be omitted, no matter how you slice it. Stata selects which two based on factors we have no control over. Unless the effects for specific years are a focus of interest, it doesn't matter anyway. Everything else in the regression output will be the same. If you need modeled outcomes in all years, you can still get them from -margins- anyway. So there is nothing to worry about here.

                    Comment


                    • #11
                      Thank you Clyde for your valuable clarification.

                      If I need modeled outcomes in all years, how I can get them from -margins ?. Can you please clarify to me this point. Thank you

                      Comment


                      • #12
                        I assume you also have some variable called year in your data set that varies from 2006 through 2012. So if you change your original command to:

                        Code:
                        xtreg TotalIndexScore i.year  L.(IO_Total Size SGrowth LEV CASH CAPEX MB ROA PPE ANALYS ...etc. )
                        
                        margins year
                        will do it. Do read the manual section on the -margins- command. It is one of the most useful in all of Stata and for a person doing your kind of work, a thorough knowledge of it is indispensible. It will take you some time to learn its many facets, and to understand some of its subtler aspects, but your time will be amply repaid in productivity. For a particularly lucid introduction to -margins- that will get you functioning with it quickly, I highly recommend Richard Williams' presentation at https://www3.nd.edu/~rwilliam/stats/Margins01.pdf.

                        Comment


                        • #13
                          Thank you so much Clyde for your valuable information and guidance which are highly appreciated.

                          Comment


                          • #14
                            Dear Clyde- I would like to enquire about lagging the explanatory variables by one period in probit panel. I have written the following command:

                            xtprobit TotalIndexScore L.(IO_Total Size SGrowth LEV CASH CAPEX MB ROA PPE ANALYS ), vce (cluster CountryID)

                            However, Stata shows the following output:

                            calculation of robust standard errors failed

                            Can you please let me know how I can improve the command as I also want to get P value corrected for country level clustering?. Thank you

                            Comment


                            • #15
                              Dear Carlo, can you help me with the stata code for running a bound test for cointegration?

                              Comment

                              Working...
                              X