Hi Everybody,
I have a data set as follows with reference and date values. I wanna group every 20 reference numbers and create a variable with respect to their group as I made below for a group of 3 reference numbers to create a group variable.
As far as I understand, I have to use seq with by option. I tried it but the results didn't appear as I wanted.
ref I date I group
1 2011 1
1 2012 1
1 2013 1
1 2014 1
1 2015 1
1 2016 1
2 2012 1
2 2013 1
2 2014 1
7 2012 1
7 2013 1
7 2014 1
8 2012 2
12 2014 2
12 2015 2
12 2016 2
12 2017 2
14 2014 2
14 2015 2
14 2016 2
14 2017 2
Thanks in advance,
Mahmut
I have a data set as follows with reference and date values. I wanna group every 20 reference numbers and create a variable with respect to their group as I made below for a group of 3 reference numbers to create a group variable.
As far as I understand, I have to use seq with by option. I tried it but the results didn't appear as I wanted.
ref I date I group
1 2011 1
1 2012 1
1 2013 1
1 2014 1
1 2015 1
1 2016 1
2 2012 1
2 2013 1
2 2014 1
7 2012 1
7 2013 1
7 2014 1
8 2012 2
12 2014 2
12 2015 2
12 2016 2
12 2017 2
14 2014 2
14 2015 2
14 2016 2
14 2017 2
Thanks in advance,
Mahmut
Comment