Hello!
I am kindly asking you some help inherent one thing, which I cannot get through.
I have a panel data composed of individuals over a bi-monthly time framework of 1 year, only counting the months of January and February (i.e., ID_1 (2000m1, 2000m2), ID_2 (2000m1, 2000m2), ..., ID_N (2000m1, 2000m2).
Now, for every individual, and for each of these two months, I have a binary variable (one binary variable (varA) for January and one binary variable (varB) for February) which can be either 1 or 0; also, there can be a missing value too (so in this case the binary variable = .). Also, varA =. for all the cells corresponding to the month of February (and viceversa varB =. for all the cells corresponding to the month of January).
My goal is to do in a way to keep only the individuals which have the binary variable for January equal to 0 (i.e., varA=0) and the binary variable for February equal to 1 (i.e., varB=0).
Of course, I cannot write "keep if varA==0 & varB==1", because I need only to select the cases for which this happens sequentially.
Whether someone would kindly decide to help me with this, I would be extremely grateful.
Thank you very much!
With best regards,
Kodi
I am kindly asking you some help inherent one thing, which I cannot get through.
I have a panel data composed of individuals over a bi-monthly time framework of 1 year, only counting the months of January and February (i.e., ID_1 (2000m1, 2000m2), ID_2 (2000m1, 2000m2), ..., ID_N (2000m1, 2000m2).
Now, for every individual, and for each of these two months, I have a binary variable (one binary variable (varA) for January and one binary variable (varB) for February) which can be either 1 or 0; also, there can be a missing value too (so in this case the binary variable = .). Also, varA =. for all the cells corresponding to the month of February (and viceversa varB =. for all the cells corresponding to the month of January).
My goal is to do in a way to keep only the individuals which have the binary variable for January equal to 0 (i.e., varA=0) and the binary variable for February equal to 1 (i.e., varB=0).
Of course, I cannot write "keep if varA==0 & varB==1", because I need only to select the cases for which this happens sequentially.
Whether someone would kindly decide to help me with this, I would be extremely grateful.
Thank you very much!
With best regards,
Kodi
Comment