0

So I have a dataset that is designed in the following fashion

Proi  Muni  PaisNACM  
11     001  108
11     002  108
14     001  228
14     004  112
30     005  104
.       .    .
.       .    .

What I would like to do is to sum the number of observations which have the same values in the columns of "Proi" and "Muni" and a certain value in the "PaisNACM" (in this case 108). My usual approach of using the "group_by" command does not not work here, as it adds together observations that may have the same values in the variable "Proi" but different ones in the variable "Muni"

My desired outcome would be something along this lines ( the numbers on the sum column arise from the sum of all the observations that have a value of 108 in the "PaisNACM" and share the same values on the "Proi" and "Muni" column. The actual values displayed in the example below are only for explanatory porpuses

Proi  Muni   Sum
11     001    134
11     002    232
12     001    102
Any suggestions on how to proceed?

ffolkvar
  • 47
  • 4

0 Answers0