简体   繁体   中英

Graphing crime rates on stata

I am new to stata. I am trying to write code in stata that would graph Idaho's crime rate from 2016 - 2021. I'm using data from the FBI: ( https://cde.ucr.cjis.gov/LATEST/webapp/#/pages/downloads#nibrs-downloads ). Wondering if anyone had any tips?

can you give more detail about how the original data illustrate the crime rate? if you have the year and corresponding crime rate

you can try

twoway (line rate year)

I think a bit more information might be helpful but based upon what you sent, I think this might be of use. It looks like you would need to use the "NIBRS_incident.csv" file for years 2016-2021. After downloading these files, you would need to append these files to create a workfile with all 6 years of data. Once you've done that, you can create a count variable by year with:

by data_year: gen Incidence_By_Yr = _N

Then, following the comment above with the twoway graph.

twoway(line Incidence_By_Yr year)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM