+ All Categories
Home > Documents > Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville...

Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville...

Date post: 09-Mar-2018
Category:
Upload: doandan
View: 216 times
Download: 4 times
Share this document with a friend
22
Dasymetrically Refined Areal Weighting Matt Ruther University of Louisville [email protected] October 24, 2015
Transcript
Page 1: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%

Dasymetrically Refined Areal Weighting

Matt Ruther University of Louisville

[email protected]

October 24, 2015

Page 2: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%

Police Districts

ZIP Tabulation Areas Council Districts

Census Block Groups

Different Zoning Systems

Page 3: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%

Metro Council District 8 45 Intersecting Block Groups

Example

โ€œTarget Zoneโ€ โ€œSource Zonesโ€

Page 4: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%
Page 5: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%

โ€œPopulationโ€ within target zone is estimated as % of source zone area within target zone

Areal Weighting (BG 211110069001)

0.02% ๐‘œ๐‘“ ๐‘™๐‘Ž๐‘›๐‘‘

75.62% ๐‘œ๐‘“ ๐‘™๐‘Ž๐‘›๐‘‘

24.36% ๐‘œ๐‘“ ๐‘™๐‘Ž๐‘›๐‘‘

Page 6: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%

National Land Cover Database

Page 7: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%

Land that is unlikely to contain โ€œpopulationโ€ is removed prior to the calculation of areas

Spatially Refined Areal Weighting

0.02% ๐‘œ๐‘“ ๐‘™๐‘Ž๐‘›๐‘‘

77.80% ๐‘œ๐‘“ ๐‘™๐‘Ž๐‘›๐‘‘

22.18% ๐‘œ๐‘“ ๐‘™๐‘Ž๐‘›๐‘‘

Page 8: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%

Spatially Refined Areal Weighting

26 Target Units 575 Source Units

1,100 Unioned Units

+

=

Page 9: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%

Areal Weighting

Page 10: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%

Areal Weighting

Page 11: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%

Areal Weighting

Page 12: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%

Areal Weighting

Page 13: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%

Land that is unlikely to contain โ€œpopulationโ€ is removed prior to calculation of areas

Spatially Refined Areal Weighting

๐‘๐‘œ๐‘๐‘ข๐‘™๐‘Ž๐‘ก๐‘–๐‘œ๐‘›๐‘๐‘”๐‘๐‘”

= 29,087.61

Page 14: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%

Spatially Refined Areal Weighting

๐‘๐‘œ๐‘๐‘ข๐‘™๐‘Ž๐‘ก๐‘–๐‘œ๐‘›๐‘๐‘”๐‘๐‘”

= 29,087.61

Page 15: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%

Validation and Accuracy

๐‘๐‘œ๐‘๐‘ข๐‘™๐‘Ž๐‘ก๐‘–๐‘œ๐‘›๐‘๐‘‘๐‘๐‘‘

= 746,580

โ„Ž๐‘œ๐‘ข๐‘ ๐‘–๐‘›๐‘” ๐‘ข๐‘›๐‘–๐‘ก๐‘ ๐‘๐‘‘๐‘๐‘‘

= 337,943

โ„Ž๐‘œ๐‘ข๐‘ ๐‘’โ„Ž๐‘œ๐‘™๐‘‘๐‘ ๐‘๐‘‘๐‘๐‘‘

= 305,832

These numbers should match (exactly) the sum from the

block groups and the county total given in the ACS!

How does error arise?

Page 16: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%

Block Group Data

All of the block group data should be entered in raw numbers (e.g., not proportions)

For metrics that are ratios, the numerator and denominator should be aggregated separately

The final step will be the calculation of the ratio, based on the numerator and the denominator aggregated within the council district

Page 17: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%

Load the required libraries (install them first if necessary)

The options command changes scientific notation in display

The file โ€œbg to council.csvโ€ contains the proportion of the block group that belongs within each council district

The file โ€œbg data.csvโ€ contains the block group demographic data

R code

library(foreign) library(rgeos) library(dplyr) options(scipen=999) prop<-read.csv("D:/onedrive/bellarmine/bg to council.csv") data<-read.csv("D:/onedrive/bellarmine/bg data.csv")

Page 18: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%

The left_join command joins the two datasets by geoid to create the master dataset โ€œjoinedโ€

The dataframe โ€œdata_adjโ€ is created to hold the areally weighted (adjusted) data

The dataframe โ€œdata_adjโ€ will contain an observation for each block group/council district intersection (n=1100)

R code

joined<-left_join(prop,data,by="geoid") data_adj<-data.frame(matrix(ncol=7,nrow=1100)) ### 'ncol'=number of vars colnames(data_adj)<-colnames(data) data_adj$geoid<-joined$geoid data_adj$coundist<-joined$coundist

Page 19: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%

The โ€œcโ€ and โ€œdโ€ variables are seeds for the loop

The loop multiplies each block group characteristic (e.g., population) by the block group proportion in each council district

The dataframe โ€œdata_adjโ€

R code

c<-1 d<-9 ### 9 is the column that the data begins in 'joined' for (i in 9:ncol(joined)) { data_adj[,c]<-joined[,d]*joined$prop_bg c<-c+1 d<-d+1 }

Page 20: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%

The summarise command sums the adjusted data for each variable over each of the council districts

The dataframe โ€œfinalโ€ holds the aggregated data, and should have a number of observations equal to the number of council districts (n=26)

This dataframe can be written to a .csv file (or other filetype)

R code

(data_adj %>% group_by(coundist) %>% summarise_each(funs(sum)) ) -> final write.csv(final,"C:/users/mhruth01/desktop/final.csv") # save in CSV format

Page 21: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%

GIS Data

Software โˆ’ ArcGIS โˆ’ QGIS โˆ’ R (or other statistical package)

Boundary Files

โˆ’ Shapefile โˆ’ Geodatabase โˆ’ Keyhole Markup Language (KML) (Google Earth)

Boundary File Sources โˆ’ Census TIGER

โˆ’ All administrative and statistical geographies plus features

โˆ’ National Historical GIS โˆ’ Includes data

โˆ’ Metro Data Portal

Page 22: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%

R can read both shapefiles and .kml files

Requires the rgdal package

The spTransform command changes the projection of the data

R code

### Read boundaries from KML file library(rgdal) ogrListLayers(dsn="D:/onedrive/bellarmine/metrocouncildistricts.kml") council<-readOGR("D:/onedrive/bellarmine/metrocouncildistricts.kml","Metro Council Districts") council<-spTransform(council,CRS("+init=epsg:2205")) ### Read boundaries from shapefile bg10<-readOGR(dsn="D:/onedrive/bellarmine",layer="bg10_refined") plot(bg10) council11<-readOGR(dsn="D:/onedrive/bellarmine",layer="council11") plot(council11)


Recommended