Why is my code missing out some observations (or separate) when they should be calculated together. For example, I want to sum disease cases in the field (Case1) sorted according to Municipio but instead of having 3s in all 4 results, I have 1 and 2s meaning the first one is treated separate. Any suggestions?
The code I used is as as follows and it gave the same answer as highlighted in the last three columns:
egen sum_var = sum( Case1 ), by( Municipio ) for sum_var and bysort Municipio: egen cases= total ( Case1 ) for Cases.
The code I used is as as follows and it gave the same answer as highlighted in the last three columns:
egen sum_var = sum( Case1 ), by( Municipio ) for sum_var and bysort Municipio: egen cases= total ( Case1 ) for Cases.
Comment