* SPSS Download Code * Creating An Incident-Level Aggregated Flat File. get file = 'Directory:\Path\FBI data.sav'. recode vic_age ('BB' = .7),('NN' = .1),('NB' = .2)(convert) into v_age. do if (v_age gt 0 and v_age le 95). compute vage65 = 0. compute vage1017 = 0. compute vage1524 = 0. compute vlt18 = 0. compute vadult = 0. compute vmale = 0. compute vfemale = 0. if (v_age ge 65)vage65 = 1. if (v_age ge 10 and v_age le 17)vage1017 = 1. if (v_age ge 15 and v_age le 24)vage1524 = 1. if (v_age ge 18 and v_age le 98)vadult = 1. if (v_age lt 18)vlt18 = 1. if (vic_sex = 'M')vmale = 1. if (vic_sex = 'F')vfemale = 1. end if. do if (off_age ge 5 and off_age lt 99). compute off1017 = 0. compute off1524 = 0. compute offadult = 0. compute off65 = 0. compute offmale = 0. compute offemale = 0. if (off_age ge 10 and off_age le 17)off1017 = 1. if (off_age ge 15 and off_age le 24)off1524 = 1. if (off_age ge 18 and off_age le 98)offadult = 1. if (off_age ge 65 and off_age le 98)off65 = 1. if (off_sex = 'M')offmale = 1. if (off_sex = 'F')offemale = 1. end if. do if (arr_age ge 5 and arr_age lt 99). compute arr65 = 0. compute arr1017 = 0. compute arr1524 = 0. compute arradult = 0. compute arr0509 = 0. compute arrmale = 0. compute arfemale = 0. if (arr_age ge 65 and arr_age le 98)arr65 = 1. if (arr_age ge 10 and arr_age le 17)arr1017 = 1. if (arr_age ge 15 and arr_age lt 25)arr1524 = 1. if (arr_age ge 18 and arr_age le 98)arradult = 1. if (arr_age ge 5 and arr_age le 9)arr0509 = 1. if (arr_sex = 'M')arrmale = 1. if (arr_sex = 'F')arfemale = 1. end if. compute indivl = 0. if (v_type = 'I')indivl = 1. recode arr_off ('200' = 200) ('13A' = 130) ('13B' = 171) ('13C' = 172) ('510' = 510) ('220' = 140) ('250' = 250) ('290' = 290) ('35A' = 350) ('35B' = 351) ('270' = 270) ('210' = 210) ('26A' = 260) ('26B' = 261) ('26C' = 262) ('26D' = 263) ('26E' = 264) ('39A' = 390) ('39B' = 391) ('39C' = 392) ('39D' = 393) ('09A' = 90) ('09B' = 198) ('09C' = 199) ('100' = 190) ('23A' = 160) ('23B' = 161) ('23C' = 162) ('23D' = 163) ('23E' = 164) ('23F' = 165) ('23G' = 166) ('23H' = 167) ('240' = 150) ('370' = 370) ('40A' = 400) ('40B' = 401) ('120' = 120) ('11A' = 110) ('11B' = 180) ('11C' = 181) ('11D' = 182) ('36A' = 360) ('36B' = 361) ('280' = 280) ('520' = 520)into arroff. recode off_code ('200' = 200) ('13A' = 130) ('13B' = 171) ('13C' = 172) ('510' = 510) ('220' = 140) ('250' = 250) ('290' = 290) ('35A' = 350) ('35B' = 351) ('270' = 270) ('210' = 210) ('26A' = 260) ('26B' = 261) ('26C' = 262) ('26D' = 263) ('26E' = 264) ('39A' = 390) ('39B' = 391) ('39C' = 392) ('39D' = 393) ('09A' = 90) ('09B' = 198) ('09C' = 199) ('100' = 190) ('23A' = 160) ('23B' = 161) ('23C' = 162) ('23D' = 163) ('23E' = 164) ('23F' = 165) ('23G' = 166) ('23H' = 167) ('240' = 150) ('370' = 370) ('40A' = 400) ('40B' = 401) ('120' = 120) ('11A' = 110) ('11B' = 180) ('11C' = 181) ('11D' = 182) ('36A' = 360) ('36B' = 361) ('280' = 280) ('520' = 520)into offense. do repeat v_off = v_off1 to v_off10/ voff = voff1 to voff10. recode v_off ('200' = 200) ('13A' = 130) ('13B' = 171) ('13C' = 172) ('510' = 510) ('220' = 140) ('250' = 250) ('290' = 290) ('35A' = 350) ('35B' = 351) ('270' = 270) ('210' = 210) ('26A' = 260) ('26B' = 261) ('26C' = 262) ('26D' = 263) ('26E' = 264) ('39A' = 390) ('39B' = 391) ('39C' = 392) ('39D' = 393) ('09A' = 90) ('09B' = 198) ('09C' = 199) ('100' = 190) ('23A' = 160) ('23B' = 161) ('23C' = 162) ('23D' = 163) ('23E' = 164) ('23F' = 165) ('23G' = 166) ('23H' = 167) ('240' = 150) ('370' = 370) ('40A' = 400) ('40B' = 401) ('120' = 120) ('11A' = 110) ('11B' = 180) ('11C' = 181) ('11D' = 182) ('36A' = 360) ('36B' = 361) ('280' = 280) ('520' = 520)into voff. end repeat. compute msvoff = min.1(voff1 to voff10). if (msvoff = 110 and vic_sex = 'M')msvoff = 183. value labels msvoff voff1 to voff10 arroff offense 200 'Arson' 130 'Aggravated Assault' 171 'Simple Assault' 172 'Intimidation' 510 'Bribery' 140 'Burglary/Breaking and Entering' 250 'Counterfeiting/Forgery' 290 'Destruction/Damage/Vandalism of Property' 350 'Drug/Narcotics Violations' 351 'Drug Equipment Violations' 270 'Embezzlement' 210 'Extortion/Blackmail' 260 'False Pretenses/Swindle/Confidence Game' 261 'Credit Card/Automated Teller Machine Fraud' 262 'Impersonation' 263 'Welfare Fraud' 264 'Wire Fraud' 390 'Betting/Wagering' 391 'Operating/Promoting/Assisting Gambling' 392 'Gambling Equipment Violations' 393 'Sports Tampering' 90 'Murder and Nonnegligent Manslaughter' 198 'Negligent Manslaughter' 199 'Justifiable Homicide' 190 'Kidnaping/Abduction' 160 'Pocket-picking' 161 'Purse-snatching' 162 'Shoplifting' 163 'Theft From Building' 164 'Theft From Coin-Operated Machine or Device' 165 'Theft From Motor Vehicle' 166 'Theft of Motor Vehicle Parts or Accessories' 167 'All Other Larceny' 150 'Motor Vehicle Theft' 370 'Pornography/Obscene Material' 400 'Prostitution' 401 'Assisting or Promoting Prostitution' 120 'Robbery' 110 'Forcible Rape' 180 'Forcible Sodomy' 181 'Sexual Assault With An Object' 182 'Forcible Fondling' 183 'Rape of a Male' 360 'Incest' 361 'Statutory Rape' 280 'Stolen Property Offenses' 520 'Weapon Law Violations'. compute mur = 0. compute rap = 0. compute rob = 0. compute aggasl = 0. compute bur = 0. compute lar = 0. compute mvt = 0. compute oth_asl = 0. if (offense = 90)mur = 1. if (offense = 110)rap = 1. if (offense = 120)rob = 1. if (offense = 130)aggasl = 1. if (offense = 140)bur = 1. if (offense >= 160 and offense le 167)lar = 1. if (offense = 150)mvt = 1. if (offense = 171 or offense = 172)oth_asl = 1. compute mur_arr = 0. compute rap_arr = 0. compute rob_arr = 0. compute asl_arr = 0. compute bur_arr = 0. compute lar_arr = 0. compute mvt_arr = 0. compute oasl_arr = 0. if (arroff = 90)mur_arr = 1. if (arroff = 110)rap_arr = 1. if (arroff = 120)rob_arr = 1. if (arroff = 130)asl_arr = 1. if (arroff = 140)bur_arr = 1. if (arroff >= 160 and arroff le 167)lar_arr = 1. if (arroff = 150)mvt_arr = 1. if (arroff = 171 or arroff = 172)oasl_arr = 1. compute firearm = 0. compute vic_inj = 0. recode weapon1 weapon2 weapon3 (convert) into wpn1 to wpn3. if (wpn1 le 15 or wpn2 le 15 or wpn3 le 15)firearm = 1. if (v_inj1 = 'B' or v_inj1 = 'I' or v_inj1 = 'L' or v_inj1 = 'M' or v_inj1 = 'T' or v_inj1 = 'U' or v_inj1 = 'O' or v_inj2 = 'B' or v_inj2 = 'I' or v_inj2 = 'L' or v_inj2 = 'M' or v_inj2 = 'T' or v_inj2 = 'U' or v_inj2 = 'O' or v_inj3 = 'B' or v_inj3 = 'I' or v_inj3 = 'L' or v_inj3 = 'M' or v_inj3 = 'T' or v_inj3 = 'U' or v_inj3 = 'O' or v_inj4 = 'B' or v_inj4 = 'I' or v_inj4 = 'L' or v_inj4 = 'M' or v_inj4 = 'T' or v_inj4 = 'U' or v_inj4 = 'O' or v_inj5 = 'B' or v_inj5 = 'I' or v_inj5 = 'L' or v_inj5 = 'M' or v_inj5 = 'T' or v_inj5 = 'U' or v_inj5 = 'O')vic_inj = 1. if (tot_aseg ge 1)clr_arr = 1. if (excp_clr = 'A' or excp_clr = 'B' or excp_clr = 'C' or excp_clr = 'D' or excp_clr = 'E')CLR_EXCP = 1. compute off_cnt = 0. compute vic_cnt = 0. compute arr_cnt = 0. compute ofns_cnt = 0. if (ibr_rec = '02')ofns_cnt = 1. if (ibr_rec = '04')vic_cnt = 1. if (ibr_rec = '05')off_cnt = 1. if (ibr_rec = '06')arr_cnt = 1. recode off_loc (' ' = sysmis)(convert) into inc_loc. missing values att_comp (' '). sort cases by ori inc_num. AGGREGATE /OUTFILE= 'Directory:\Path\Incident-level file.sav' /PRESORTED /BREAK=ori inc_num /inc_yr = FIRST(inc_yr) /inc_mo = FIRST(inc_mo) /inc_dy = FIRST(inc_dy) /inc_hr = FIRST(inc_hr) /rptdate = first(rptdate) /inc_loc 'Incident location' = first(inc_loc) /CLR_EXCP 'Incident was cleared exceptionally' = first(CLR_EXCP) /CLR_ARR 'Incident was cleared by an arrest' = first(CLR_ARR) /ofns_cnt 'Count of offenses in incident' = sum(ofns_cnt) /off_cnt 'Count of offenders in incident' = sum(off_cnt) /vic_cnt 'Count of victims in incident' = sum(vic_cnt) /arr_cnt 'Count of arrests for incident' = sum(arr_cnt) /att_comp 'Completed or attempted' = first(att_comp) /msioff 'Most serious incident offense' = min(msvoff) /indivl 'Count of individual victims in incident' = sum(indivl) /vage65 'Count of victims age 65 and older in incident' = sum(vage65) /vage1017 'Count of victims between the ages of 10 through 17' = sum(vage1017) /vage1524 'Count of victims between the ages of 15 through 24' = sum(vage1524) /vlt18 'Count of victims under age 18' = sum(vlt18) /vadult 'Count of victims age 18 and older' = sum(vadult) /vmale 'Count of male victims in incident' = sum(vmale) /vfemale 'Count of female victims in incident' = sum(vfemale) /off65 'Count of offenders age 65 and older' = sum(off65) /off1017 'Count of offenders between the ages of 10 through 17' = sum(off1017) /off1524 'Count of offenders between the ages of 15 through 24' = sum(off1524) /offadult 'Count of offenders age 18 and older' = sum(offadult) /offmale 'Count of male offenders in incident' = sum(offmale) /offemale 'Count of female offenders in incident' = sum(offemale) /arr65 'Count of arrestees age 65 and older' = sum(arr65) /arr1017 'Count of arrestees between the ages of 10 through 17' = sum(arr1017) /arr1524 'Count of arrestees between the ages of 15 through 24' = sum(arr1524) /arr0509 'Count of arrestees between the ages of 5 through 9' = sum(arr0509) /arradult 'Count of arrestees age 18 and older' = sum(arradult) /arrmale 'Count of male arrestees in incident' = sum(arrmale) /arfemale 'Count of female arrestees in incident' = sum(arfemale) /mur 'Murder offense in incident' = sum(mur) /rap 'Rape offense in incident' = sum(rap) /rob 'Robbery offense in incident' = sum(rob) /aggasl 'Aggravated assault offense in incident' = sum(aggasl) /bur 'Burglary offense in incident' = sum(bur) /lar 'Larceny offense in incident' = sum(lar) /mvt 'Motor vehicle theft offense in incident' = sum(mvt) /oth_asl 'Other assault offense in incident' = sum(oth_asl) /mur_arr 'Count of arrests for murder in incident' = sum(mur_arr) /rap_arr 'Count of arrests for rape in incident' = sum(rap_arr) /rob_arr 'Count of arrests for robbery in incident' = sum(rob_arr) /asl_arr 'Count of arrests for aggravted assault in incident' = sum(asl_arr) /bur_arr 'Count of arrests for burglary in incident' = sum(bur_arr) /lar_arr 'Count of arrests for larceny in incident' = sum(lar_arr) /mvt_arr 'Count of arrests for motor vehicle theft in incident' = sum(mvt_arr) /Firearm 'Firearm used in incident' = sum(firearm) /vic_inj 'Number of victims injured in incident' = sum(vic_inj) /oasl_arr 'Count of arrests for other assaults in incident' = sum(oasl_arr). do if (ibr_rec = '01'). xsave outfile = 'Directory:\Path\Admin segment.sav'/keep = ibr_rec to incoff10. else if (ibr_rec = '02'). xsave outfile = ''Directory:\Path\offense segment.sav'/keep = ibr_rec to inc_date att_comp to bias off_code offense. else if (ibr_rec = '03'). xsave outfile = 'Directory:\Path\property segment.sav'/keep = ibr_rec to inc_date losstype to p_off10. else if (ibr_rec = '04'). xsave outfile = 'Directory:\Path\victim segment.sav'/keep = ibr_rec to inc_date vic_num to ovr10 voff1 to voff10 msvoff v_age. else if (ibr_rec = '05'). xsave outfile = 'Directory:\Path\offender segment.sav'/keep = ibr_rec to inc_date ofnseq to off_race. else if (ibr_rec = '06'). xsave outfile = 'Directory:\Path\arrestee segment.sav'/keep = ibr_rec to inc_date arrseq to arr_clr arroff. else if (ibr_rec = '07'). xsave outfile = 'Directory:\Path\arresteegrpB segment.sav'/keep = ibr_rec to inc_date arrseq to arr_disp. end if. execute.