Announcement

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

  • Time Series Regression

    I had a big dataset which is collapsed to the following:

    year_n mean_agri operinc_agri
    1999 140.6665 130.0292
    2000 122.3473 112.9211
    2001 172.025 160.3256
    2002 191.2138 173.9032
    2003 129.9812 113.6432
    2004 258.9533 238.0866
    2005 378.8972 347.8264
    2006 383.4485 359.1333
    2007 307.9839 281.7674
    2008 271.7401 231.1032
    2009 569.6434 518.8009
    2010 840.3614 801.1135
    2011 529.317 498.4157
    2012 498.6798 464.4033
    2013 334.0743 296.282
    2014 399.7631 332.3965
    2015 241.1886 202.7512
    2016 225.9632 189.0285
    2017 1600.593 1393.567
    2018 2505.177 2213.043
    2019 152.8845 137.9156
    2020 1729.714 1598.83

    I want to do a time series regression where y = operinc_agri and xs are 7 lagged values of mean agri.. Since it does not have a panel id I am unable to do xtset and use L. to create lagged values to regress. Can someone help me with this?

    Thanks in advance!

    Thanks,
    Prerna


  • #2
    For a simple time series with non panel structure, instead of -xtset-, use -tsset-, where you need only specify the time variable. Then you will be able to use L and other time-series operators.

    Comment


    • #3
      Thank you, that worked.

      Comment

      Working...
      X