Hello,
I am trying to get my head around stata but i'm having issues creating a 0/1 variable where dates coincide:
I have the following variables:
Xstart
Xstop
Ystart
Ystop
If at any point x and y coincide, i would like to create a column where there's a 1. If they do not coincide, i would like a 0.
For example:
Xstart = 1jan2013
Xstop = 1dec2013
Ystart = 1apr2013
Yend = 1apr2014
They coincided between April and December, and therefore I would like a 1 in my new variable.
However, if Xstop and Ystart occur on the same day, i would like a 0.
I hope this makes sense. I am having trouble, and it is for my degree.
Thanks in advance for your help.
I am trying to get my head around stata but i'm having issues creating a 0/1 variable where dates coincide:
I have the following variables:
Xstart
Xstop
Ystart
Ystop
If at any point x and y coincide, i would like to create a column where there's a 1. If they do not coincide, i would like a 0.
For example:
Xstart = 1jan2013
Xstop = 1dec2013
Ystart = 1apr2013
Yend = 1apr2014
They coincided between April and December, and therefore I would like a 1 in my new variable.
However, if Xstop and Ystart occur on the same day, i would like a 0.
I hope this makes sense. I am having trouble, and it is for my degree.
Thanks in advance for your help.
Comment