Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula...

25
1 Tutorial 16: Working with Census Data in ArcMap and Integrating Databases in .csv Format. Tutorial Content 16.1. Registering to use CasWeb Census Data and UK Borders Boundary Data 16.2. Census Data: Downloading from CasWeb 16.3. Getting ready a .cvs file 16.4. Downloading UKBoundary Data via Edina 16.5. Adding the Data to ArcMap. 16.6. Joining Tables in ArcMap 16.1. Registering to use CasWeb Census Data and UK Borders Boundary Data To access the CasWeb census data and the UK Borders boundary data you first need to register. To register, login into MUSE, click on the Library tab and select Subject Databases. Choose Alphabetical Table, click on C. Scroll down and click on Census 1981, 1991 & 2001. In the Quick Links on the right hand side of the page, click on Census registration service (CRS). Complete the registration pages.

Transcript of Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula...

Page 1: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

1

Tutorial 16: Working with Census Data in ArcMap and Integrating Databases in .csv Format. Tutorial Content 16.1. Registering to use CasWeb Census Data and UK Borders Boundary Data 16.2. Census Data: Downloading from CasWeb 16.3. Getting ready a .cvs file

16.4. Downloading UKBoundary Data via Edina 16.5. Adding the Data to ArcMap. 16.6. Joining Tables in ArcMap 16.1. Registering to use CasWeb Census Data and UK Borders Boundary Data

To access the CasWeb census data and the UK Borders boundary data you first need to register. To register, login into MUSE, click on the Library tab and select Subject Databases. Choose Alphabetical Table, click on C. Scroll down and click on Census 1981, 1991 & 2001.

In the Quick Links on the right hand side of the page, click on Census registration service (CRS). Complete the

registration pages.

Page 2: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

2

To access the 2001 census data, you will need to read and accept the conditions for different that data when prompted to do so.

You will receive an e-mail from [email protected] with a web link in it. Click on the link in the e-mail to complete your registration.

16.2. Census Data: Downloading from CasWeb

Access CasWeb through MUSE. Login to MUSE, click on the Library tab and select Subject Databases. Choose Alphabetical Table, click on C. Scroll down and click on Census 1981, 1991 & 2001. Click on Connect to CasWeb in the Quick Links section on the right hand side.

Page 3: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

3

Click on 2001 Aggregate Statistics Datasets (with digital boundary data)

You will have to read and accept the conditions for the different regions listed, after you accept you will re-directed to the following web page: Click on Proceed to the 2001 Aggregate Statistics Datasets.

Note: You will receive an e-mail from [email protected] confirming the acceptance of conditions.

Page 4: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

4

Click on Select lower geographies.

Tick the box next to the option D Yorkshire and The Humber. Click on Select Counties.

Page 5: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

5

Tick the box next to the option for South Yorkshire. Click on Select Districts.

Tick the box next to Sheffield. Click on Select CAS Wards.

There are now two options depending on what level of data you require. Option 1: If you want all 29 wards which compose Sheffield, tick the box next to all the wards, then click Select output level.

Option 2

If you want to look at the census data in more detail for specific wards, tick next to the CAS wards you are interested in and then click Select Output Areas.

Page 6: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

6

To select all the output areas that make up the wards you are interested in, tick all the boxes, and then click Select output level.

Page 7: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

7

In this case we have selected option 1 – all the wards in Sheffield – and have clicked Select output level. If you want the detail at Ward level, accept the default option ‘CAS Ward’ as the output geography at the bottom of the page. If you want the wards split into output areas, select ‘OA’. Then click Select data. . .

Now we need to select what data we are interested in. In this case we will look at ethnicity. Click on KS006 Ethnic Group and click Display Table Layout

Page 8: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

8

To download all the data for ethnicity tick the box Select all.

Then click on Add variable to data selection.

The selected data is added to variable list on the right hand side of the screen. We need to change the names of the columns so they make more sense. Click on the top column name and then click Rename.

This column is ks0060001, the ‘1’ corresponds to the ‘1’ in the table, which is ‘all people’, so rename it all_people.

Page 9: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

9

Rename all the columns. Avoid having any spaces, use an underscore (_) instead of a space and try to keep the titles to a maximum of 10 characters. You can always change them in Excel later on.

You can know select more census data to download by clicking on the click here link option or you can download your selected data by clicking on Get data. In this case, we will just click Get data.

Give the file a name, such as ethnicity, and then choose the format you required:

Plain text will give you a .csv file which can be open with Excel and integrated to GIS later or; Digital Boundary Data will give you a shapefile to be use in GIS; this integrates boundary data and census

aggregate data. Then click Execute query.

Page 10: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

10

Click on ethnicity.zip under Download data file, to download the census information.

Choose somewhere to save the .zip file. Extract the .zip file and the shapefile will be ready to be added to your .mxd project

If you chose to download the .cvs file or other data was only available on such format then follow the next steps:

Page 11: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

11

16.3. Getting ready a .csv file

Follow the previous instructions but select to download the ‘Plain text’ format option. Open your ethnicity.csv file in Excel. Each ward is given its own line of data.

The number of people from each ethnic minority are listed across the different columns, using the new column headings we created in CasWeb. The numbers are not that useful for use in GIS. It would be better to convert them into percentages. In this case we will create two new columns in the Excel spreadsheet. The first will calculate the total number of ethnic minority people in each ward. The second column will divide the total number of ethnic minority people by the total people (which is listed in the column ‘all_people’). Scroll along and create a new column with the heading Tot_ethnic (to keep the name under 10 characters).

Page 12: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

12

Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the sell that we want the total to appear in and then click on AutoSum and select Sum from the drop down list

Excel will automatically total the row (C2 to S2).

But we only want to total (G2 to S2). So, click in G2 with the mouse, then hold down and drag along to S2, then let go. Cells G2 to S2 will be selected and the sum will update.

Press return on the keyboard and the total will appear in the column. Now we want to copy the formula down the rest of the column. Click on the cell and hover near the bottom right hand corner of it until the mouse changes to a cross hair. Click and then drag down until you have got to the bottom of the data. The total will be calculated for all the rows.

Page 13: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

13

Now create another column with the heading Per_Ethnic (to keep the name under 10 characters). We want to

divide the total ethnic minority column by the all_people column and then make it a percentage. Click in the first cell and then in the formula bar type =(T2/C2)* and click return on the keyboard. Now copy the formula down the

rest of the column. Click on the decrease decimal icon to round off the decimal points.

Page 14: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

14

Next we want to copy the values from both columns. Click on cell T1 and hold down and drag the mouse to cell U30, so that the two columns have a box round them. Right click in the grey box and select Copy from the drop down list.

Click in cell V1, hold down the mouse button and drag to cell W30. Right click in the grey and select Paste Special...

Page 15: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

15

In the ‘Paste Special’ widow, select the option Values and click OK.

We don’t need the columns with the formulas so you can now delete columns T and U. Click on the letters at the top and then right click and select Delete.

Some of the other column headings are longer than 10 characters so shorten them now or delete the columns if you no longer require them. Remove all spaces from the column headings. Click and drag a box to highlight all the cells with data, then do a Save As and select Other Formats.

Page 16: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

16

Save the file on your U:drive as a .csv. If you don’t want to save over the top of the original .csv file give the file a new name. Close Excel

Page 17: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

17

16.4. Downloading UKBoundary Data via Edina

Login to MUSE, click on the Library tab and select Subject Databases. Choose Alphabetical Table, click on C. Scroll down and click on Census 1981, 1991 & 2001. In the Quick Links section on the right hand side of the screen click Connect to UK BORDERS.

Click on Boundary Data Selector.

Select ‘England’, ‘Census Boundaries’ and ‘post 1999’. Click ‘Find’.

Page 18: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

18

Select the boundary for the level of detail required. The boundary level required will depend on what census data you have downloaded. Most common are:

Statistic Wards, 2001: 29 wards in Sheffield

Output Areas, 2001: more detailed, each ward consists of several output areas. Note: You can also download administrative boundaries, electoral boundaries, environmental boundaries, postal boundaries, historical boundaries (pre-1971 census and administrative boundaries from 1840 onwards) from UKBorders. Then, click List Areas.

Select South Yorkshire, and then click Expand. Select Sheffield [South Yorkshire], and then click Extract Boundary Data.

Click on the BoundaryData.zip

Save the zip file to your U:drive. Navigate to the zip file and unzip its contents.

Page 19: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

19

16.5. Adding the Data to ArcMap.

Open ArcMap. Select Add Data and add the UKBorders shapefile.

Click Close in the warning window.

Census output is Crown copyright and is reproduced with the permission of the Controller of HMSO and the Queen's Printer for Scotland. Source: 2001 Census, Output Area Boundaries. Crown copyright 2003. Ordnance Survey Map Data: © Crown Copyright/database right 2009. An Ordnance Survey/EDINA supplied service.

Page 20: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

20

Now add the census data. Navigate to the folder where your .csv file is saved. Click Add.

ArcMap will display the .csv file on the source tab.

Page 21: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

21

16.6. Joining Tables in ArcMap

Now we need to join the ethnicity data to the ward boundary data. First we need to find a column in both tables that has a common field. In the table of contents, right click on the ward boundary layer: ‘england_caswa_2001’. Select Open Attribute Table.

In the table of contents, right click on the ethnicity.csv. Select Open.

Looking at the tables, there are two columns where the fields could be used to create a join: ‘ons_label’ with ‘ZoneCode’, and ‘name’ with ‘ZoneName’. We will use ons_label and ZoneCode. Close the tables. In the table of contents, right click on the ward boundary layer: ‘england_caswa_2001’. Select Joins and Relates and then Joins...

Page 22: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

22

1. Select ons_label

2. Accept the default

3. Select ZoneCode

Click OK

Now open the attribute table for ‘england_caswa_2001’. If you scroll along you will see that the data from ethnicity.csv has been added. Exporting Features to Create a New Shapefile

Now we want to export the data to create a new shapefile. On the display tab, right click on ‘england_caswa_2001’ in the table of contents. Select Selection and then Select All.

Page 23: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

23

Now right click on ‘england_caswa_2001’ in the table of contents. Select Data and then Export Data...

Census output is Crown copyright and is reproduced with the permission of the Controller of HMSO and the Queen's Printer for Scotland. Source: 2001 Census, Output Area Boundaries. Crown copyright 2003. Ordnance Survey Map Data: © Crown Copyright/database right 2009. An Ordnance Survey/EDINA supplied service.

You want to export all the selected features so accept the defaults: Selected features and ‘this layer’s source data’.

Browse to a folder to save your output shapefile and give it a name, such as ‘ethnicity_2001’ Click OK.

Click Yes, when prompted to add the shapefile.

Page 24: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

24

You can now remove the join from the ‘England_caswa_2001’. Right click on the layer name in the table of contents. Select Joins and Relates, Remove Join(s), ethnicity.csv

Census output is Crown copyright and is reproduced with the permission of the Controller of HMSO and the Queen's Printer for Scotland. Source: 2001 Census, Output Area Boundaries. Crown copyright 2003. Ordnance Survey Map Data: © Crown Copyright/database right 2009. An Ordnance Survey/EDINA supplied service.

You can now colour ‘ethnicity_2001’ using a graduated colour to show the percentage of ethnic minorities in each ward.

Page 25: Tutorial 16 - University of Sheffield/file/tutorial16.pdf · Next we want to use an excel formula to add up the total number of ethnic minority people (cells G2 to S2). Click in the

25

Census output is Crown copyright and is reproduced with the permission of the Controller of HMSO and the Queen's Printer for Scotland. Source: 2001 Census, Output Area Boundaries. Crown copyright 2003. Source: 2001 Census: Standard Area Statistics (England and Wales). Ordnance Survey Map Data: © Crown Copyright/database right 2009. An Ordnance Survey/EDINA supplied service.