Announcement

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

  • Creating a lagged variable without generation of missing values

    Dear community,

    I am currently writing my master's thesis using unbalanced panel data set from the WRDS database for the period 2009-2018 to investigate the impact of carbon performance on company performance.

    Unfortunately, I am currently facing the following problem: I need two variables (Carbon Emission Intensity and Sales Growth), each of which has to be lagged by one year.
    If I now lag the first variable (Emission Intensity) by one year, missing values are immediately generated for the first year (2009), which means that these values (from 2009) can no longer be taken into account for the second variable (Sales Growth).

    The lagging of the variable is done with the following code:

    Code:
    * Resort data
       sort GVKEY fyear
    * Reset panel
       xtset GVKEY fyear
    * Generate lagged variable
       g emissions_intensity_l1 = L1.emissions_intensity

    During my research I came across the following link (https://www.stata.com/support/faqs/d...issing-values/), which looks like a possible approach to me. Honestly, however, I do not understand how to implement it in my case.

    If you have an idea how I can avoid the generation of missing values in this case or how I can still access the first year (2009), I would appreciate your answer. Thanks a lot for your help!

    Best regards,

    Jannis
    Last edited by Jannis Volker; 27 Jan 2022, 13:17.

  • #2
    The mathematics of lags prevent this from being on the menu.

    As a definition, lags are a delayed effect of a variable. Thus, since they're t-x with x being the number of lags, this necessarily precludes you from lagging a variable without having missing values, they necessarily go together

    Comment

    Working...
    X