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)
graph barHi Stata users, I was wondering if someone can help with ideas in graphing a bar with options -over…
A buggy explanation in the help for -monthly-. -monthly- fails where according to help is supposed to work,and succeeds where it is not clear it should. I obtain the following strange results using the date…
Negative Innovations using IRF functionsHello, I want to create an IRF for a negative innovation. I read that the standard innovation is a p…
Post hoc test after Fisher Exact testDear users, I am new to the Stata world, and I am not an expert statistician at all. In my master's…
Variable ProblemHi, everybody, How can I change observations with non-numerical content? I have a variable that is n…
Subscribe to:
Post Comments (Atom)
0 Response to Creating one year lagged variable for law ( state by year panel data)
Post a Comment