Announcement

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

  • Help with lagging a variable without consecutive years

    Dear community,

    I have to do an empirical assignment and I am stuck at one exercise.

    My dataset contains the election years 2004,2008,2012,2016 and 2020. In my exercise I am asked to create a lag for one variable. Chat GPT is not clear whether I need to create a lag using L1 or L4. Since I don't have consecutive years but in steps of 4, I am not sure whether Stata captures this when using L1. For example, in year 2020, if I use L1 does it capture the year 2019 (although that is not included in my dataset) or does that capture the previous period in my dataset (i.e. 2016)?

    I hope it was possible to understand my point.

    Thank you very much in advance!

  • #2
    Unfortunately, we don't provide support for homework. See #4: https://www.statalist.org/forums/help#adviceextras

    Comment


    • #3
      Hi! Thank you for your reply! I dont want anyone to solve my homework.

      I would love to know how lagging works in Stata. Whether it considers the previous period in my dataset or the previous year(although that is not in the dataset)

      If it's not possible to answer this, could you provide me with some link where I can read up on that?

      Comment


      • #4
        Andrew Musau is right. Indeed in some places outsourcing assignments or using AI to answer them is contrary to regulations.

        That said, I will stretch to two hints.

        Stata can do nothing whatsoever about observations that aren't in the dataset.

        To be able to use lags at all, you must have used tsset or xtset, so studying the help for and the output from whichever command you used will solve this question.
        Last edited by Nick Cox; 30 May 2024, 05:20.

        Comment

        Working...
        X