I have a dataset with regions and an id for a specific sector. As an example I have
region id x1
1 2361 6
1 2362 10
1 2363 11
1 2364 4
2 2361 8
2 2362 23
2 2363 6
2 2364 2
I need to sum 2361+2362 for each region and keep the id code of 2361 so that
region id x1
1 2361 16
1 2363 11
1 2364 4
2 2361 31
2 2363 6
2 2364 2
I found some previous posts about how to do it, but they seem to be a bit too complicated to do for all the variables. I need to do it for all 75 variables on the dataset.
region id x1
1 2361 6
1 2362 10
1 2363 11
1 2364 4
2 2361 8
2 2362 23
2 2363 6
2 2364 2
I need to sum 2361+2362 for each region and keep the id code of 2361 so that
region id x1
1 2361 16
1 2363 11
1 2364 4
2 2361 31
2 2363 6
2 2364 2
I found some previous posts about how to do it, but they seem to be a bit too complicated to do for all the variables. I need to do it for all 75 variables on the dataset.
Comment