Learning Guide
National Crime Victimization Survey

Stata Syntax

Overview

This example will show how to calculate victimization rates for property and violent crime. Stata syntax statements are presented in the shaded text boxes. Complete, uninterrupted syntax is provided following the step-by-step instructions.

The difficulties in calculating rates are knowing which numbers to use, which files to take them from, and what adjustments need to be made. The four overall steps are:

  1. Use the incidents data to find both the number of property and the number of violent victimizations, the numerators.
  2. Use the households data to find the number of households at risk, which will be the denominator for property crimes.
  3. Use the persons data to find the number of persons age 12 and older at risk, which will be the denominator for violent crimes.
  4. Calculate each rate, dividing the numerators by the denominators and multiplying by 1,000.

Before beginning the exercise below, see Data Files and Variables for instructions on downloading the data files. This exercise is written using the following folder and filenames, without renaming the files:

ICPSR_36448\DS0002\36448-0002-Data.dta
ICPSR_36448\DS0003\36448-0003-Data.dta
ICPSR_36448\DS0004\36448-0004-Data.dta
			

If you use different filenames or a different folder structure, you will need to modify the use commands accordingly.

Steps

Step 1: Find the number of property victimizations and violent victimizations, the numerators.

1a: Access the incident-level data file.

First, change the directory in Stata, to avoid having to specify the base directory name in every new use command. Edit this command to point to the folder where your files are located. (Stata will remember the folder specified by cd until you exit the program.)

Then load the incidents data file. You will use this to calculate the number of violent and property victimizations.

cd "C:\Path\To\Downloads\ICPSR_36448"
use "DS0004\36448-0004-Data.dta", clear
			

1b: Exclude crimes occurring outside the United States.

The victimization rates published by the Bureau of Justice Statistics only include incidents taking place inside the United States. Because some respondents report incidents that occurred in other countries, you will need to take this into account.

Use V4022 to restrict the data to crimes that did not occur outside the U.S.

drop if (V4022 == 1)
			

1c: Create variables that capture the total number of property and violent victimizations.

Codes to identify the specific types of crime are contained in V4529. NCVS codes for violent crimes range from 1 to 20, and codes for property crimes range from 31 to 59.

Use value ranges of V4529 to create new variables indicating violent and property crimes.

recode V4529 (1/20 = 1)(else = 0), gen(VIOLENT)
recode V4529 (31/59 = 1)(else = 0), gen(PROPERTY)
			

1d: Find the weighted numbers of victimizations.

Applying the victimization weight to the data, run a tabulation on your violent crime and property crime variables to receive estimates for the U.S. population.

Make a note of these numbers, as they will be your numerators for the final rate calculations. You should find 5,006,615 violent victimizations and 14,611,043 property victimizations.*

tab VIOLENT [iweight= SERIES_WEIGHT]
tab PROPERTY [iweight= SERIES_WEIGHT]
			

Step 2: Find the number of persons at risk.

You now have the numerators for calculating the rates, and the denominators will be easier. You will find the correct number of persons aged 12 and older (for violent victimizations) and households (for property victimizations), starting with persons.

2a: Access the person-level data file.

Load the persons data file. (Remember to edit this command if you are using a different folder or file name.)

use "DS0003\36448-0003-Data.dta", clear
			

2b: Find the weighted number of persons.

There are no special corrections required for the persons weight. Simply tabulate the data, weighted using the included variable WGTPERCY, to find the total number of persons in the population: 269,526,471.

tab V3001 [iweight=WGTPERCY]
			

Step 3: Find the number of households at risk.

Finding the denominator for households is the same straightforward process as Step 2 for persons.

3a: Access the household-level data file.

Load the households data file. (Remember to edit this command if you are using a different folder or file name.)

use "DS0002\36448-0002-Data.dta", clear
			

3b: Find the weighted number of households.

Tabulate the data, weighted using the included variable WGTHHCY, to find the total number of households in the population: 131,962,257.

tab V2001 [iweight= WGTHHCY]
			

Step 4: Calculate the violent and property victimization rates.

Use Stata's built-in calculator to compute the rates.

display (5006615 / 269526471) * 1000
display (14611043 / 131962257) * 1000
			

You should find that the rate of violent victimization per 1,000 persons is:

5,359,570 � 266,665,162 � 1,000 = 20.1 violent victimizations per 1,000

The rate of property victimization per 1,000 households is:

15,288,467 � 129,492,744 � 1,000 = 118.1 property victimizations per 1,000

Congratulations! You have replicated the official statistics published in Criminal Victimization, 2015.

Complete Syntax

Here is the Stata syntax without all the detailed comments. You can copy, paste, and run these commands. You will need to edit the cd or the use commands to specify the exact location of your data files.

* !! Edit this change directory command to include the path to your saved data.
cd "C:\Path\To\Downloads\ICPSR_36448"

* Access the incident-level data file.
use "DS0004\36448-0004-Data.dta", clear

* Exclude crimes occurring outside the United States.
drop if (V4022 == 1)

* Create variables that capture the total number of property and violent victimizations.
recode V4529 (1/20 = 1)(else = 0), gen(VIOLENT)
recode V4529 (31/59 = 1)(else = 0), gen(PROPERTY)

* Find the weighted numbers of victimizations.
tab VIOLENT [iweight= SERIES_WEIGHT]
tab PROPERTY [iweight= SERIES_WEIGHT]

* Access the person-level data file.
use "DS0003\36448-0003-Data.dta", clear

* Find the weighted number of persons.
tab V3001 [iweight=WGTPERCY]

* Access the household-level data file.
use "DS0002\36448-0002-Data.dta", clear

* Find the weighted number of households.
tab V2001 [iweight= WGTHHCY]

* Calculate the rates.
display (5006615 / 269526471) * 1000
display (14611043 / 131962257) * 1000

				

*Note: Because BJS rounds to the nearest 10, the numbers you will find in this exercise are slightly different from the numbers in the Criminal Victimization, 2015 report.