![]() |
MCHB/EPI Miami Training — December 5 - 6, 2005
Visualization of MCH Data using ArcMap & EpiMap — Transcript
RAVI SHARMA: Let's get started with the hands-on. So without much ado. I'm not going to actually show you this on my laptop, because it will take me ages to get that booted. So I'm going to ask you to go to your start button on your — on, you know, and click on start and go to Arc GIS. Let's see if I can maybe if I don't — I can do this. So go to start. All programs. And there should be, this is my laptop. So it's crammed with all kinds of programs. Don't worry about it. But make sure you go to one that says Arc GIS. Right? Arc GIS has several different associated, some of them are what we call toolboxes and some of them are modules. You will get a chance to play with ARC Catalog, which is a great tool for cataloging data and using ARC Catalog to find out the spatial features of your maps. For example, the coordinate that your map is in. And the meta features of your data.
So there will be one exercise on the ARC Catalog.
UNKNOWN SPEAKER: Can the ARC catalog help us with the meta data components?
RAVI SHARMA: Yes you can set it. Absolutely.
UNKNOWN SPEAKER: Cool.
RAVI SHARMA: So we'll actually use ARC Catalog. A very good practice for you to get into is create folders for every file. ARC GIS is notorious for creating — for example to create what you would call a map file, you need an SHP, SHX, SHB and there is another one, PRF2. But you need at least these three to define a map. So it's very important when you start creating different map files, it will just multiply. So for each level, each geographic level, each data set that you create a file, keep your map files in one folder, create a separate folder, your attribute data. This is the data that you are interested in linking with the map. So this way you will develop good GIS database habits. Right?
And what I find is I have so many map files, I am just always lost. So I got into the practice of creating folders.
ArcMap is a program we're going to be using and later on if we have time we'll go to the other ones. But we'll be using ARC Tools, a versatile program. What ARC Tools does, it takes all the tools from all the different sections of ARC GIS and puts them in one — and we're going to look at it. So click on ArcMap, please.
Click on ArcMap. And in a few seconds you should have — once you get ArcMap, you will see it asks for a download for adding data. Just click out of that, please. Click out of that. What we want to do is to click on this. This symbol here on the top here, I don't have a — is there a pointer somewhere? Do we have a pointer? No. Do you have a pointer?
UNKNOWN SPEAKER: Yes. They're getting it.
RAVI SHARMA: Okay. So I will show you how — where we're going to get this map. But I just wanted to explain some of the features of ARC. So this we call — this section of ARC GIS Map, display we call it, table of content or TOC, to be short. So the table of content will be where you add all your different layers and your attribute data can also be displayed actually without linking it to the map.
So once you have — and then you have file added view. Very similar to ARC — to XP Windows commands. So we're going to learn as we go along. But I'd like you to click on plus, the plus sign here. All right. So this plus sign is the sign for adding data to your map. So please click on the add data. Then you add data, we want to add the data set that is on your desktop. As you know, the desktop is not here. So you have to click on, if you see this arrow here, this is an arrow to add additional drives to your add data. So click on that. So click on My Computer, because My Computer is where you have — let's go back and make sure you're doing it correctly. Click on Connect to Folder. This is a Connect to Folder. Click on that. And you should see GIS MCH. At the very bottom.
How are we doing? When you connect to folder using the right arrow sign, get to the GIS MCH. Z, how are we doing? Connected? Good.
Okay. So once you're at this level, you need to click on the plus sign to expand it. Click on the expand sign in front of GIS MCH to expand so we can have access to other folders. And then let's go to geography and data. Click on geography and data. And then click okay. And then you will see a file called — this file is called PAMCH.SHP. So that's the designation that this is a ARC GIS shape file.
And you can see this line. That means this is a feature. With a box around it, it's a polygon file. And once you are at this, add data level. Just click on MACH.SHP. And then you should get this map here of Pennsylvania . As you can see here, there's 67 counties last and Philadelphia is a county also.
I have great memories of Philadelphia since my al ma in Pennsylvania is the city of brotherly love. I wonder if there's still some love left there.
Are we all there? Good.
So what we have is a shape file. So this is what we call in technical terms a shape file. Some people call it boundary file and map file and so on. Now, where do I get a map file or a boundary file or a shape file like this? There are two ways to do it. Actually, three ways. One, when you buy ARC GIS software package, it comes with tons of data already created for you and one of them is for the U.S. that has boundary files for, you know, U.S. states counties and census tracks.
Now I find it a little difficult to use those DVDs. So typically what I do is I go to www census.gov to down load the share file or ESRI.com to download a shape file. Have you all done it? No?
I'll be just very brief since I don't want to get off — what you will do is just to show you.
If you click on Internet Explorer click on the Internet Explorer and type, on the address type census. C-e-n-s-u-s.gov. Not dot com.
Census.gov.
Anybody on the website yet?
UNKNOWN SPEAKER: No.
RAVI SHARMA: That's what happened when we're all trying to do it at the same time. So maybe I should have — actually, what I'm going to do is so all of you can watch me doing it — we'll see how this goes. There's some movement here.
It's like watching the grass grow. May have enough time if anyone wants to go take a dip and come back. Oh, here it is.
Okay. Now, the best, one of the best sites for getting cart graphic data for the U.S. is right here. It's called geography. It has the map files and the tiger files and the (inaudible). The map files is what will give you all the shape files for all different levels. So if you click on maps. And the map files are in two format, the ArcInfo format and the ArcView format. Most of you will work, since you're working with ARC GIS, ArcView you really want to download the ArcView shape file format. Don't download ArcInfo. That's as you know ArcInfo is a flagship program, and that has a slightly different format for share files.
UNKNOWN SPEAKER: Could you say that again, ArcInfo is what?
RAVI SHARMA: ArcInfo is the flagship. It's the top of the line program of ARC of ESRI.
RUSSELL KIRBY: It's the legacy program.
RAVI SHARMA: Yeah, you can call it legacy, that's true. It's the legacy program. But that's the one that you can actually buy if you pay additional money. But most of the time when you buy ARC GIS you're buying the ArcView program. So ArcInfo used to run on Unix, which they imported to Windows and now it runs on a Window operating system but you have to pay extra to get it. Most of the kind of features you need to run — is this an error message?
UNKNOWN SPEAKER: Yeah. But if you go back just click on geography, it goes to browse.
UNKNOWN SPEAKER: Hit geography first.
RAVI SHARMA: That's what I hit. Okay. So when you hit geography, you will get —
UNKNOWN SPEAKER: Hit maps and map resources?
RAVI SHARMA: I knew this is what was going to happen. Okay. So let's see if I can —
RUSSELL KIRBY: It's probably boundaries.
RAVI SHARMA: Click on the boundaries.
RUSSELL KIRBY: Boundary file.
RAVI SHARMA: Click on the boundary files.
UNKNOWN SPEAKER: Does it say boundary files?
RUSSELL KIRBY: It's the third one on the list.
UNKNOWN SPEAKER: Web view? That's the third one on my list.
UNKNOWN SPEAKER: (Inaudible).
RAVI SHARMA: Okay. So you have cart graphics. So what you're going to do now is — oh, there are no links here. There's supposed to be links on the left. Oh, this is terrible.
I think what's happening is part of the census bureau website is being downloaded. The left side that says boundary files has not been downloaded so you don't see boundary files.
UNKNOWN SPEAKER: Actually as you drill down you ultimately come to boundary files. It takes a while to load up.
RUSSELL KIRBY: If they click on ArcView shape file format.
RAVI SHARMA: Then click on ArcView shape.
RUSSELL KIRBY: The problem is it really hasn't loaded the whole page.
There you go. Download boundary files.
RAVI SHARMA: Then you have two options. One is, you see ArcInfo and the other one will be ArcView. So you want to click on ArcView and then go and pick the file that you need, whether it's census track, county level, state and whatever.
So then you click on map and mapping resources. And then you're going to click on boundary files here. Do you see what I'm doing here on the screen? You're going to click on boundary files. And it will take a few seconds for the website, for the web page to download. As you can see, it says 15, 13, 12, 11. So you will then click on download boundary files, and as you can see, you have tons of different kind of boundary files, cart graphic boundary files here. You got different levels of geography here, all the way from Alaska native regional corporations, census block, divisions regions, tracks, Constitutional districts, those of you interested in cities, counties and counties equivalents and mine is a county file for 2000 which is the one that's displayed for Pennsylvania. You have county subdivision and so on.
When you click, for example, if you click on, you can click on any. I'm going to click here just to show you on county and county equivalent 2000. And this is what I was talking about. You have a ArcInfo export and ArcView shape file. What you want to do is download really the ArcView shape file by clicking on it. If you click on it and you can see all the states here and you go to the particular state you're interested in and download the file. Okay? So I'm going to stop there and click out of here. And this is a zip file. So you can unzip this into a, you know you simply click on this and in a few minutes you have the shape file. So I'm going to — if I save it here on a suite. And I put it, as I said I'll just create a folder. So I would say this PA County, I hope I'm writing the right file here.
So you will download that. You'll go to open folder. And I know it's the right file because 42 is the Phipps code for PA. So that's the right file. So when you —
RUSSELL KIRBY: The file, they use Phipps codes to identify the files, essentially. And the problem is you you've got to have access to the Phipps reference to find out which file. Because if you download a lot of these shape files, you're going to get confused as to which one is which. So you might actually want to go in and give it a name that makes more sense like Pennsylvania Counties 2000.
RAVI SHARMA: Right, exactly.
So that's why I create a folder and I say PA County, so I know it's a county file for Pennsylvania . And then all I need too is simply — actually, what I can do is I have a win zip and I can ask my win zip to extract it to a folder which it calls and actually go here and I can even change the name of this folder too if I like, rename the folder. And I'm going to call it — this is within another folder. And now I have, as you know, you need these three files to and what Russell was talking about is changing the names of the files here. But you have to be careful when you change the files, you have to change all three files. So you can rename these files and call it PA County. You have to do the same here. Rename. Make sure you don't lose this name here, the extension. PACOUNTY. As you can see one is a DBF file. The others are — let's see. PACOUNTY. Okay. So we are in business. So we have three files.
RUSSELL KIRBY: Can you go back, page back to the results between the two trials. Another one that. Okay. Does it have zip codes at the bottom?
RAVI SHARMA: Yes.
RUSSELL KIRBY: Okay. So another complexity that we'll come up with is if you work with zip coded data, you need to be aware, and we're not going to talk a lot about this during the session, but you need to be aware there's a difference between zip coded data and zip code tabulation. They're not identical because TCA is what the census used for the report by zip code but it's an artificial unit that's not necessarily the same as your data. So you just have to be careful when you're trying to map things by zip code. But I'm not going to say anything more about that right now.
RAVI SHARMA: All right.
UNKNOWN SPEAKER: I just wanted to point out one other thing. I think we have a few people from New England , and some of the New England states (inaudible) doesn't mean a lot. I think there's an entry for (inaudible).
RAVI SHARMA: Right.
UNKNOWN SPEAKER: And those areas and they can use that for that.
RAVI SHARMA: Yes.
UNKNOWN SPEAKER: Even though it's Connecticut .
RAVI SHARMA: Yeah, right here.
RUSSELL KIRBY: While we're on the same subject. Virginia Louisiana and Alaska have issues.
RAVI SHARMA: Virginia uses Parishes.
RUSSELL KIRBY: And same status of counties but there's some special problems with that.
RAVI SHARMA: For New England you want to use this up here counties or (inaudible).
UNKNOWN SPEAKER: You could use subdivisions.
RAVI SHARMA: I'm sorry?
UNKNOWN SPEAKER: (Inaudible).
RAVI SHARMA: Yes. This one up here, county and county equivalent.
UNKNOWN SPEAKER: Subdivision.
RAVI SHARMA: Yes. You'll get uniformed data for that. So once you download the data set from your and then it's a very simple process of adding the data to your ARC GIS. You simply, you know, add the data set and navigate to where you have the data set. I put my data set in C. Data. PA county. PA county and here's the data and I can add it. It's similar to the data that's already been displayed on your screen.
So I can unclick and this is — so this is another layer of data that is displayed on your screen. And so what we're going to do is what we're going to do now, we have two data sets here. Two different layers. And you know we can work with both. So if you right click. Click and highlight the layer. Sorry, click and highlight the layer on the top.
UNKNOWN SPEAKER: I'm sorry, which data set?
RAVI SHARMA: Did you download any data sets?
UNKNOWN SPEAKER: No.
RAVI SHARMA: No. We're just going to work with —
UNKNOWN SPEAKER: We downloaded the New Mexico —
RUSSELL KIRBY: We're working off shape files.
RAVI SHARMA: Yeah, let's work on —
RUSSELL KIRBY: PIMCH.
RAVI SHARMA: We're going to work on the PA MCH so we're all on the same wavelength here. So highlight the PA MCH layer. Highlight it by clicking on it and then right click. Right click.
Okay. And I just wanted to explore the attribute file that is click on attribute file. Shall I do that again?
UNKNOWN SPEAKER: Yes.
RAVI SHARMA: Highlight PAMCH layer. Right click. And all we're doing is opening the attribute file. The attribute file is that DBF file that has the characteristics, the attributes of the map.
Okay? Open attribute. And you can click on the button top right-hand to maximize so we can look at what it looks like if you like. So you see the information entered automatically by ARC GIS. But then what you see is you have if county for 42 and the state $42, the county. It's important ( when you're working with the counties that the census bureau uniquely defines every level of aggravation from the census block to the U.S. as a whole by using what's called Phipps code. That Phipps code is a unique combination so it uniquely identifies all different layers. So if you ever wanted to link any of the census data all you need to know is the Phipps code. Just to give you an example of a unique combination, so the Phipps code for Erie County is 42049. That uniquely defines a county. There is no other Phipps code that is 42049. So the why, one of the reasons why it's been GIS has taken off so much and so fast in the U.S. is because the census bureau developed the system of Phipps code that allows us to link data with ease using these Phipps codes.
And Phipps codes, as you know, are really now — are what's the definition, it's the federal information —
RUSSELL KIRBY: Federal information (inaudible) these are the Phipps 55, I think. They have a whole variety of different information processing standards in addition to these area standards.
RAVI SHARMA: Okay. So you have the name of the county. And then this is a county name repeated. And then what I have is I've added just for us to play around, I've added some additional data that we're going to play around with. This LBW 02 is simply number of low birth weights in 2002. And you can guess what this is. This is simply births '02. This is LB low birth weights in '02.
This is interesting. This is actually what it is. I should have put here —
RUSSELL KIRBY: That's the%.
RAVI SHARMA: There's a P there.
RUSSELL KIRBY: Then the upper confidence.
RAVI SHARMA: Upper confidence, those who are statisticians I put an upper and lower so you know that's the precision of these and then you have the — this is — if I can see up here. ( So that's the next one is.
RUSSELL KIRBY: Same data.
RAVI SHARMA: Same data rate for 2001 repeated. Okay? Just to make it — just to have — and this is for 2000. And if you go on — I also have some prenatal care for 2002, information here. And we'll get to it and then some data from the census. You can see the poverty rate for '99 and this is the median family income. Family, median family household and family and so on.
What we're going to do now is so we have all this data. Now, we'll get back to the issue of how did I take this data and link it to the map, right? There's that issue of linking your MCH data set to your map file. The simplest answer is the way you link it is you link it by using a Phipps code. Now, you can, of course, link by also — how else can you link. Phipps code is one. How else would you be able to link. You know when you're linking two tables, you have the Phipps code, that's the easiest one, because you have similar — we know what that means is when you collect your data you have to collect it using Phipps code. Normally you collect your data using the names of the places, right? So you would have depending on which county you live in, you will have the state you live in, you will have the name of the counties. So you can link using county names.
There's nobody that says you can't do it. You can certainly link your own table that has county names and then your attribute file and then you can link it with using this — we'll have an exercise on doing that. But my recommendation is please use Phipps codes. It's a lot cleaner, and not as many errors that are likely to develop if you have the Phipps code.
RUSSELL KIRBY: There are a couple of complexities with using the Phipps codes. And one of the challenges that you have is when you're working with another data set that doesn't have the Phipps codes in and you want to make sure that you have them in the right format, you have to make sure that you zero fill the leading zeros in order — otherwise they won't necessarily match with your shape file. So you have to make sure that they're properly — like, say for example you have a hospital discharge data set that didn't even have county in it in the first place and you converted the zip codes into counties and now you're trying to do the link with the Phipps codes. So you have to make sure that they're formatted exactly according to the Phipps standards. And that can be a pain. But once you've done it once or twice you figure out how to do it.
UNKNOWN SPEAKER: One of the things I've run into, the two states I've been in every single department uses a different set. Our department uses a set. Phipps uses a different set of codes. Every place, Medicaid is another set. One of the things you can do from the beginning access database, (inaudible) where you stick Phipps code and three digit text field all the way down and a column that matches all the different counties, the various ways. So you take it once then you can use it as an intermediary table to join the data that came from that.
RAVI SHARMA: That's what I do in Allegheny county health department. They use their own weird classification codes. But you know that extra step for you, right? So why can't we all standardize to Phipps code?
So I suggested this to my county public health department and indeed when they start with the 2000 — with their vital statistic coding for 2004, they're going to use the exact Phipps code that are in the 2000 U.S. census for Allegheny county. So this way there will be absolutely no problem. My recommendation is let's standardize on the U.S. Phipps code standards. Or at least pick a standard that we can all agree with in public health. And I think they're moving towards that direction. But you're right, everybody, this is an — by the way, if you go to your MCH/GIS MCH folder there's a variable description for the data set that I just talked to you about. If you go to — all you need to do is — let me show it to you. Go to your Excel. Simply go to — let's see, I think for you you need to go to ovs. Let's see, what would be.
RUSSELL KIRBY: They should be able to double click on it.
RAVI SHARMA: Go to your MCH folder on your screen. And go to — I think — sorry, geography and data. And at the very bottom you will see variable description and simply click on that. This is just to make sure you all know. So this is what I was talking — this is just a description. This is a lot of variables I have pulled together from some of the other work I do for Pennsylvania . So what we're going to do is we're going to play around with this data set. And you're going to help me with some of these variables. You can do a lot of processing. You can calculate and one of the thing it won't do is calculate for you the lower and upper confidence intervals. You have to enter that. Otherwise it's pretty good. So we are — so just keep this file open and just minimize it. And we're going to go back to ArcView.
Okay. So what we're going to do now is we know the variables. We have some idea of the variables. We'll look at the attribute file and obviously you know most people are interested in the first thing they want to do is map these. So what we're going to do is just show you how easy it is to map in Arc GIS. So right click. Again, right click. Right click on the layer. PA MCH and do you see properties? Click on properties. Click on properties at the very bottom.
That will open up a dialog box. So this is called a layer property dialog. You can see there are several different things that it will provide information on. But the first thing you will see here, by the way, it always opens up on what's called a source. And if you recall Russ talked about the coordinate system, and you can see this one, it tells you what the coordinate system is. It's in the GCS assume coordinate. The datum is 1929.
Okay. So we want to click on symbology. Symbology. And there are several different ways to symbolize your data set. Depending upon the kind of features. Remember, we talked about discrete features, continuous. So depending upon the type of data you have, you will select the kind of, the mechanism, the way you want to display your data. So we are going to click on quantities. We're going to click on quantities. Okay? Once you click on quantities, you have several different choices here. You have the graduated color, the graduated symbol, the proportional symbol and dark density.
Depending upon the kind of data that you have that you're displaying, you're going to select one or the other. Now, we're going to select first the graduated color. It's a color, what we call a color ramp that goes from, as you can see the ramp here, this is a color ramp that is displayed that you can select, but first let's pick a field. Draw quantities using color to show values and here is the value. So the value simply refers to the value field you have. If you click to drop-down button, we can scroll down here and pick any particular value that we are interested in. So I'm going to pick the low birth weight, the number of low birth weights in 0 — in 2002, which is right here. So when you click on that, it automatically creates a — using what's known as natural break (inaudible) classification system, it automatically classifies the values in using natural breaks. Russ.
RUSSELL KIRBY: Yeah, you know there's a variety of different methods you can use for grouping the data. The natural break is, if you're doing early stage data exploration, it's a good way to get an idea of, of course, the distribution of values, what there might be. It's usually not going to be the thing you're going to use for your final map. But it's generally a good idea in making any map to get some understanding of the distribution of the data before you really finalize it.
UNKNOWN SPEAKER: May I?
RAVI SHARMA: Yeah.
UNKNOWN SPEAKER: So here we have this range. This is something preset. Can you set your ranges?
RAVI SHARMA: Yes.
RUSSELL KIRBY: Yes.
RAVI SHARMA: So what you will do is, do you see here, if you go to the classification dialog, all the way to your right, and first of all, you can actually change the number of classes. At the moment it's set to five classes, but you can actually change it to six, let's say. Right? So it enables you to change the number of categories.
The second thing you can do is if you click next to classes it says classify, so click on classify. This is the way your data actually breaks at the moment. These are the natural breaks. And up here in the methods selection, you have the default is the janks, natural break, but in the drop-down you can use the manual method, which is you manually determine, you know, the category sizes, the classification sizes. You can use the equal interval method. You can use the defined interval, the quartile, the natural break and the standard deviation.
So again the kind of method you use is very much dependent on the kind of data you have. For example, if you have rates, it may be interesting to use the standard deviation map. The map to classify your data.
And the quartile — so let's look at the equal interval. So this is the equal interval and if you click okay, and then simply, you know, to apply it you simply say apply.
And I'm just going to — so obviously you know this is a very — the number of low birth weights you have is a function of the right number of births. It has nothing to do with whether the risk is high or low. You all know that. So you know this is Philadelphia county and the —
RUSSELL KIRBY: Allegheny county.
RAVI SHARMA: And this is Allegheny county. So that's simply because there are more births in Allegheny county and Philadelphia county. That's why you have — but all we're doing is showing different ways to display the data in ArcMap. We're not doing anything powerful, just to get you going. Okay?
And if you click on — so by the way so you can see I think somebody was starting when they were introducing themselves they were talking about getting different results using different ways to, when you classify differently. That's exactly what's happening here is depending upon what classification system you choose, you may end up with slightly different picture.
And so it's always good to know your data before you start playing around. So let me see. I can go back here again to properties.
And so we have low birth weights. So we can hit classify again and we can use, there's the quartile. You can change the categories here if you like. Apply. And you see now you have a different map. Visually. The color ramp is set up so the color ramp is set up so you go from higher to lower value. The darker shades give you higher values and the larger shades concentration of lower values.
UNKNOWN SPEAKER: (Inaudible) interval that (inaudible) each category has a different value (inaudible).
RUSSELL KIRBY: User defined interval?
UNKNOWN SPEAKER: Yes.
RAVI SHARMA: So you would go to. You want if you can manually define your interval, right?
UNKNOWN SPEAKER: Yes.
RAVI SHARMA: You'll go to classify. Go to quartile, the method section and use manual.
UNKNOWN SPEAKER: First category 021, the next one is 125 00(inaudible).
RAVI SHARMA: What's that?
RUSSELL KIRBY: She wants to know how you actually put your breaks in.
RAVI SHARMA: Oh.
RUSSELL KIRBY: For manual.
RAVI SHARMA: Oh. Right there. You see this up here?
RUSSELL KIRBY: Uh-huh.
RAVI SHARMA: That's where you put the break values.
RUSSELL KIRBY: (Inaudible) 00(inaudible).
RAVI SHARMA: What's she saying?
RAVI SHARMA: You can also, by the way, when you're in range, you can also define here too — are we okay?
RUSSELL KIRBY: Yes. The question they're asking is how do you create an attribute table and bring it into — and I think we have an exercise for that.
RAVI SHARMA: Yes.
I think the question was how do you create an attribute table with your own classes.
RUSSELL KIRBY: With your own data.
RAVI SHARMA: Yes, we actually have an exercise which you'll do in the afternoon, after lunch, and I'll show you exactly how you do that. You can actually bring — your data can be in any format you want. And bring it in and symbolize it. And you know all different — any classes you want. So long as it makes sense.
Okay. So this is very basic mapping function here. There's nothing extraordinary here to display this data. Right? Anybody can do it. So what we need to do now is what I'm going to do now is I'm going to click open the attribute file again and we're going to start, remember we talked about the fact that one of the thing that ArcView does is create new feature classes for you. So we are going to create some new data. What we're going to take, what we're going to do is we're going to add — as you know when you work with small numbers, small numbers have problems when you calculate rates. So we're going to add data, low birth weight data for 02, 01 and — sorry 2000, 2001, 2002. And then we're going to divide it by the number of births in the same year and then we're going to calculate a percent and then we're going to do all that in ARC GIS. So are you ready?
All right.
RUSSELL KIRBY: Take a deep breath.
RAVI SHARMA: So we're going to — in other words, we don't want to use Excel. We don't want to do anything in Excel. We're going to use the calculating capabilities in ARC GIS. It will save you a lot of time to learn how to do this in ARC GIS. So right click on — by the way, before I forget, I should also tell you if you don't like the color of the map, you can go down — do you see this color ramp, pick any ramp you want.
Look at this one. It's beautiful, isn't it?
UNKNOWN SPEAKER: Yes.
RUSSELL KIRBY: Beauty is in the eye of the beholder.
RAVI SHARMA: Beauty is in the eye of the beholder as they say.
RUSSELL KIRBY: One of the things to bear in mind all of these color ramps that are built into ARC have been carefully designed in terms of visual perception capabilities. And one of the things that people don't realize is how much we actually know about how people perceive information spatially. And a lot of research has been done and they've filled that in. So you can create your own color ramp, if you want. You can do that. But you're probably better off using one of the ones that comes with them. There's so many to choose from you'll probably find one you like.
RAVI SHARMA: And actually we have a, in your — there's a site actually you can go on the web. It's called color (inaudible).
RUSSELL KIRBY: Right.
RAVI SHARMA: Which will give you some assistance. CO — actually, it's written in your — if you look at the agenda for today, it's listed there. Use of color brewer tool. C-o-l-o-r B-r-e-w-e-r tool. If you have time we'll take a look at it. It will take us far a field but we'll spend some time on it.
UNKNOWN SPEAKER: (Inaudible) be able to do it in black and white. That means I have to go in (inaudible) don't reproduce. So I have to mainly go in and change it.
UNKNOWN SPEAKER: There should be some gray scales.
RAVI SHARMA: No we have gray scales. So we go to properties. Oh, no, this is ARC GIS here. They should allow you to do all these things without you having to do anything.
So what you will do here is let me see here. There is a.
RUSSELL KIRBY: Very top has a grayscale.
RAVI SHARMA: Where?
RUSSELL KIRBY: In the color ramp.
RAVI SHARMA: Oh, yeah.
There we go.
RUSSELL KIRBY: There's a way to flip them?
RAVI SHARMA: Yes, you can actually flip these, too.
UNKNOWN SPEAKER: But see that's different because.
UNKNOWN SPEAKER: Right click this.
RAVI SHARMA: Where am I here?
Dine: Right click. Or left, I'm sorry. Where it says symbol.
RAVI SHARMA: Left click. And flip symbols.
UNKNOWN SPEAKER: There's a default that goes the other way.
UNKNOWN SPEAKER: You make a conscious choice do you want it black and white or in color. Say you want it in color but you want to stay open to those possibilities that have to reproduce in black and white.
UNKNOWN SPEAKER: What we do is there's two color ramps that reproduce very well in black and white and color so long as you use three offer four categories. Don't have 20 categories. The yellow, it's a green to blue. And yellow to orange to brown, which is put up there. Is something very well. Yellow green blue. Yellow shows up as white and green shows up as (inaudible) so those are a couple we use. Use it and it works well in (inaudible).
UNKNOWN SPEAKER: (Inaudible) names?
RAVI SHARMA: What you can do — we haven't gotten there but since you asked, we'll go to label features. There you go. And let's assume, this is not the labels you want. You want some other labels. You can always go to, you right click. We were going to come to labels later on. But if you ask me questions, I'll give you answers immediately. So you don't have to wait. So if you go to properties and you see fields here, you see labels, you can actually select you know which way you want to label, you want to define classes of feature and label each class differently. What label field do you want? Do you want name or do you want, for example, in certain names you may want to have Phipps codes displayed. You can certainly do it. And you can select the placement of the labels and you can determine the label styles, you know all different kinds of labels depending on what kind you're looking at.
And you know — so you know if you choose this style you get a different style. You have a considerable amount of (inaudible) over the labeling and so I recommend you play around with it and you should be able to determine the one that's appropriate.
Okay. And to turn them off, you simply go right click on your layer and unclick the label features and the labels disappear. All right. What we're going to do now is do some editing and some table calculations in ARC GIS. And then in the afternoon you will have exercises hands-on that you have to do on your own. So you will have another level of practice.
As you all know that the Phipps famous philosopher of our time once said that the best way to practice is to do it.
RUSSELL KIRBY: That was the same guy who said in theory there's no difference between theory and practice but in practice there is.
RAVI SHARMA: Exactly. So let's right click on the table of content. On the layer. And we're going to open up the — click on the open attribute. And then what we're going to do here is do you see the option command towards the right hand bottom corner? And it has a drop down here. So we're going to click on that. So you know what we're going to do: We're going to add — we're going to add the births for 2000, 2001 and 2002 and we're going to add low birth weights for the same years. And then we are going to multiply that by, you know, mostly the typical way of doing this is as percent. Now, there used to be a time when we have to do several different steps. But let's see if we can do it in one step. That means add those three, divide it. Add the number of low birth weights. Divide them by the number of births and multiply by 100. Let's see if we can do that in one step.
So the first thing we need to do is we need to add a new field. So we're creating new data here. So add a new field. So do you see here add field? Make sure you click on the option button here. You have a drop down. Click on add field.
So you have several different ways to define your, the type of field, whether it's integer, float, double, text date or BLOB. Blob. (Don't ask me — I'm trying to remember what blob is).
RUSSELL KIRBY: I thought it was supposed to be BYOB.
(Laughter)
.
RAVI SHARMA: We need to get back to ESRI. We made a mistake here.
So okay what we're going to end up with, we want to calculate percent, right? So the percents as you know go from — we might want to have a decimal. So but the percent usually goes from zero to 100, and we may want — you can say one or two decimal.
UNKNOWN SPEAKER: I don't know if anyone else — I got an error when I went to add the field.
RUSSELL KIRBY: We were expecting that might happen.
RAVI SHARMA: Yeah.
RUSSELL KIRBY: We were waiting to see if it did.
RAVI SHARMA: What does it say?
UNKNOWN SPEAKER: I couldn't get to your screen.
RUSSELL KIRBY: The problem is that when we loaded them onto the desktop, the files are read only. So you need to copy them somewhere.
UNKNOWN SPEAKER: We need to redefine.
RAVI SHARMA: Really?
RUSSELL KIRBY: That's just — for some reason that's just what happened when we put them on the desktop.
UNKNOWN SPEAKER: So one easy way to do that is to go to the folder geography and the data and then right click on that database, change the attributes of that file.
UNKNOWN SPEAKER: We have to close these first before we change.
UNKNOWN SPEAKER: Probably, yes.
RAVI SHARMA: Oops. Sorry about that.
UNKNOWN SPEAKER: So the fields are —
RUSSELL KIRBY: The problem is that the whole database is in read only mode. So it's not going to allow you to open and add additional fields. So we have to —
RAVI SHARMA: Before you do that, can you do that for me again.
UNKNOWN SPEAKER: Oh, sure. So we're looking Atovaqone beauties.
RAVI SHARMA: Right and drop-down. Add view.
UNKNOWN SPEAKER: It's in use by another application.
RAVI SHARMA: Oh, okay.
UNKNOWN SPEAKER: That's the message.
RAVI SHARMA: It came up add field cannot be selected because it's being used by another application and user.
UNKNOWN SPEAKER: That's not literally correct. Because it's read only it will do that.
RAVI SHARMA: Yeah, what else — are you using another application with the same data open?
UNKNOWN SPEAKER: No. We close them all.
RAVI SHARMA: What does the detailed table —?
UNKNOWN SPEAKER: That's census bureau. Maybe it's just the folders, the Windows folders.
RAVI SHARMA: That's interesting.
UNKNOWN SPEAKER: Maybe you close that and open two files.
UNKNOWN SPEAKER: That doesn't make any sense. Maybe if you go out and go back in.
RAVI SHARMA: Try it.
UNKNOWN SPEAKER: Because you saved it, right?
RAVI SHARMA: How many of you have the same problem that you can't open? You're okay?
UNKNOWN SPEAKER: Just change from read only.
RAVI SHARMA: So what we're going to do is we're going to — the float — let's see if you go a little farther. I'm going to help those who aren't able. So what we want to do is you want to select the type. That means you want an integer and you want something with a decimal and so what we'll do is we will use a floating point decimal and just say float and then you define the precision here. The precision is let's say we want six, one, two, three, four, just to give you an idea, six digits here.
I'm having difficulty looking at my screen here. Six. I said six. Six and eight looks the same to me. Here we go. We want a precision of two, two decimals. That's really what it means. And —
UNKNOWN SPEAKER: You want a scale of two and precision of six.
RAVI SHARMA: Oh, let's see. What's it doing here? Yeah. Where are we here? I can't even see. Where are we here? Oops. Am I going to have the same problem here as the rest of you?
RUSSELL KIRBY: You probably will, actually.
UNKNOWN SPEAKER: Does the precision refer to how many characters are together and the scale is the decimal point?
RAVI SHARMA: Let me just see if I can — I'm having trouble also adding a field. So I just want to make sure I can. Okay. So let's first — what we need to do is create first make sure we name the field. We're going to call it LBWR underscore 00underscore 02.
Okay. So were you able to do that? Make sure you have — you need to add the name of the field on the top. You can, by the way, you can have an integer. I mean we don't need to have what you call — these are — we don't need that much of precision. So we can have simple integers going from zero to 100. Make sure you have the name of the field you want to add. First, then select the type you want, whether it's an integer or a floating point and then define the precision and then click okay. You'll have a field added to the very end. In this case I just call it LBWR underscore 00underscore 02 to make it very self-explanatory to make sure I don't confuse it with something else I have on the table.
Okay. Are we all there? Okay. Right click on the new field. Right click on the new field that you just added. Right click. And you will see a calculate value option. Click on the calculate value and you will get a warning. The warning is you are about to do a calculate outside of an added session. This method is faster than calculating in an added session but there's no way to undo it once the calculation begins. Do you want to continue? Say yes. I will show you also how you can do a calculation with an add it by opening an added dialog and making your table addable. But for the moment we'll click on yes and continue.
Okay. So you have the field calculator. And you have all the fields here. And you have, you know, most common calculations. Let me see if I — so that's multiply. Divide. And this is for string variable "and". If you have a string variable that you want to add, we'll be using that in the afternoon, the string variable. That's plus. If I can see that, is that a decimal? Yeah. That's a decimal. And that's equal. So now what I'm going to ask you is to show, to tell me how we would go, we would calculate percent low birth weight by counties, 67 counties in Pennsylvania .
So we're going to click on this. You see what — there's an advance here. Click on that.
So this is ArcView calls it prelogic VBA script code. It's like prehistoric. So it's not exactly like what you would call the Visual Basic script code. I have lots of problem using the scripts, the VB, the ArcView VBA scrip code. So I use the point and click just to make sure that I follow exactly their commands.
So what we want to do is first add the number of low birth weights. Right? So what shall we do? We want to pick up all the births in 02000, 2001 and 2002, right? So let's see. We are, I'm going to start wherever I can find them. If you go from the top, here is one, right? Oops. Sorry — make sure you right click and you're right here on the top box here. Right click there. And then you want to click plus.
And then you want the birth weight for 2001 and you want to add, right? And then we want it for 2000. LBW 2000. Okay. We are in business. So we have on the top box, we are adding births, low birth weights for 2, 1 and 0.
Do you think we should do something else before we go on to divide?
UNKNOWN SPEAKER: (Inaudible) parentheses.
RAVI SHARMA: Absolutely. We should put parentheses. A good rule of thumb is you should always tell what you're dividing with 1 so your nument should look like a nument. We should put parentheses around the nument. Because otherwise what may end up is the division might not take place correctly.
Wonderful. All right. So let's put parentheses here. So we're going to use now we're going to try this. You know, I want to tell you something about Arc GIS. It likes some parentheses and it doesn't like some parentheses. You can see the kind of parentheses I'm going to put here. I'm going to shift click and use the parentheses on the top there. So shift click and use the parentheses.
And then just hold your breath here. And then we're going to divide. And what we'll do is we'll put the parentheses beforehand so we don't have to add it. So just shift click and put the left parentheses and now we're going to add all the births. So let's take — let's start with the births. Here is birth for '02. Plus births for '01.
Let's see here. Good Lord, where is births for '01?
UNKNOWN SPEAKER: It has a different name.
UNKNOWN SPEAKER: (Inaudible).
UNKNOWN SPEAKER: Yeah.
UNKNOWN SPEAKER: It's in the same order, too.
RAVI SHARMA: Oh. Somebody has been playing with my file. And it's not me. Which one do you think it is? Birth — oh, this one up here. Well, but that doesn't really make sense, though.
UNKNOWN SPEAKER: That's the way it is in the —
RAVI SHARMA: It is?
UNKNOWN SPEAKER: Yeah.
RAVI SHARMA: I take your word for it. You know more about my data than I do. This is good.
Okay. So we want to make sure we put, make sure you put the right bracket. Shift, right bracket. And then what we want to do is we want to multiply, right? So we want to multiply.
UNKNOWN SPEAKER: But you need a parentheses.
RAVI SHARMA: Yeah. We can put another parentheses to enclose the whole — we just want to make sure our parentheses are balanced here. And then we want to add — sorry, we want to multiply that by 100.
Now, what do you think they're missing here?
UNKNOWN SPEAKER: Some sort of function.
RAVI SHARMA: Yes. We should say X equals. That whole expression, right? Yeah, so put X equals and then this function will be equal to X. So you need to make sure you have X equals all of this. Equals the nument and denominator and multiply by 100. (And then this — oh, let's see here).
UNKNOWN SPEAKER: Named it, is that right?
RAVI SHARMA: Yeah, this will be equal to X. Right? And this is X. This is our new variable that we created that will be equal to X.
UNKNOWN SPEAKER: My query I did not — I previously named the result —
RAVI SHARMA: Yeah.
UNKNOWN SPEAKER: Before getting to this screen. So I was puzzled why you had to put an X. Looks like it got — what's that — you already named it LBWR.
RAVI SHARMA: Yeah. But the thing is — oops.
UNKNOWN SPEAKER: You named the value of your computation you're not changing your actual field name. You're just naming the function that you're creating.
UNKNOWN SPEAKER: I see. You need to name the function.
UNKNOWN SPEAKER: Apparently.
RAVI SHARMA: Yeah.
I'm sorry, I missed — thanks. If I can see it here. I think I may have added some things here. Let me just make sure this thing will — I think I added here — I'm going to do this again here.
RAVI SHARMA: I think can we get some lights on this side? Is it possible to get lights on this side? No?
Thank you.
I'm having difficulty seeing the screen. Did you do it? Did it work?
I'll come around and help those of you who are still — okay, let's see. Are you all — were you able to do it?
UNKNOWN SPEAKER: I'm not quite sure.
RAVI SHARMA: Z, dine, can you give everybody some — okay.
UNKNOWN SPEAKER: We got into this window. This window just needs to have the X.
RAVI SHARMA: Just X. So just put X. And get rid of all that, all the junk there. And just X. And you say okay. There you go.
UNKNOWN SPEAKER: Do you have any idea how we got into that?
RAVI SHARMA: Because you may not have clicked in the top window. So the good thing is to click in the top window always.
How are we doing? Oh, good. Actually, you have the right calculations. Because I think I did — did I multiply — I don't think I multiplied by 100? I don't know what I did. Don't do what I do.
Good. You got the right. Okay.
That's wonderful. You actually have the right answers because mine I don't know what I multiplied by. So you got a percent. That's good.
Okay. Michael, you're not doing anything.
Okay. That's good. All right.
So all of you can do the calculations? Good. So now what we have is what have we done? We've taken three years worth of data aggregated and created new data. It's new data because that rate didn't exist there before. So it's a new feature we have created. And the thing with doing it within ARC GIS is we don't have to go to Excel and do the same thing, because in Excel you can do point and clicking and probably a little easier, but then you have to join the table back to your ARC GIS attribute file. So if you can do as many calculations as you can within ARC GIS it will be better for you. So if you can spend some time and learn, as you can see the calculations I showed you is very easy in ARC GIS. Basic multiplying, adding subtracting can do exponential and logarithms and you can use the table up here in calculate values. You can use this window here. What you want to make sure is before you start your calculation, you click here. Otherwise you know sometime it ends up being here. And you're typing in the wrong box. So just always make sure you click up here. Create your Visual Basic dialog and you can multiply, add, subtract, whatever you want to do with your data set you can do it within ARC GIS. It's cleaner and a lot better.
UNKNOWN SPEAKER: Why do you click advance?
RAVI SHARMA: That enables this window for you to do the calculations. So if you don't check, it doesn't allow you to do the calculations. So this is simply the check is simply to enable you to use the prelogic VBA script code.
UNKNOWN SPEAKER: You can't replace the X with the variable name (inaudible).
RAVI SHARMA: No. No. It simply says this is equal to X. So all it is simply a way to calculate an equation and you're just replacing this value X, this variable is equal to the value of X. It's just a way — it's just an equation. So you're not replacing a —
UNKNOWN SPEAKER: But you can't put your variable name into the equation.
RAVI SHARMA: No, no. X. Yeah.
You also have access to a number of functions here. If you want to normalize your data, you know, for example you want to log normal — you want to log normalize you have a log function and we don't have enough time to go into all of these functions, but now you have — you know a little bit more about how to do calculations using VB logic. You can do these. We will have a set of exercises after we come back from lunch.
What I would like to do now is actually go back and we are going to just minimize this and we're going to go to our map and we're going to open — we can open or right click on the layer. Open the attribute file. And you can see to the very end should be the new variable, the new data you just created. And we are now going to symbolize that data set. By symbolize, I'm simply meaning to map it. So we're going to again right click. We're going to go to properties.
Okay. Now you know the drill. Symbology. We're still going to use the graduated color. And now we are going to drop down to — and so this is — so again what you're doing is simply picking a color ramp. So you can determine your color ramp that you would like.
Pick any you like. And you can hit apply. And I should close this first. So this is — so this gives you an idea of low birth weight distribution by the 67 counties in Pennsylvania .
Now, what your question might be that you would like the values displayed on the table, on the map, right? Because you want both the range of values but you also want the actual displayed. If you want the actual value displayed as a label, all you need to do is go to properties, go to labels, and do you see the label field here? The label field drop down. Simply scroll down to the very bottom. Let me make sure — so where are we here? This one up here. So we pick the variable we just created. And we click apply. And click okay.
And then turn on — once you do that then we need to turn on the label by right clicking, where it says label features. Okay? Is everybody with me?
UNKNOWN SPEAKER: Yes.
RAVI SHARMA: Okay.
So now you have the actual value of low birth weight. This is actually an interesting pattern here. I mean this is Allegheny county, and this is Philadelphia County . But you see here, and this is one of the things we're going to look at is you know is this, is this a cluster of high low birth weight counties, these are rural counties. So this is Allegheny. So this would be what is this — this is west — I'm trying to see. Oh, geez.
UNKNOWN SPEAKER: (Inaudible).
RAVI SHARMA: Good idea.
So let's show you a — you can see that — do you see that — I don't know, is the toolbox visible on your — no? Let me show you how to do it. Go to view. Do you see tool bars? Go to view. Go to — you will see tool bars. And then click on tools.
Click on tools. So go to view, tool bars and click on tools. Now, while we're here, I'm going to kill two birds with one stone. If you recall, when we were trying to add a field, it gave us a warning saying you are calculating adding a field outside and therefore you will not be able to undo your calculations. Now, if you want to make your table editable, all you need to do is turn on — do you see this editor here? Editor. If you click on editor, it brings — it will bring in the editor dialog and then all you need to do is simply go into the drop down box and start editing.
What it will do is ask you which layer.
That was weird. This is dockable. So what you should do is — okay. So it has enabled editing of the table. So if you add a field you should not get an error message. And then once you have finished editing, you can get, go back to editor and stop editing. And it will ask you whether you want to save your edits or not. So if you're satisfied with what you've done, save it. If not, don't, you don't need to save it. You can go back and undo the work. Okay?
UNKNOWN SPEAKER: When you save it can you go back and reedit later.
RAVI SHARMA: Yeah. Actually you can simply delete that column and restart all over again. Or you can recalculate the field again. You can do that. Just recalculate it. I've done it many times. You know I make a mistake, like, for example, just now I forgot to put multiply by 100. So I went back and added multiply by a hundred, and it just put in the new numbers.
How are we doing?
RUSSELL KIRBY: Lunch is ready, right?
UNKNOWN SPEAKER: Yes.
RAVI SHARMA: Okay.
RUSSELL KIRBY: So we had a little informal poll and it was not exactly a randomized poll. It was randomized. It was an act of randomness. But anyway there's been a suggestion.