Lab 1 (Week 1)

Summarizing land cover by Block Group and ANOVA

 Due Monday Jan 28. (note, due one week late due to MLK holiday)

 

  1. Please sign your data agreement!!
  2. Map a network drive to \\zoofiles\gradgis.
  3. Open Arc Catalogue. In Arc Catalogue create a new folder on your Z drive called nr245. Also in Arc Catalog, copy the Gwynn’s Falls land cover layer (Data_2006\Database\LULC\gf6cls) and the associated .lyr symbology file into your folder. In that folder create a new geodatabase called NR245. Copy Gwynn’s Falls watershed (GFW) boundary (Data_2006\Database\Hydrology\Hydrology.mdb\Watersheds\Watershed_GF), and census block groups (Data_2006\Database\Census\Census.mdb\Census\PRIZM_2003_MSA) to that geodatabase. Do so in Arc Catalog by right clicking, clicking “copy” and then right clicking on the geodatabase (not the feature dataset within the geodatabase) and clicking paste.
  4. Load the land cover layer and import the symbology (.lyr) file in the symbology window for the layer. Zoom in and explore the data.
  5. Do an intersection of the block group layer and the GFW boundary. MAKE SURE TO SAVE IT AS A FEATURE CLASS IN YOUR NEW GEODATABASE. That is, click the little folder icon in the geoprocessing wizard and when you specify the output, in the “save as” dragdown box make sure to choose “geodatabase feature class” as the type and save it within your existing geodatabase. >>>> Call it something like BG_GF_inter. The reason for saving it in the geodatabase is that when you create geodatabase feature classes that are polygons, it automatically generates area. Also, we’ll be doing lots of table editing in Access, which can be done with geodatabases, but not shapefiles, unless converted.
  6. Do Select by Attributes on BG_GF_inter to find all the really small sliver polygons created by the intersection. Use Shape_Area<20000 (the units of this and most other layers is meters). Then delete these polygons by starting the editor (editor>>start editing) and making sure to choose your NR245 geodatabase as the editable space. Then click delete. All the selected polygons will disappear. Click Stop Editing and choose to save. Note that the area values should have been generated automatically, because this is a geodatabase.
  7. Next, in preparation for tabulating areas (which involves a tabular join), we need to make sure we have a reliable join field. Create a new field in the table called join1 (set to integer). Use the field calculator to set it equal to ObjectID_1 (or, if you don’t have Object ID_1, then to ObjectID).
  8. Now tabulate each of these six cover types by block group. To do this open Arc Toolbox and click on Spatial Analyst Tools>>Zonal>>Tabulate Areas. Choose BG_GF_inter as the input raster or zone data layer, join1 as the zone field, gf6cls as the input raster data set and value as the class field. Save the output table in nr245.mdb. 
  9. Now do a tabular join (right click on BG_GF_inter>>>join; then choose  join attribute from table” with join1 as the join field and the tabulate areas table as the “from” table). To make the joins permanent we’ll need to make a duplicate layer. Right click on BG_GF_Inter in the Table of Contents (TOC) and click data>>export data, accept the defaults and save the output as a feature class called BG_GF_LC.  MAKE SURE YOU SAVE IT AS A FEATURE CLASS WITHIN YOUR NR245 GEODATABASE! Add it and remove BG_GF_inter
  10. Now use graduated color symbology to plot out the block groups by the amount of buildings (value1; use the green to blue color ramp—fifth from the last) and take a screencapture (for info on how to screencapture go to http://www.uvm.edu/envnr/gradgis/labs/lab1.htm) . Insert the screencapture in your Word document and make sure that you caption this and all subsequent screencaptures. You’ll note that the really large block groups in the north appear to have the most, but this is misleading because they’re the largest by far. So, normalize the symbology by area. In the symbology window choose “Shape_Area” under the “Normalization” combo box. Now the display is essentially showing you a percentage. Take a screencapture of the plot.
  11. The only problem with this is that you don’t have percentages in the attribute table for doing analysis. You can manually correct this by creating a bunch of new fields and using the field calculator to divide land cover area by shape area, but instead we’re going to build an Arc Model to automate this somewhat. In Arc Catalog, right click on your NR245 geodatabase, and click new>>toolbox. Call that nr245. Go ahead and drag it from Arc Catalog into the Arc Toolbox window in ArcGIS (you can also right click in the Arc Toolbox window and click “add toolbox” and browse to this toolbox).  You should now see that toolbox in the toolbox window. Right click on it and click new>>model. The model editor should come up. We’ll now create a model that creates a field and calculates it as the percentage of a certain land cover type of total area. If you ever close the model and need to get back into edit mode, just right click on it and click “edit.”
  12. We’ll start by adding the “add field” tool. Click the “search tab” below the toolbox window and enter “add field” in the search line and hit search.” Then click “locate” to see where it is in Arc Toolbox. Drag the tool “Add Field” into the model interface. You should see . Double click “add field.” Choose BG_GF_LC as the input table. Set the field name to “P_Building”, the field type to double and click OK. Now we’ll add the field calculator tool. In Arc Toolbox again do a search but this time for “Calculate field.” Locate it and drag it into the model window. Now you’ll draw a model connector (which looks like )between the oval with BG_GF_LC to the rectangle that says Calculate Field.  . Now double click on the Calculate Field box and you should see that BG_GF_LC is the input. Choose P_building as the field name and click on the calculator next to the expression field. Using it, set the equation to [VALUE1]/[Shape_Area]. Click OK twice. Now all boxes should be colored in. Now we’ll clone this little model five times and change the parameters. Click Edit>>select all and then click control-C to copy and control-V to paste. The new set of boxes will be pasted over the old set, so just drag them down below so they don’t overlap. Then delete the first blue oval of the second group (if it gives you an other oval underneath, delete that too. You should now have just two boxes and two ovals in the second group. Then. Click on the model connector tool again and draw a connection between the last oval of the first group and the first box of the second group. The result should look like this.To add the four more model groupings (consisting of two boxes and two ovals each), you’ll want to select that last model grouping and copy it four times. Use the arrow tool to draw a rectangle just around the last model grouping (the last two boxes and ovals) like thisand then hit control-C followed by Control-V four times. Again, separate the groupings so they are not overlapping and then connect them with the connector tool as you did above. You may want to arrange them in two side by side columns of three groups. Now change the expressions and field names. Double click on Add Field (2) and change the field name from P_building to P_coarseveg. Double click on Calculate Field(2) and change the Field name to P_coarseveg (scroll to the bottom of that list and P_coarseveg should be there to be chosen) and in Expression change VALUE1 to VALUE2. Now, do change the parameters for the third, fourth, fifth and sixth groups in the same way, using whatever field names you think are appropriate. Finally, right click on the first oval of the entire model and check “model parameter.” Now save the model, take a screencapture of the model diagram, and close it. Back in Arc Tool box, right click on this model (“model1”) and rename it to “calc_percent.” Now, before running it close Arc Catalog, just in case of segmentation violations. Then double click the model icon to run it. Click OK at the next screen. Now check your attribute table to make sure it worked correctly. If you’re having trouble getting this to work, then click here to download, load it into toolbox and run.
  13. Now we’ll make a few quick graphs in Minitab (a good, simple program for statistical graphs) using this data. In Minitab you actually can directly import data from a geodatabase, but it’s kind of complicated, so instead we’ll just export a flat file (DBF)from ArcMap. Open the table for BG_GF_LC in ArcMAP and click options>>export. Save it as a DBF file called BG_GF_mini. Then close ArcMap and Open Minitab. In Minitab, go to File>> open worksheet, change the type of file as DBF and open your file. Once it’s loaded, go to graph>>histogram. Choose “with fit” and click OK. Then choose P_pavement as your variable. Next choose P_fineveg as your variable. Take a screencapture of the two next to each other. Describe what the histogram tells you about the difference in distribution of the two data sets. Next we’ll do a boxplot showing how pavement and fine vegetation vary by PRIZM group (these are marketing segments that were described in class). Go to graph>>boxplot and choose one Y with groups. In the next window choose p_pavement as your graph variable and DESC_15 as your categorical variable. Now do the same thing for P_fine_veg. Take a screencapture of one of the graphs and try to interpret what the Boxplot is showing. See http://www.maths.murdoch.edu.au/units/statsnotes/samplestats/boxplot.html for help in interpreting a boxplot.
  14. For the analysis, though, we’ll use S-Plus, which is more Powerful. Close Minitab and open SPlus. To import data from a Geodatabase go do file>>import data>>from database. Under data source choose MS Access Database and a browser window will come up. Browse to your NR245 geodatabase and then choose BG_GF_LC2 under Table name. Keep everything else as it is and click OK. You should now have a data table with the attributes. You’ll note that all the columns with percentages have only two decimal places. Increase that by highlighting all those six columns, right clicking and clicking properties. Under Precision, choose 5.
  15. Now run a quick analysis of variance, or ANOVA, on percent pavement by PRIZM group. In S Plus click Statistics>>ANOVA>>fixed effects. Then choose BG_GF_LC2 for the data set, p.pavement (or whatever you called the field for pavement percentage) for the dependent variable and DESC15 for the independent variable. Click the compare tab and choose “Tukey” as the comparison method and DESC15 under “Levels Of,” under “variable.” Also check “plot intervals” on that tab. Screencapture the comparisons and interpret both the main ANOVA results (i.e. can we reject the null hypothesis that all groups are the same), as well as the comparisons. List which pairs are significantly different and how you know that? See http://www2.chass.ncsu.edu/garson/PA765/anova.htm for help with ANOVA.
  16. Save the Word document with your answers and screencaptures as a PDF and then upload them at www.uvm.edu/~nr143/homework using nr285 as the option for the course. See http://www.uvm.edu/envnr/gradgis/labs/lab1.htm for help on screencapturing and making PDFs.