Hello stata community,
I have a panel set of law effective data for state by year , and I need to create a one year lagged variable for that law panel variable since it takes a year to see the effect of law.
out of the mentioned 2 commands which one I should follow :
sort state year
by state: gen law_lag = law[_n-1] or ############## sort state
by state: gen law_lag = law[_n-1] if year==year[_n-1]+1
Related Posts with Creating one year lagged variable for law ( state by year panel data)
Interpreting STATA FE regression outputHello, I am running a fe regression on panel data and had some basic questions on how to interpret …
Spearman's rank correlation resultDear All, Can someone help me out, there's no result detail after i run my command. the code: by ag…
Synthetic Control, Synth commandHello, I am currently working on applying the Synthetic control method on Stata. To resume my work, …
Creating month-of-the-year dummiesHello everyone! I have a dataset with monthly data. My date variable is in the format of "YM", so, …
Yearly Sale Changes (in percentage)hello statalist, I hope everyone is fine I've following panel data of customers. I wanna know how …
Subscribe to:
Post Comments (Atom)
0 Response to Creating one year lagged variable for law ( state by year panel data)
Post a Comment