I want to create a lead variable in Stata in my balanced panel data set. However, if I create the lead variable in Stata now it also converts the data for another company.
However, I want exclude the data at all "2014" rows. I have used the command
gen rdintensitylead = rdintensity[_n+1]
Can someone help me?
Thanks in advance!
However, I want exclude the data at all "2014" rows. I have used the command
gen rdintensitylead = rdintensity[_n+1]
Can someone help me?
Thanks in advance!
year | rdintensity | rdintensitylead |
2011 | .139 | .202 |
2012 | .202 | .204 |
2013 | .204 | .217 |
2014 | .217 | .012 |
2011 | .012 | .025 |
2012 | .025 | .010 |
Comment