e***@lakeheadu.ca
2019-06-03 20:26:55 UTC
I have a set of data and am trying to assign a count by chronological date, grouped by ID.
For example this data set:
ID1 02/01/2018
ID1 02/10/2018
ID1 04/04/2017
ID2 01/10/2015
ID2 03/04/2016
Would give me a new variable like this:
ID1 02/01/2018 2
ID1 02/10/2018 3
ID1 04/04/2017 1
ID2 01/10/2015 1
ID2 03/04/2016 2
I am having a hard time figuring out the syntax for this. I think it's Aggregate but I'm not sure the rest.
Any help is greatly appreciated!
For example this data set:
ID1 02/01/2018
ID1 02/10/2018
ID1 04/04/2017
ID2 01/10/2015
ID2 03/04/2016
Would give me a new variable like this:
ID1 02/01/2018 2
ID1 02/10/2018 3
ID1 04/04/2017 1
ID2 01/10/2015 1
ID2 03/04/2016 2
I am having a hard time figuring out the syntax for this. I think it's Aggregate but I'm not sure the rest.
Any help is greatly appreciated!