So essentially I was looking to create a variable in R (lets call it historyD) which == 1 if another dummy (let's call it currentD) in the panel data == 1 for the current year or == 1 if currentD == 1 for any of the past years specific to each participant. Tricky part is my data is sorted into participants and descending years, so I wanted it to look like this:
Finding it a hard time to match the code to each participant, so that the historyD relies on current and past year currentD specific for each participant. Have made very little progress so far.
Any help would be greatly appreciated.
Thanks.