nasblogger.blogg.se

Spss syntax
Spss syntax








3b: Find the weighted number of households. (Remember to edit this command if you are using a different folder or file name.) get file = "DS0002\households2015.sav". 3a: Access the household-level data file. Step 3: Find the number of households at risk.įinding the denominator for households is the same straightforward process as Step 2 for persons. Weight the data using the included variable WGTPERCY, then run a frequency report to find the total number of persons in the population: 269,526,471. (Remember to edit this command if you are using a different folder or file name.) get file = "DS0003\persons2015.sav". You will find the correct number of persons aged 12 and older (for violent victimizations) and households (for property victimizations), starting with persons. You now have the numerators for calculating the rates, and the denominators will be easier. Step 2: Find the number of persons at risk. You should find 5,006,615 violent victimizations and 14,611,043 property victimizations.* weight by SERIES_WEIGHT.įreq VIOLENT PROPERTY. Make a note of these numbers, as they will be your numerators for the final rate calculations. 1d: Find the weighted numbers of victimizations.Īpply the victimization weight to the data, then run a frequency report on your violent crime and property crime variables to receive estimates for the U.S. Recode V4529 (31 thru 59 = 1)(else = 0) into PROPERTY. recode V4529 (1 thru 20 = 1)(else = 0) into VIOLENT. Use value ranges of V4529 to create new variables indicating violent and property crimes. NCVS codes for violent crimes range from 1 to 20, and codes for property crimes range from 31 to 59. 1c: Create variables that capture the total number of property and violent victimizations.Ĭodes to identify the specific types of crime are contained in V4529. Use V4022 to restrict the data to crimes that did not occur outside the U.S. Because some respondents report incidents that occurred in other countries, you will need to take this into account. The victimization rates published by the Bureau of Justice Statistics only include incidents taking place inside the United States. 1b: Exclude crimes occurring outside the United States. Note: For help finding the path of your data file, right click on the file, select Properties, and see Location. You will use this to calculate the number of violent and property victimizations. (SPSS will remember the folder specified by cd until you exit the program). Edit this command to point to the folder where your files are located. 1a: Access the incident-level data file.įirst, change the working directory in SPSS, to avoid having to specify the base directory name in every new get file command. Steps Step 1: Find the number of property victimizations and violent victimizations, the numerators. If you use different filenames or a different folder structure, you will need to modify the get file commands accordingly. This exercise is written using the following folder and filenames: ICPSR_36448\DS0002\households2015.sav Calculate each rate, dividing the numerators by the denominators and multiplying by 1,000.īefore beginning the exercise below, see Data Files and Variables for instructions on downloading and renaming the data files.Use the persons data to find the number of persons age 12 and older at risk, which will be the denominator for violent crimes.Use the households data to find the number of households at risk, which will be the denominator for property crimes.Use the incidents data to find both the number of property and the number of violent victimizations, the numerators.The difficulties in calculating rates are knowing which numbers to use, which files to take them from, and what adjustments need to be made. Complete, uninterrupted syntax is provided following the step-by-step instructions. SPSS syntax statements are presented in the shaded text boxes.

Spss syntax how to#

This example will show how to calculate victimization rates for property and violent crime.








Spss syntax