Person_ID | Fiscal_Year |
101 | 2015 |
101 | 2015 |
101 | 2016 |
102 | 2016 |
102 | 2017 |
102 | 2017 |
103 | 2015 |
103 | 2016 |
103 | 2017 |
So, for example, the variable should contain the value 2 because the person ID is two times in the Fiscal_Year 2015.
The values of the new variable should be as follows:
Person_ID | Fiscal_Year | New_Variable |
101 | 2015 | 2 |
101 | 2015 | 2 |
101 | 2016 | 1 |
102 | 2016 | 1 |
102 | 2017 | 2 |
102 | 2017 | 2 |
103 | 2015 | 1 |
103 | 2016 | 1 |
103, | 2017 | 1 |
Could anyone help me out?
Thnx in advance!
0 Response to Generating count variable for observations per year
Post a Comment