Matching Census Data to Postal Codes using SPSS
The Canadian Census does not use postal codes as a geographic unit. If researchers want to match census data to postal codes, they need to use the Postal Code Conversion Files (PCCF). The PCCF allows one to combine census data and postal codes in one file (see figure 1).
The most appropriate levels of census geographies to link to postal codes are dissemination areas  (DAs), which cover all of Canada, and census tracts (CTs), which occur in urban areas only.
This guide shows you how to match census data to postal codes, and how to merge them in a
Summary of Steps:
- Obtain the census data from CHASS Census Analyser and save it as a .sav file
- Download postal code data from the the Map and Data Library Website
- Processing and subsetting the raw postal code data file
- Merge the two files in SPSS
Go to the Data Library homepage: http://data.library.utoronto.ca/ and click the link CHASS Census Analyzer.
To access census data on the DA-level (Dissemination Area), click on the link Enumeration area/ Dissemination area.
CHASS has divided up the census variables into subheadings so as to facilitate selecting the variables. Since we will be selecting income variables from the 2006 census, we will click on Income and earnings and housing and shelter costs.
You can now select the census data and location you are interested in.
In the Census Division window, select Toronto. If you want to add other census divisions, press your Ctrl key and make further selections.
Once you have submitted your query, the data will be displayed in your browser:
It is now time to download the data. Please note the instructions below work in the Firefox and Chrome browsers.
Now that you have downloaded your census data and saved it as a .sav file, you need to open it in
Go to the location where you have saved your file, and double-click on it. Be patient,
It is now time to get the Postal Code Conversion Files (PCCF). Go back to the Data Library Homepage: http://data.library.utoronto.ca/
On the "Postal code conversion file (PCCF)" page scroll down to find the PCCF edition that goes with your data. You may review the reference guides to determine the ideal combination. In this example we are using data from the 2006 census so, we will select the most recent PCCF edition that uses 2006 census geography.
You will be asked to log on with your UTORid.
Save the file onto your computer. The file will be zipped and you will need to extract it before use.
The extracted folder should contain a raw data file with and a .txt extension and a spss syntax file with a .sps file extension. There may also be other files which could include a formatted spss data file with a .sav extension.
These files are ready to be processed and used.
The purpose of this step to get rid of variables and observations that will not be useful for your analysis. For example if you have data for Toronto you may not want gepographic records for the rest of Canada. Also the postal code data contains postal codes that have been retired. You can create a best match version with only active potal codes. If you want the complete data file including all geographic variables and retired postal codes you may use the already formatted SPSS data file with the .sav extension and skip this step.
Double click the SPSS syntax file to open it.
Once the file is opened in SPSS you will need to insert the file pathway to where you saved the raw data file. This will tell SPSS where to find the data that you are trying to format.
You will also need to tell SPSS where to save the formatted data file. Scroll to the bottom of the screen.
Now we will subset the datafile to give us the observations that match the geography you need and to create a 'Best Match' file with only active postal codes. For this process we will use the 'Select if' command. In the example below we inserted the line: Select if (cduid=3520 and sli=1).
Now we will tell SPSS to keep only the variables we plan to use. For this we are using the 'KEEP' command. For a description of variable names used in the PCCF please see the Reference Guide. In the example below we inserted the line: /KEEP postcode cduid csdname dauid sli.
We will now run the syntax file.
A formatted .sav will be created with the location and name you identified. Open the file to check if your subsetting worked.
Click on Data -> Merge Files –> Add Variables
Use the browse feature to locate the data you are merging with the PCCF and click continue.
Click OK and your merged file will be displayed:
--------------------------------------------------------------------------------  Prior to 2001, DAs were called enumeration areas.