How can I efficiently create new variables for lags of many variables in my dataset?
Say for example that I have the variables: cons inv out ae exp rev int oph lpt , and I do not want to create lags for each one separately (such as gen lag_cons=lag.cons, etc.) because it will take time especially if I have to do that for nearly 20 variables...

I tried :
Code:
local X cons inv out ae exp rev int  oph lpt
gen lag`X'=lag.`X'
But I get error message that lag operator is invalid.