Title: APPLIED DATA ANALYSIS IN CRIMINAL JUSTICE
1APPLIED DATA ANALYSIS IN CRIMINAL JUSTICE
- CJ 525
- MONMOUTH UNIVERSITY
- Juan P. Rodriguez
2Lecture 4
3Perspective
- Research Techniques
- Accessing, Examining and Saving Data
- Univariate Analysis Descriptive Statistics
- Constructing (Manipulating) Variables
- Association Multivariate Analysis
- Comparing Group Means Bivariate
- Multivariate Analysis - Regression
4Constructing Variables
- Why Construct New Variables?
- Recoding Existing Variables
- Computing New Variables
- Computations Using Syntax
- Constructing Indices with Syntax
5Why Construct New Variables?
- SS researchers obtain data from many sources
police, hospitals, schools, etc - The data may not be in the way needed by the
researcher - Researcher needs to manipulate the data to recode
existing variables or create new ones more suited
to his/her needs
6Constructing Variables
- Why Construct New Variables?
- Recoding Existing Variables
- Computing New Variables
- Computations Using Syntax
- Constructing Indices with Syntax
7Recoding Existing Variables
- Researchers often want to reconfigure variables
- Existing variables do not measure the concept of
interest - Alcohol intake is measured by how many drinks
- Cultural classification is abstainers (0), social
drinkers (1-2) and alcoholics (3) - This needs recoding of a numerical variable into
a categorical variable
8Recoding Existing Variables
- Class Example
- PRC72 in States dataset is the number of
prisoners executed from 1977-1998. This is a
numerical variable - We will recode to get a variable indicating if a
state carried out an execution from 1977-1998.
This is a categorical variable
9Recoding Existing Variables
10Recoding Existing Variables
11Recoding Existing Variables
12Recoding Existing Variables
13Recoding Existing Variables
14Recoding Existing Variables
15Recoding Existing Variables
16Recoding Existing Variables
17Recoding Existing Variables
18Recoding Existing Variables
19Recoding Existing Variables
20Recoding Existing Variables
- Track the construction of recoded variables
- The values 0 and 1 can be labeled No and Yes in
the Variable view as we learned in last class
21Recoding Existing Variables
22Recoding Existing Variables
23Recoding Existing Variables
- The frequencies command can be used to examine
the distribution of executions - Analyze
- Descriptive Statistics
- Frequencies
24Recoding Existing Variables
25Recoding Existing Variables
26Recoding Existing Variables
27Setting values to missing
- A value coded as missing in the original variable
is not automatically coded as missing in the new
variable it will be coded in the range assigned. - Always ensure that System or User Missing values
in the old variable are coded as System Missing
in the new variable. - Sometimes we want to set actual values to
missing - In the executions data, Texas had more executions
than all other states. - Because Texas is an outlier, some analyses may be
more reliable if its values are separated and
treated as a unique case.
28Setting values to missing
- Transform
- Recode
- Into Different Values
- Input Variable PRC72
- Output Variable Name EXECUT2
- Output Variable label Category Recode of
Executions 1977-1998 - Change
29Setting values to missing
- Old and New Values
- Old Value Value 0
- New Value Value 0
- Add
- Old Value Value 1 through 60
- New Value Value 1
- Add
- Old Value Value 164
- New Value System Missing
- Add
- Continue
- OK
30Constructing Variables
- Why Construct New Variables?
- Recoding Existing Variables
- Computing New Variables
- Computations Using Syntax
- Constructing Indices with Syntax
31Computing New Variables
- Using mathematical functions on one or more
existing variables to create others - We will use the Sort and the Case Summary
functions on CRC344 (Rapes 1998) - Use the Sort and the Case Summaries functions
learned in last class
32Computing New Variables
33Computing New Variables
34Computing New Variables
35Computing New Variables
36Computing New Variables
37Computing New Variables
- More rapes occurred in California (9782) than in
Oklahoma (1513) - This does not answer question of where violent
crime is most problematic population not
considered - Needed Measured number of rapes in reference to
the potential number of occurrences a RATE
38Computing New Variables
- RAPE RATE
- How many rapes occur for every 100,000 people
- States data set includes incidence and rate
- Lets look at CRC347 (Rape Rate in 1998)
39Computing New Variables
40Computing New Variables
41Computing New Variables
42Computing New Variables
43Computing New Variables
44Computing New Variables
- CRC347 shows that, in relation to its population,
California has a lower rate of rape than Oklahoma
(29.9 vs. 45.2 per 100,000 people)
45Computing New Variables
- Question
- Where should LEAs focus financial resources to
control violent crime (murders, bombings, rapes,
etc.)? - Calculate how much each of the types of crime
contributes to the total number of violent crimes - We need to compute these variables
46Computing New Variables
- of violent crimes that are rapes
- Number of rapes (CRC344) / Number of Violent
Crimes (CRC315) x 100 - Well use the Compute command to calculate
variable RAPEPCT, Rapes as of Violent Crimes
1998
47- Transform
- Compute
- Target Variable RAPECT
- Numeric Expression (CRC344/CRC315)100
- TypeLabel
- Label rape as of Violent Crimes in 1998
- Continue
- OK
48Computing New Variables
49Computing New Variables
50Computing New Variables
51Computing New Variables
52Computing New Variables
53Computing New Variables
54Checking the new Variable
- Use Univariate Analysis to check that data in
variable is OK - Positive code cleaning
- Use Frequencies or Descriptives to ensure no
value is lower than 0 or higher than 100
55Checking the New Variable
56Checking the New Variable
57Checking the New Variable
58Checking the new Variable
- Use Univariate Analysis to check that data in
variable is OK - Positive code cleaning
- Use Frequencies or Descriptives to ensure no
value is lower than 0 or higher than 100 - Contingency Cleaning
- Comparing the Constructed Variable to other
existing Variables Rapes are a violent crime
that is likely prevalent in states where other
violent crimes are prevalent
59Checking the new Variable
60Checking the new Variable
61Checking the new Variable
62Checking the New Variable
- Looking at the Case Summaries output, the
calculations seem to be correct - In ND rapes are 37 of the violent crimes whereas
in DC they are only 2
63Computing New Variables
- Another reason for Computing New Variables
- Examining the difference between 2 groups for the
same attribute - How has the teenage birth rate changed from 1980
to 1990 among the states? - Well create a new variable, TEENCH
- TEENCH BIH38 BIH41
- Well use the Compute command for this
64Computing New Variables
- Transform
- Compute
- Target Variable TEENCH
- Numeric Expression BIH38 BIH41
- TypeLabel
- Label Change in Teen Birth Rate 1990-1980
- Continue
- OK
65Computing TEENCH
66Computing TEENCH
67Computing TEENCH
68Computing TEENCH
69Computing TEENCH
70Computing TEENCH
71Checking TEENCH
- Descriptive Statistics
- Histogram
72Checking TEENCH
73Checking TEENCH
74Checking TEENCH
75Checking TEENCH
76Checking TEENCH
77Using Syntax
- Creating and Using new variables require record
keeping and data management - SPSS permits pasting of procedures written in
SPSS language into a Syntax file which can then
be stored and, when run, cause the SPSS processor
to perform the indicated operations
78Using Syntax
- Well use Syntax to create TEENCH2
79Creating TEENCH2 with Syntax
80Creating TEENCH2 with Syntax
81Creating TEENCH2 with Syntax
82Creating TEENCH2 with Syntax
83Creating TEENCH2 with Syntax
84Creating TEENCH2 with Syntax
85Creating TEENCH2 with Syntax
86Creating TEENCH2 with Syntax
87Creating TEENCH2 with Syntax
88Constructing an Index
- Index
- Single score that summarizes responses to a
number of variables - Used to measure an underlying concept that is not
easily measured with a single indicator - Attitudes toward abortion
89Constructing an Index
- Dataset GSS98
- ABANY
- ABDEFECT
- ABHLTH
- ABNOMORE
- ABPOOR
- ABRAPE
90Constructing an Index
- Simplest Index is the SUM of values a score of 6
means respondent favors abortion rights, a score
of 0 means respondent does not - Well use averages, rather than sum because of
the way missing values are treated
91Creating ABINDX
92Creating ABINDX
93Creating ABINDX
94Creating ABINDX
95Creating ABINDX
96Creating ABINDX
97Creating ABINDX