Hello, I am just starting to use Stata, so excuse me in advance if my question is a bit sketchy. I am using an annual database with a binary variable column "x"; I wish to create another column "y", which will take values 1 for the 10 previous years for which x is equal to 1. (e.g.: If x = 1 in 2011, then "y" will take values of 1 from 2001:2010). Thank you for your help.