Hi everyone,

I have the following panel dataset. I would like to track ASINs that change from being Prime=0 in year=1 to becoming Prime=1 in years 2 to 5. Is there a way to keep only these ASINs in the dataset? Similarly, I would like to track ASINs that changed from Prime=1 in year=1 to becoming Prime=0 in years 2 to 5. Is there a way to also keep only this subsample in the dataset? Thank you so much for your help.

ASIN Year Prime
"B00008CQRK" 1 0
"B00008CQRK" 2 0
"B00008CQRK" 3 0
"B00008CQRK" 4 0
"B00008CQRK" 5 0
"B0000E5JK7" 1 0
"B0000E5JK7" 2 0
"B0000E5JK7" 3 0
"B0000E5JK7" 4 0
"B0000E5JK7" 5 0
"B0000E5JK8" 1 0
"B0000E5JK8" 2 0
"B0000E5JK8" 3 0
"B0000E5JK8" 4 0
"B0000E5JK8" 5 0
"B0000E5JKC" 1 0
"B0000E5JKC" 2 0
"B0000E5JKC" 3 0
"B0000E5JKC" 4 0
"B0000E5JKC" 5 0
"B0000E5JRF" 1 1
"B0000E5JRF" 2 1
"B0000E5JRF" 3 1
"B0000E5JRF" 4 1
"B0000E5JRF" 5 1
"B0000TLES8" 1 0
"B0000TLES8" 2 0
"B0000TLES8" 3 0
"B0000TLES8" 4 0
"B0000TLES8" 5 0
"B0000VYKXC" 1 0
"B0000VYKXC" 2 1
"B0000VYKXC" 3 1
"B0000VYKXC" 4 0
"B0000VYKXC" 5 1
"B0001Y9U88" 1 0
"B0001Y9U88" 2 0
"B0001Y9U88" 3 0
"B0001Y9U88" 4 0
"B0001Y9U88" 5 0
"B0002AHT84" 1 1
"B0002AHT84" 2 0
"B0002AHT84" 3 0
"B0002AHT84" 4 0
"B0002AHT84" 5 0
"B0002HV730" 1 1
"B0002HV730" 2 1
"B0002HV730" 3 1
"B0002HV730" 4 1
"B0002HV730" 5 1
"B00060NI9Y" 1 1
"B00060NI9Y" 2 1
"B00060NI9Y" 3 1
"B00060NI9Y" 4 1
"B00060NI9Y" 5 0
"B00060NUEW" 1 0
"B00060NUEW" 2 0
"B00060NUEW" 3 0
"B00060NUEW" 4 0
"B00060NUEW" 5 0
"B00060O578" 1 0
"B00060O578" 2 0
"B00060O578" 3 0
"B00060O578" 4 0
"B00060O578" 5 0
"B00061EMH0" 1 0
"B00061EMH0" 2 0
"B00061EMH0" 3 0
"B00061EMH0" 4 0
"B00061EMH0" 5 0
"B00067LYEI" 1 0
"B00067LYEI" 2 0
"B00067LYEI" 3 0
"B00067LYEI" 4 0
"B00067LYEI" 5 0
"B0007G96XO" 1 0
"B0007G96XO" 2 0
"B0007G96XO" 3 0
"B0007G96XO" 4 0
"B0007G96XO" 5 0
"B0007M3E8Q" 1 0
"B0007M3E8Q" 2 1
"B0007M3E8Q" 3 1
"B0007M3E8Q" 4 0
"B0007M3E8Q" 5 0
"B0007VDRHK" 1 0
"B0007VDRHK" 2 0
"B0007VDRHK" 3 0
"B0007VDRHK" 4 0
"B0007VDRHK" 5 0
"B0008JEZ8G" 1 0
"B0008JEZ8G" 2 0
"B0008JEZ8G" 3 0
"B0008JEZ8G" 4 0
"B0008JEZ8G" 5 0
"B000BD3Y7C" 1 1
"B000BD3Y7C" 2 1
"B000BD3Y7C" 3 1
"B000BD3Y7C" 4 1
"B000BD3Y7C" 5 1