spacer spacer spacer
JRSA's IBR Resource Center
Return to Main Page
Background and Status of Incident-Based Reporting and NIBRS
State Profiles
Using Incident-Based and NIBRS Data
References and Related Sites
Available Syntax and Sample Data Files
line divider
IBRRC Fact Sheet
Contribute Information
Site Map
Justice Research and Statistics Association (JRSA) Home
 
Notice of Federal Funding and Federal Disclaimer
 

Frequency Distribution for Victim-Offender Relationship by Offender and Victim Age Groups and Location of Robbery

Donald Faggiani and Myra G. Owens

Download SPSS syntax

This example looks at the location of offenses, the relationship between victims and offenders, the age of offenders, and the age of victims.  Offenses occurring in a residence are the main focus, so locations are divided into two categories - occurring at a home or residence and other.  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.

The assumptions for the following example of code are:
  1. The data file was created as described in "Reading A Multi-Level Data File."
  2. An aggregated flat file was created as described in "Creating An Incident-Level Aggregated Flat File in SPSS"; and
  3. The individual data segments were saved in separate files as described in "Creating An Incident-Level Aggregated Flat File in SPSS".
  4. Additional variables were defined as in "Preparing Individual File Segments for Detailed Analysis in SPSS / Example of Single Segment Analyses Using SPSS".

Preparing the File.  The unit of analysis for this research question is the offense.  To provide incident-level details, the offense segment file is matched to the victim segment.   From the single segment analysis file saved in Example of Single Segment Analyses Using SPSS, only the records for juvenile multiple offender incidents are saved to a new file, Robbery Victims.sav by selecting records in which robbery is an offense and the victim is of the type "individual".  This reduces the volume of records and data to make the matching exercise more manageable.

GET FILE='Directory\Path\victim segment 1999.sav'.
COMPUTE robbery = 0.
DO REPEAT voff = voff1 to voff10.
IF (voff = 120 and v_type = 'I')robbery = 1.
END REPEAT.

SELECT IF (robbery = 1).
SAVE OUTFILE = 'Directory\Path\Robbery Victims.sav'.

In 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 temporary file Robbery Victims.sav is used to create a series of ten temporary files.   First, the file is sorted on originating agency identifier, incident number, and victim number.  Then, each set of DO IF/ XSAVE OUTFILE commands creates a temporary file for each valid offender sequence number for each victim 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.

GET FILE = 'Directory\Path\Robbery Victims.sav'.
SORT CASES BY ori inc_num vic_num.
DO IF (ofnseq1 gt 0).
XSAVE OUTFILE = 'Directory\Path\ofnseq1.sav'
  /DROP = ofnseq2 to ofnseq10 ovr2 to ovr10
  /RENAME = (ofnseq1 ovr1 = ofnseq ovr).
END IF.
DO IF (ofnseq2 gt 0).
XSAVE OUTFILE = 'Directory\Path\ofnseq2.sav'
  /DROP = ofnseq1 ofnseq3 to ofnseq10 ovr1 ovr3 to ovr10
  /RENAME = (ofnseq2 ovr2 = ofnseq ovr).
END IF.
DO IF (ofnseq3 gt 0).
XSAVE OUTFILE = 'Directory\Path\ofnseq3.sav'
  /DROP = ofnseq1 ofnseq2 ofnseq4 to ofnseq10 ovr1 ovr2 ovr4 to ovr10
  /RENAME = (ofnseq3 ovr3 = ofnseq ovr).
END IF.
DO IF (ofnseq4 gt 0).
XSAVE OUTFILE = 'Directory\Path\ofnseq4.sav'
  /DROP = ofnseq1 ofnseq2 ofnseq3 ofnseq5 to ofnseq10 ovr1 ovr2 ovr3 ovr5 to ovr10
  /RENAME = (ofnseq4 ovr4 = ofnseq ovr).
END IF.
DO IF (ofnseq5 gt 0).
XSAVE OUTFILE = 'Directory\Path\ofnseq5.sav'
  /DROP = ofnseq1 to ofnseq4 ofnseq6 to ofnseq10 ovr1 to ovr4 ovr6 to ovr10
  /RENAME = (ofnseq5 ovr5 = ofnseq ovr).
END IF.
DO IF (ofnseq6 gt 0).
XSAVE OUTFILE = 'Directory\Path\ofnseq6.sav'
  /DROP = ofnseq1 to ofnseq5 ofnseq7 to ofnseq10 ovr1 to ovr5 ovr7 to ovr10
  /RENAME = (ofnseq6 ovr6 = ofnseq ovr).
END IF.
DO IF (ofnseq7 gt 0).
XSAVE OUTFILE = 'Directory\Path\ofnseq7.sav'
  /DROP = ofnseq1 to ofnseq6 ofnseq8 to ofnseq10 ovr1 to ovr6 ovr8 to ovr10
  /RENAME = (ofnseq7 ovr7 = ofnseq ovr).
END IF.
DO IF (ofnseq8 gt 0).
XSAVE OUTFILE = 'Directory\Path\ofnseq8.sav'
  /DROP = ofnseq1 to ofnseq7 ofnseq9 to ofnseq10 ovr1 to ovr7 ovr9 to ovr10
  /RENAME = (ofnseq8 ovr8 = ofnseq ovr).
END IF.
DO IF (ofnseq9 gt 0).
XSAVE OUTFILE = 'Directory\Path\ofnseq9.sav'
  /DROP = ofnseq1 to ofnseq8 ofnseq10 ovr1 to ovr8 ovr10
  /RENAME = (ofnseq9 ovr9 = ofnseq ovr).
END IF.
DO IF (ofnseq10 gt 0).
XSAVE OUTFILE = 'Directory\Path\ofnseq10.sav'
  /DROP = ofnseq1 to ofnseq9 ovr1 to ovr9
  /RENAME = (ofnseq10 ovr10 = ofnseq ovr).
END IF.
EXECUTE.

The ten temporary files are concatenated, sorted by originating agency identifier, incident number, the new variable offender sequence number and victim number, and saved into a temporary file, vofnseq.sav.

ADD FILES /FILE= 'Directory\Path\ofnseq1.sav'
  /FILE = 'Directory\Path\ofnseq2.sav'
  /FILE = 'Directory\Path\ofnseq3.sav'
  /FILE = 'Directory\Path\ofnseq4.sav'
  /FILE = 'Directory\Path\ofnseq5.sav'
  /FILE = 'Directory\Path\ofnseq6.sav'
  /FILE = 'Directory\Path\ofnseq7.sav'
  /FILE = 'Directory\Path\ofnseq8.sav'
  /FILE = 'Directory\Path\ofnseq9.sav'
  /FILE = 'Directory\Path\ofnseq10.sav'.
SORT CASES BY ori inc_num ofnseq vic_num.
SAVE OUTFILE = 'Directory\Path\vofnseq.sav'.

The MATCH FILES command matches the active file (vofnseq.sav) for any incident in which a victim of the "individual" type reported a robbery offense, with the offender segment records.  The offender file must also be sorted on the variables ori, inc_num, and ofnseq before executing the command.

MATCH FILES /FILE=*
  /TABLE='Directory\Path\Offender segment 1999.sav'
  /BY ori inc_num ofnseq
  /DROP inc_date v_ethnic v_inj1 v_inj2 v_inj3 v_inj4 v_inj5 v_race v_resid vcircum1 vcircum2 vic_age
   vic_sex vjusthom voff1 voff10 voff2 voff3 voff4 voff5 voff6 voff7 voff8 voff9.
SAVE OUTFILE = 'Directory\Path\vofnseq.sav'.

MATCH FILES /FILE=*
  /TABLE='Directory\Path\Incident 1999.sav'
  /BY ori inc_num
  /DROP aggasl arfemale arr0509 arr1017 arr1524 arr65 arr_cnt arradult arrmale asl_arr att_comp bur
   bur_arr clr_arr clr_excp firearm inc_dy inc_mo inc_yr indivl lar lar_arr msioff mur mur_arr mvt mvt_arr
   oasl_arr off1017 off1524 off65 off_cnt offadult offemale offmale ofns_cnt oth_asl rap rap_arr
   rob rob_arr vadult vage1017 vage1524 vage65 vfemale vic_cnt vic_inj vlt18 vmale.
SAVE OUTFILE = 'Directory\Path\Robbery victim-offender incident.sav'.

This RECODE groups the values for the variable victim-offender relationship into two numeric categories and names the new variable ovr_rcd.  DO IF selects cases in which a victim-offender relationship is not applicable (i.e., not for a person offense).   Not applicable and system missing entries are defined as MISSING VALUES, and VALUE LABELS are assigned to all relationship categories.  VARIABLE LABELS assigns a variable name to ovr_rcd, and FREQuencies are requested to verify the recode.  The resulting file is saved to robbery.sav.

RECODE ovr ('SE', 'CS', 'PA', 'SB', 'CH', 'GP', 'GC', 'IL', 'SP', 'SC', 'SS', 'OF', 'XS', 'VO', 'AQ',
'FR', 'NE', 'BE', 'BG', 'CF', 'HR' ,'EE', 'ER', 'OK' = 1)('ST' = 2)('RU' = -1)INTO ovr_rcd.
MISSING VALUES ovr_rcd (-1).
VALUE LABELS ovr_rcd
  1 'Known to Victim'  2 'Stranger'  -1 'Missing Information'.
VARIABLE LABELS  ovr_rcd 'Recoded Victim-Offender Rel'
FREQ ovr_rcd
RECODE inc_loc (20 = 1)(else = 0)INTO location.
VALUE LABELS location 1 'Offense occurred at a home or residence' 0 'Other location'.
RECODE v_age (.1 thru 64 = 1)(65 thru 98 = 2)INTO vagegrp.
VALUE LABELS vagegrp 1 'Under 65'  2 'Age 65 or older'.
SAVE OUTFILE = 'Directory\Path\Robbery victim-offender incident.sav'.

Producing the Output.  To determine the frequency distribution for victim-offender relationship by offender and victim age groups in which the most serious offense is a Part 1 Index robbery, the file in which the segments were matched is opened.  The output is defined as a frequency table in descending order of the number of occurrences, and the table title and offense labels are assigned for this table only.

SET TLook 'Directory\Path\Academic 2.tlo' TFit Labels.
TEMPORARY.
  VARIABLE LABELS oagegrp "ovr_rcd" vagegrp "location".
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /TABLE=oagegrp > ovr_rcd BY vagegrp > location
  /STATISTICS
  COUNT( location(F5.0) 'Number')
  CPCT( location( PCT5.1 ) '(%)':vagegrp location )
  /TITLE 'Frequency Distribution for Victim-Offender Relationship by Offender and' + 'Victim Age Groups and Location for Robbery'.

The resulting table looks like this:

location_robbery.jpg (27449 bytes)