Hello all,
I am trying to generate a large number of lagged variables, all lagged once, and all mostly the same.
I have 24 variables which exist, all of which I am trying to lag into new variables - only lagging each by one level. The code I am using for each individually is
Do I need to write this out 24 times or is it possible to write a concise version of this? Thanks!
I am trying to generate a large number of lagged variables, all lagged once, and all mostly the same.
I have 24 variables which exist, all of which I am trying to lag into new variables - only lagging each by one level. The code I am using for each individually is
Code:
bys country: gen l_[variable] = l.[variable]
Comment