I need to get the SUM of Var 1. for each ID observation in 2016,
for example, A person who has ID 1 has a total of $100 for Var.1 and $500 for Var. 2 in 2016, and so on
I need to have one observation for each ID , by summing up the observations for this ID in this year
What is the command should I use ?
ID | Year | Var. 1 | Var. 2 | |
1 | 2016 | 50 | 100 | |
1 | 2016 | 30 | 200 | |
1 | 2016 | 20 | 300 | |
2 | 2016 | 60 | ||
2 | 2016 | |||
2 | 2016 | |||
1 | 2017 | |||
1 | 2017 | |||
1 | 2017 |
0 Response to combine Several observations to one observation in a given year
Post a Comment