This workshop introduces the Data for Crime Rates of Local Government Areas in New South Wales. The data include information on the crime rate, population, economy and residents of local government areas (LGAs) in New South Wales. The information is from various sources. For detailed descriptions of variables, see “Codebook of Crime Rates of NSW LGAs” on the course website (iLearn). Download Data File for Crime Rates of NSW LGAs from the course website (under the section of Dataset). Then, upload this file to your Google Drive as you did for the 2012 AuSSA. Then, open it in SPSS. Then, you are ready to start the workshop 5.
Moving (or Relocating) variables
When you have many variables in your dataset, it is often hard to locate a specific variable of interest when you browse the data. In that case, you can move a variable to a new location in the Variable View. Suppose that we want to move region2 next to name.
- Click the row number of a variable that you intend to move (in this example, it is region2). This will highlight the row of the selected variable.
- Drag and drop the variable to the new location (in our case, just below name).
- You will see region2 just below name.
- Go to Data View. You will see that region2 is located nicely next to name.
Sorting cases may be necessary when you want to have a close look at the data. Sorting cases will re-arrange the rows (cases) in the dataset by any variable or combination of variables you wish. By default, the cases will be sorted in ascending order (smallest to largest, or alphabetical). But sometimes it may be helpful to sort cases in descending order (largest to smallest, or reverse alphabetical).
Sorting cases by a single variable
Suppose that we want to know which local government area (LGA) in NSW has the highest crime rates of robbery (robbery). Sorting all the NSW LGAs in descending order by robbery will make this job more manageable.
- Go to Data > Sort Cases.
- In the box of Sort Cases, select a variable by which cases will be sorted and move them to the section of Sort by:. And choose Descending in the section of Sort Order. Click OK at the bottom.
- In Data View, you see that cases (LGAs) are sorted by robbery rates. The LGA with the highest rate of robbery is Moree Plains Shire, and the Municipality of Woollahra has the lowest robbery rate (excluding LGAs having missing values on robbery rates).
Sorting cases by multiple variables
It is often the case that we need to sort cases by more than one variable. Suppose that we would like to find an LGA with the highest robbery rates in the Greater Metropolitan Sydney, Murray and Hunter, respectively. To find them, it is necessary to sort all the LGAs by the combination of region2 and robbery.
Go to Data > Sort Cases. In the box of Sort Cases, move region2 first and then robbery to the section of Sort by:. When you use more than one variable on which cases are sorted, the order of variables matters. In this example, the cases will be sorted first by region2. Then, within each region, cases will be sorted by robbery. You can reorder variables in the section of Sort by: by clicking and dragging the variable of which you want to change the order.
You can set either an ascending or descending order for each variable. Click on a variable in the section of Sort by: and choose either Ascending or Descending. In this example, we choose Ascending for region2 and Descending for robbery. Then, click OK.
- In Data View, you will see all the cases sorted by region2 and robbery. LGAs in the Greater Metropolitan Sydney (coded as 1) appear first, those in the Sydney Surrounds (coded as 2) second and so forth. Within the same area, an LGA with the highest robbery rate appears first, and that with the lowest robbery rate appears last. Therefore, you will be able to easily find which LGA has the highest and lowest robbery rate in each area.
Creating z-scores for variables
This section will show how to make a variable in which the value is the standardised score (z-score) of a variable of your choice. Suppose that we want to make a variable which is the z-score of medage (median age of residents).
- To create a variable of z-scores, go to Analyze > Descriptive Statistics > Descriptives.
- Select a variable for which you want to create z-scores and move it to the box of Variable(s). Then, tick the box of Save standardized values as variables. Click OK.
- You will see a newly created variable, Zmedage, in the lowermost row of Variable View. Move this new variable just below to medage for easier comparison. Then, your Data View looks like <Figure 12>.
Workshop Activity 5: Exploring NSW Crime Data
Using the Data for Crime Rates in Local Government Areas in New South Wales, answer the following questions.
Note: External students should post their answers to these four questions on the iLearn. This activity will contribute to your workshop participation marks.