Hello everyone, I have these data and I want to find the item that recurring next year the description of what I need : I want to create a dummy variable for the item, if the item in year+1 is in the year put 0, if it is not put 1. in summary, 1 for nonrecurring and 0 for recurring. The data inputs Code Year item 000001 2017 AB 000001 2017 AD 000001 2017 BC 000001 2018 AD 000001 2018 CC 000001 2019 CC 000001 2019 BC 000002 2016 FF 000002 2016 GG 000002 2016 DD 000002 2017 FF 000002 2017 GG 000002 2017 HH 000002 2018 HH 000002 2018 BB 000002 2018 GG 000002 2019 BB 000002 2019 GG 000002 2019 FF The output that I need Code Year item recurring 000001 2017 AB 1 000001 2017 AD 1 000001 2017 BC 1 000001 2018 AD 0 000001 2018 CC 1 000001 2019 CC 0 000001 2019 BC 1 000002 2016 FF 1 000002 2016 GG 1 000002 2016 DD 1 000002 2017 FF 0 000002 2017 GG 0 000002 2017 HH 1 000002 2018 HH 0 000002 2018 BB 1 000002 2018 GG 0 000002 2019 BB 0 000002 2019 GG 0 000002 2019 FF 1 Thanks in advance.
... View more