THE FBI'S ANALYSIS OF ROBBERY

The following examples are extracted from an analysis conducted by the FBI's Criminal Justice Information System division.  The intent of the analysis is to demonstrate the utility of NIBRS for extracting details on different crimes.  The FBI's analysis includes over 30 graphs; this abbreviated version selects highlights of their analysis using NIBRS and provides the SPSS syntax for recreating the tables and graphs.  When using this code, be sure to insert the path and the file name of the data file to be used, as well as the directory and file name for saving.  If you need any assistance working with the syntax provided, please contact us.

NOTE:  Table template files (.sct) are referenced in this code and should also be downloaded before the syntax is run.

The assumptions for the following example of code are:
  1. The NIBRS data file was obtained on tapes from the FBI in ASCII format.
  2. The NIBRS data segments that comprise a single incident report can be linked by a combination of the ORI data field plus the incident number data field (incident numbers are encrypted).
  3. The data file was created as described in "Reading A Multi-Level Data File."

GET FILE='Directory\Path\incident 1999.sav'.
SELECT IF (rob ge 1 and inc_yr = 1999).
SAVE OUTFILE = 'Directory\Path\Robbery Incident.sav'.

This RECODE changes the alphanumeric variable type for incident offense into a numeric type and assigns the new values to the new variable called OFFENSE. Alphanumeric types require more disk space. The new values assigned coincide with the FBI hierarchical offense structure for Part I offenses. In this RECODE, the lower the value, the greater the seriousness of the offense.

GET FILE = 'Directory:\Path\FBI data.sav'.

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.

VALUE LABELS assigns a descriptive label to the values of the variable OFFENSE.

value labels 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'.

The following code creates a new variable for robbery offenses (ROB). Each occurrence is assigned a value of 1 so that a count can be obtained when the AGGREGATE command is executed.         

Compute rob = 0.
IF (offense = 120)rob = 1.

The AGGREGATE command restructures the data into an incident unit of analysis. The OUTFILE subcommand creates a new system file so that the original file remains unchanged. Each unique incident record (ORI+ incident number) [see /BREAK=ori inc_num] will consist of variables that describe the incident and variables that allow counts. Some of these variables existed in the original FBI ASCII file and others were created.

AGGREGATE
  /OUTFILE= 'Directory\Path\Robbery Incident 1999.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)
  /rob 'Robbery offense in incident' = sum(rob).

******The SELECT IF selects all incidents in 1999 in which a robbery offense was reported.  The SAVE OUTFILE saves the file with the new name 'Directory\Path\Robbery Incident.sav'.

GET FILE='Directory\Path\Robbery Incident 1999.sav'.
SELECT IF (rob ge 1 and inc_yr = 1999).
SAVE OUTFILE = 'Directory\Path\Robbery Incident.sav'.

The FBI's analysis begins with an examination of incidents which were cleared, either by arrest or exceptionally.  The COMPUTE creates the new variable CLEARED and sets its value to the sum of the values across the clr_excp and clr_arr variables.  If the incident is cleared, the new variable will have a value of 1.  The cases are sorted in ascending order by ori and inc_num and the file is SAVEd.

COMPUTE cleared = sum.1(clr_excp,clr_arr).
SORT CASES BY ori (A) inc_num (A).
SAVE OUTFILE='Directory\Path\Robbery Incident.sav'
   /COMPRESSED.

The NIBRS offense segment file is sorted in ascending order by ori and incident number.

GET FILE='Directory\Path\US99 Offense segment.sav'.
SORT CASES BY ori (A) inc_num (A).
SAVE OUTFILE='Directory\Path\US99 offense segment.sav'
   /COMPRESSED.

The MATCH FILES command joins the Robbery Incident file with the US 99 offense segment file by the variables ORI and INC_NUM, DROPping those variables unnecessary for this analysis.  Cases are then selected if the variable robbery was greater than or equal to one (indicating a robbery actually occurred).

GET  FILE= 'Directory\Path\Robbery Incident.sav'.
MATCH FILES /TABLE=*
  /FILE='Directory\Path\US99 offense segment.sav'
  /BY ori inc_num
  /DROP= att_comp bias crimact1 crimact2 crimact3 ibr_rec inc_date inc_dy inc_mo inc_yr meth_ent
      off_code prem_ent st_code.
SELECT IF (rob ge 1).

Incidents by Location.  This output is defined as a simple bar graph displaying robbery incidents by location.

TEMPORARY.
VARIABLE LABELS inc_loc ' '.
GRAPH
  /BAR(SIMPLE)=COUNT BY inc_loc
  /MISSING=REPORT
  /TEMPLATE='Directory\Path Robbery Location.sct'
  /TITLE='Incidents by Location' 'NIBRS Analysis'.

The resulting graph looks like this:

incidents_location.jpg (64150 bytes)

Robberies by Weapon.  For each of the three weapon variables, the alpha values are grouped and the groups are recoded with the numeric values for three new variables: wpn1, wpn2, and wpn3.  VALUE LABELS assigns a descriptive label to the values of the new variables.  The RECODE assigns the value of 1 to the new variable wpngrp if the value of wpn1 is 11 through 15 (firearm, handgun, rifle, shotgun, or other firearm).  IF the value of wpn2 or wpn3 is greater than or equal to 11, wpngrp is equal to 14 (multiple weapon).  VALUE LABELS then assigns a descriptive label to the values of the variable wpngrp.

DO REPEAT weapon = weapon1 weapon2 weapon3/
  wpn = wpn1 wpn2 wpn3.
RECODE weapon (convert) INTO wpn.
END REPEAT.
VALUE LABELS wpn 1 to wpn3
  11 'Firearm'  12 'Handgun'  13 'Rifle'  14 'Shotgun'  15 'Other Firearm'
  20 'Knife/Cutting Instrument'  30 'Blunt Object'  35 'Motor Vehicle'
  40 'Personal Weapons'  50 'Poison'  60 'Explosives'  65 'Fire/Incendiary Device'
  70 'Drugs/Narcotics/Sleeping Pills'  85 ' Asphyxiation'  90 'Other'
  95 'Unknown'  99 'None'  0 'Default'.
RECODE wpn1 (11 thru 15 = 1)  (20 = 2)  (30 = 3)  (35 = 4)  (40 = 5)
  (50 = 6)  (60 = 7)  (65 = 8)  (70 = 9)  (85 = 10)  (90 = 11)  (95 = 12)
  (99 = 13)INTO wpngrp.
IF (wpn2 ge 11 or wpn3 ge 11)wpngrp = 14.
VALUE LABELS wpngrp
  1 'Firearm'  2 'Knife'  3 'Bl. Object'  4 'MV'  5 'Personal'   6 'Poison'
  7 'Explosive'  8 'Fire/Incend'  9 'Drugs'  10 'Asphyx'  11 'Other'
  12 'Unknown'  13 'No Wpn'  14 'Multi Wpn'.

Again, the output is defined as a bar graph displaying robberies by weapon.  A TEMPLATE is used to control the appearance of the bar chart.

TEMPORARY.
VARIABLE LABELS wpngrp ' '.
GRAPH
  /BAR(SIMPLE)=COUNT BY wpngrp
  /MISSING=REPORT
  /TEMPLATE='Directory\Path\Robbery Weapons.sct'
  /TITLE='Robberies by Weapon' 'NIBRS Reporting'.

The resulting graph looks like this:

robberies_weapon.jpg (59077 bytes)

Types of Firearms.  IF the value of wpngrp is equal to 1, the RECODE defines five different types of weapons and places those values into the new variable firegrp.  The IF transformation sets another value of firegrp to 6 if the variable autowpn1 is equal to 'A' (automatic).   VALUE LABELS assigns a descriptive label to the values of the variable firegrp.

DO IF (wpngrp = 1)
RECODE weapon1 ('11' = 1)('12' = 2)('13' = 3)('14' = 4)('15' = 5)INTO firegrp.
IF (autowpn1 = 'A')firegrp = 6.
END IF.

VALUE LABELS firegrp
  1 'Firearm'  2 'Handgun'  3 'Rifle'  4 'Shotgun'  5 'Other Firearm'  6 'Automatic'.

The USEALL defines a USE range starting with the first observation and ending with the last observation in the series.  This COMPUTE illustrates the use of a filter to limit the analysis to only those incidents with a wpngrp equal to 1.

USE ALL.
COMPUTE filter_$=(wpngrp = 1).
VARIABLE LABEL filter_$ 'wpngrp = 1 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
 

This output is defined as a bar graph displaying the types of firearms used in robberies.

TEMPORARY.
VARIABLE LABELS firegrp ' '.
GRAPH
  /BAR(SIMPLE)=COUNT BY firegrp
  /MISSING=REPORT
  /TEMPLATE='Directory\Path\Robbery Weapons.sct'
  /TITLE='Types of Firearms' 'NIBRS Reporting'.
 

The resulting graph looks like this:

types_firearms.jpg (35384 bytes)
 

Types of Automatic Firearms.  The USEALL defines a USE range starting with the first observation and ending with the last observation in the series.  This COMPUTE illustrates the use of a filter to limit the analysis to only those incidents with a wpngrp value equal to 1 and a firegrp value equal to 6 (automatic weapon).  VALUE LABELS assigns a descriptive label to the values of the variable weapon1.

USE ALL.
COMPUTE filter_$=(wpngrp = 1 and firegrp = 6).
VARIABLE LABEL filter_$ 'wpngrp = 1(FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMAT filter_$ (f1.0).
FILTER BY filter_$.

VALUE LABELS weapon1
  '11' 'Firearm'  '12' 'Handgun'  '13' 'Rifle'  '14' 'Shotgun'  '15' 'Other Firearm'.

This output is defined as a bar graph displaying the counts of types of automatic firearms used in robberies.

TEMPORARY.
VARIABLE LABELS weapon1 ' '.
GRAPH
  /BAR(SIMPLE)=COUNT BY weapon1
  /MISSING=REPORT
  /TEMPLATE='Directory\Path\Robbery Weapons.sct'
  /TITLE='Types of Automatic Firearms' 'NIBRS Reporting'.
 

The resulting graph looks like this:

automatic_firearms.jpg (34384 bytes)
 

By Multi-Weapon.  On the victim segment, the offender sequence numbers are values in a series of up to ten variables on a victim record.  On the offender segment, the offender sequence number is a unique variable on each offender record.  The following procedures are needed to match victim and offender segments for a victim-offender analysis.

The multi-weapon1.sav file is used to create a series of three temporary files.  Then, each set of DO IF / XSAVE OUTFILE commands creates a temporary file for each valid weapon group number for each incident record.  This set of commands is executed separately for each offender sequence number (OFNSEQ1 through OFNSEQ10).  From each resulting temporary file, the other variable pairings of offender sequence number and offender victim relationship are DROPped and the remaining paired variables are RENAMEd OFNSEQ and OVR.  So, from the offender sequence number 1 temporary file, the variables of offender sequence number 2 - 10 and offender victim relationship 2 - 10 are eliminated; the offender sequence number 1 variable is renamed OFNSEQ and the corresponding offender victim relationship variable is renamed OVR.  This process is repeated for each offender sequence number-offender victim relationship pairing in the victim segment.

DO IF (wpngrp = 14).
XSAVE OUTFILE = 'Directory\Path\multi-weapon1.sav'/
  keep ori inc_num wpn1 autowpn1.
END IF.
DO IF (wpngrp = 14 and wpn2 gt 0).
XSAVE OUTFILE = 'Directory\Path\multi-weapon2.sav'/
  keep = ori inc_num wpn2 autowpn2.
END IF.
DO IF (wpngrp = 14 and wpn3 gt 0).
XSAVE OUTFILE = 'Directory\Path\multi-weapon3.sav/
  keep ori inc_num wpn3 autowpn3.
END IF.
EXECUTE.

GET FILE = 'Directory\Path\multi-weapon1.sav'.
ADD FILES /FILE=*
  /RENAME (wpn1 autowpn1=wpn autowpn)
  /FILE='Directory\Path\multi-weapon2.sav'
  /RENAME (wpn2 autowpn2=wpn autowpn)
  /FILE='Directory\Path\multi-weapon3.sav'
  /RENAME (wpn3 autowpn3=wpn autowpn).
EXECUTE.

RECODE wpn (11 thru 15 = 1)  (20 = 2)  (30 = 3)  (35 = 4)  (40 = 5)  (50 = 6)
  (60 = 7)  (65 = 8)  (70 = 9)  (85 = 10)  (90 = 11)  (95 = 12)  (99 = 13)INTO wpngrp.

VALUE LABELS wpngrp
  1 'Firearm'  2 'Knife'  3 'Bl. Object'  4 'MV'  5 'Personal'   6 'Poison'
  7 'Explosive'  8 'Fire/Incend'  9 'Drugs'  10 'Asphyx'  11 'Other'
  12 'Unknown'  13 'No Wpn'.
TEMPORARY.
VARIABLE LABELS wpngrp ' '.
GRAPH
  /BAR(SIMPLE)=COUNT BY wpngrp
  /MISSING=REPORT
  /TEMPLATE='Directory\Path\Robbery Weapons.sct'
  /TITLE='Multi-Weapons' 'NIBRS Reporting'.

The resulting graph looks like this:

multi-weapons.jpg (38329 bytes)
 

By Multi-Weapons (Firearms).  IF the value of wpngrp is equal to 1, the RECODE defines five different types of weapons and places those values into the new variable firegrp.  The IF transformation sets another value of firegrp to 6 if the variable autopwn1 is equal to 'A' (automatic).   VALUE LABELS assigns a descriptive label to the values of the variable firegrp.

DO IF (wpngrp = 1).
RECODE wpn (11 = 1)(12 = 2)(13 = 3)(14 = 4)(15 = 5)INTO firegrp.
IF (autowpn = 'A')firegrp = 6.
END IF.

VALUE LABELS firegrp
  1 'Firearm'  2 'Handgun'  3 'Rifle'  4 'Shotgun'  5 'Other Firearm'  6 'Automatic'.
 

The USEALL defines a USE range starting with the first observation and ending with thelast observation in the series.  This COMPUTE illustrates the use of a filter to limit the analysis to only those incidents with a wpngrp value equal to 1.

USE ALL.
COMPUTE filter_$=(wpngrp = 1).
VARIABLE LABEL filter_$ 'wpngrp = 1 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected 1 'Selected'.
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
 

This output is defined as a bar graph displaying multi-weapon types of firearms used in robberies.

TEMPORARY.
VARIABLE LABELS firegrp ' '.
GRAPH
  /BAR(SIMPLE)=COUNT BY firegrp
  /MISSING=REPORT
  /TEMPLATE='Directory\Path\Robbery Weapons.sct'
  /TITLE='Multi-Weapon Types of Firearms' 'NIBRS Reporting'.
 

The resulting graph looks like this:

multi-weapon_types.jpg (34722 bytes)
 

Time of Day and Number Cleared.  The COMPUTE creates the new variable cleared and sets its value at 0.  The IF transformation then sets the value of the cleared variable to 1 if clr_excp is equal to 1 or the clr_arr variable is equal to 1.  The variable inc_hr is then RECODEd IF rptdate is equal to 'R', which sets its value to the system missing value of 99.   VALUE LABELS then assigns a descriptive label to the values of the variables cleared and inc_hr.

GET FILE='Dirctory\Path\Robbery Incident.sav'.
COMPUTE cleared = 0.
IF (clr_excp = 1 or clr_arr = 1)cleared = 1.
RECODE inc_hr (sysmis = 99).
IF (rptdate = 'R')inc_hr = 99.
VALUE LABELS cleared
  0 'Not Cleared' 1 'Cleared'.
VALUE LABELS inc_hr
  0 'Midnight-12:59'  1 '1-1:59am'  2 '2-2:59 am'  3 '3-3:59 am'   4 '4-4:59 am'
  5 '5-5:59 am'  6 '6-6:59 am'  7 '7-7:59 am'  8 '8-8:59 am'  9 '9-9:59 am'
  10 '10-10:59 am'  11 '11-11:59 am' 12 'Noon-12:59 pm'  13 '1-1:59 pm'
  14 '2-2:59 pm'  15 '3-3:59 pm'  16 '4-4:59 pm'  17 '5-5:59 pm' 18 '6-6:59 pm'
  19 '7-7:59 pm'  20 '8-8:59 pm'  21 '9-9:59 pm'  22 '10-10:59 pm'   23 '11-11:59 pm'
  99 'Unknown'.

The USEALL defines a USE range starting with the first observation and ending with the last observation in the series.  This COMPUTE illustrates the use of a filter to limit the analysis to only those incidents with a inc_hr of something other than system missing (99).

USE ALL.
COMPUTE filter_$(inc_hr <99).
VARIABLE LABEL filter_$ 'inc_hr <99 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMAT filter_$ (f1.0).
FILTER BY filter_$.

This output is defined as a stacked bar graph which displays the time of day and the number of robberies cleared.

TEMPORARY.
VARIABLE LABELS inc_hr ' '/
  cleared ' '.
GRAPH
  /BAR(STACK)=COUNT BY inc_hr BY cleared
  /MISSING=REPORT
  /TEMPLATE='Directory\Path\Robbery Time of Day.sct'
  /TITLE='Time of Day and Number Cleared' 'NIBRS Reporting'.
SAVE OUTFILE='Directory\Path\Robbery Incident.sav'
  /COMPRESSED.

The resulting graph looks like this:

day_cleared.jpg (59317 bytes)

Time of Day and Percent Cleared.  The AGGREGATE command restructures the data into an incident hour unit of analysis.  The OUTFILE subcommand creates a new system file so that the original file remains unchanged.  Each unique record [see /BREAK=inc_hr] will consist of variables that describe the incident hour in terms of the sum of cleared robberies and the number of offenses for that incident hour.   The COMPUTE creates the new variable percentage cleared (pct_cld) and sets its value to the percentage of robberies cleared.

AGGREGATE /OUTFILE=*
  /BREAK=inc_hr
  /cleared ' ' =SUM(cleared)
  /number ' ' =N(offense).

COMPUTE pct_clrd = ((cleared/number)*100).
FORMATS pct_clrd (f8.1).

The USEALL defines a USE range starting with the first observation and ending with the last observation in the series.  This COMPUTE illustrates the use of a filter to limit the analysis to only those incidents with an incident hour other than unknown.

USE ALL.
COMPUTE filter_$=(inc_hr <99).
VARIABLE LABEL filter_$ 'inc_hr < 99 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMAT filter_$ (f1.0).
FILTER BY filter_$.

This output is defined as a line graph displaying the percentage of robberies cleared for a specific time of day.

TEMPORARY.
VARIABLE LABELS inc_hr ' '/
  pct_clrd ' '.
GRAPH
  /LINE(SIMPLE)=MEAN(pct_clrd) BY inc_hr
  /MISSING=REPORT
  /TEMPLATE='Directory\Path\Robbery Time of Day2.sct'
  /TITLE='Time of Day and Percent Cleared' 'NIBRS Reporting'.

The resulting graph looks like this:

day_percent_cleared.jpg (61722 bytes)