* If you've already created the offense_ori file, you can skip down to opening the Offense file. get file='Directory:\Path\00Offense.sav' . SORT CASES BY ori (A) inc_num (A) . IF (off_code = '200') arson = 1 . IF (off_code = '13A') aggasslt = 1 . IF (off_code = '13B') smpasslt = 1 . IF (off_code = '13C') intim = 1 . IF (off_code = '510') bribe = 1 . IF (off_code = '220') burg = 1 . IF (off_code = '250') forg = 1 . IF (off_code = '290') vand = 1 . IF (off_code = '35A') drug = 1 . IF (off_code = '35B') d_equip = 1 . IF (off_code = '270') embez = 1 . IF (off_code = '210') extort = 1 . IF (off_code = '26A') swind = 1 . IF (off_code = '26B') atmfrd = 1 . IF (off_code = '26C') impers = 1 . IF (off_code = '26D') welfrd = 1 . IF (off_code = '26E') wirefrd = 1 . IF (off_code = '39A') bett = 1 . IF (off_code = '39B') gamb = 1 . IF (off_code = '39C') gam_eq = 1 . IF (off_code = '39D') sports = 1 . IF (off_code = '09A') mur = 1 . IF (off_code = '09B') neghom = 1 . IF (off_code = '09C') jushom = 1 . IF (off_code = '100') kidnap = 1 . IF (off_code = '23A') pocpik = 1 . IF (off_code = '23B') purse = 1 . IF (off_code = '23C') shoplft = 1 . IF (off_code = '23D') tft_bld = 1 . IF (off_code = '23E') tft_mac = 1 . IF (off_code = '23F') tft_auto = 1 . IF (off_code = '23G') tft_prts = 1 . IF (off_code = '23H') oth_larc = 1 . IF (off_code = '240') mvt = 1 . IF (off_code = '370') porno = 1 . IF (off_code = '40A') prost = 1 . IF (off_code = '40B') ast_prst = 1 . IF (off_code = '120') rob = 1 . IF (off_code = '11A') rape = 1 . IF (off_code = '11B') sod = 1 . IF (off_code = '11C') sex_obj = 1 . IF (off_code = '11D') fondl = 1 . IF (off_code = '36A') incest = 1 . IF (off_code = '36B') st_rape = 1 . IF (off_code = '280') st_prop = 1 . IF (off_code = '520') wpns = 1 . EXECUTE . save outfile='Directory:\Path\00Offense.sav' . AGGREGATE /OUTFILE='Directory:\Path\offense_ori.sav' /PRESORTED /BREAK=ori inc_num /arson = MEAN(arson) /aggasslt = MEAN(aggasslt) /smpasslt = MEAN(smpasslt) /intim = MEAN(intim) /bribe = MEAN(bribe) /burg = MEAN(burg) /forg = MEAN(forg) /vand = MEAN(vand) /drug = MEAN(drug) /d_equip = MEAN(d_equip) /embez = MEAN(embez) /extort = MEAN(extort) /swind = MEAN(swind) /atmfrd = MEAN(atmfrd) /impers = MEAN(impers) /welfrd = MEAN(welfrd) /wirefrd = MEAN(wirefrd) /bett = MEAN(bett) /gamb = MEAN(gamb) /gam_eq = MEAN(gam_eq) /sports = MEAN(sports) /mur = MEAN(mur) /neghom = MEAN(neghom) /jushom = MEAN(jushom) /kidnap = MEAN(kidnap) /pocpik = MEAN(pocpik) /purse = MEAN(purse) /shoplft = MEAN(shoplft) /tft_bld = MEAN(tft_bld) /tft_mac = MEAN(tft_mac) /tft_auto = MEAN(tft_auto) /tft_prts = MEAN(tft_prts) /oth_larc = MEAN(oth_larc) /mvt = MEAN(mvt) /porno = MEAN(porno) /prost = MEAN(prost) /ast_prst = MEAN(ast_prst) /rob = MEAN(rob) /rape = MEAN(rape) /sod = MEAN(sod) /sex_obj = MEAN(sex_obj) /fondle = MEAN(fondl) /incest = MEAN(incest) /st_rape = MEAN(st_rape) /st_prop = MEAN(st_prop) /wpns = MEAN(wpns). get file='Directory:\Path\00Offense.sav'. use all. select if (off_code='35A' | off_code='35B'). execute . IF (crimact1 = 'U' | crimact1 = 'B' | crimact2 = 'U' | crimact2 = 'B' | crimact3 = 'U' | crimact3 = 'B') user = 1 . IF (crimact1 = 'D' | crimact2 = 'D' | crimact3 = 'D') dealer = 1 . EXECUTE . sort cases by ori inc_num. AGGREGATE /OUTFILE='Directory:\Path\drug_off_agg_inc.sav' /BREAK=ori inc_num /user = MEAN(user) /dealer = MEAN(dealer). get file='Directory:\Path\00Offender.sav'. SORT CASES BY ori (A) inc_num (A) . save outfile='Directory:\Path\00Offender.sav'. MATCH FILES /FILE=* /TABLE='Directory:\Path\offense_ori.sav' /BY ori inc_num. EXECUTE. MATCH FILES /FILE=* /TABLE='Directory:\Path\drug_off_agg_inc.sav' /BY ori inc_num. EXECUTE. save outfile='Directory:\Path\00offender_offenses.sav'. USE ALL. COMPUTE filter_$=(drug = 1 | d_equip = 1). FORMAT filter_$ (f1.0). FILTER BY filter_$. EXECUTE . value labels off_age 0 'Unknown' 99 'Over 98'. value labels off_sex 'M' 'Male' 'F' 'Female' 'U' 'Unknown'. value labels off_race 'W' 'White' 'B' 'Black' 'I' 'American Indian' 'A' 'Asian' 'U' 'Unknown'. RECODE off_age (0=0) (1 thru 17=1) (else=2) INTO ad_juv . execute . value labels ad_juv 0 'Unknown' 1 'Juvenile' 2 'Adult' . RECODE off_age (1 thru 10=1) (11 thru 12=2) (13 thru 15=3) (16 thru 18=4) (19 thru 21=5) (22 thru 25=6) (26 thru 30=7) (31 thru 40=8) (41 thru 50=9) (51 thru 74=10) (sysmis=sysmis) (else=11) INTO age_cat . EXECUTE . value labels age_cat 1 '10 and under' 2 '11 - 12' 3 '13 - 15' 4 '16 - 18' 5 '19 - 21' 6 '22 - 25' 7 '26 - 30' 8 '31 - 40' 9 '41 - 50' 10 '51 - 74' 11 '75 and over'. frequencies variables=off_age off_sex off_race. frequencies variables=ad_juv age_cat. frequencies variables=off_age. if (user = 1 & sysmis(dealer)) type=1. if (user = 1 & dealer = 1) type=3. if (sysmis(user) & dealer = 1) type=2. execute. value labels type 1 'User' 2 'Dealer' 3 'Combined'. CROSSTABS /TABLES=age_cat BY type /FORMAT= AVALUE TABLES /CELLS= COUNT ROW COLUMN . CROSSTABS /TABLES=ad_juv BY type /FORMAT= AVALUE TABLES /CELLS= COUNT ROW COLUMN . CROSSTABS /TABLES=off_sex BY type /FORMAT= AVALUE TABLES /CELLS= COUNT ROW COLUMN . CROSSTABS /TABLES=off_race BY type /FORMAT= AVALUE TABLES /CELLS= COUNT ROW COLUMN .