Hello-
I have tried to find resources on aggregating data in stata (or if its even possible). In sum, I have data for crime incidents; all shooting crimes that occurred on a given day from 2016-2025. I am attempting to run time-series analyses on these data but believe the data need to be in aggregated form.
For example, lets say there are 45 cases that have a january 2016 date. these 45 cases have 3 different crime types (robbery, assault, and homicide). I want to aggregate the data so that these 45 cases are just one case, 2016m1. And each case has a count of how many robberies occurred in january 2016 (same for the other two categories).
The only thing I can think of is to add them all up individually and make a new dataset in excel to upload. But this is obviously time consuming. Is there a way to do this in stata with the original data or is this my only option?
I have tried to find resources on aggregating data in stata (or if its even possible). In sum, I have data for crime incidents; all shooting crimes that occurred on a given day from 2016-2025. I am attempting to run time-series analyses on these data but believe the data need to be in aggregated form.
For example, lets say there are 45 cases that have a january 2016 date. these 45 cases have 3 different crime types (robbery, assault, and homicide). I want to aggregate the data so that these 45 cases are just one case, 2016m1. And each case has a count of how many robberies occurred in january 2016 (same for the other two categories).
The only thing I can think of is to add them all up individually and make a new dataset in excel to upload. But this is obviously time consuming. Is there a way to do this in stata with the original data or is this my only option?
Comment