dasymetrically refined areal weighting refined areal weighting matt ruther university of louisville...
TRANSCRIPT
![Page 1: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/1.jpg)
Dasymetrically Refined Areal Weighting
Matt Ruther University of Louisville
October 24, 2015
![Page 2: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/2.jpg)
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 %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/3.jpg)
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 %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/4.jpg)
![Page 5: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/5.jpg)
“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 %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/6.jpg)
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 %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/7.jpg)
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 %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/8.jpg)
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 %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/9.jpg)
Areal Weighting
![Page 10: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/10.jpg)
Areal Weighting
![Page 11: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/11.jpg)
Areal Weighting
![Page 12: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/12.jpg)
Areal Weighting
![Page 13: Dasymetrically Refined Areal Weighting Refined Areal Weighting Matt Ruther University of Louisville ... (or other filetype) R code (data_adj %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/13.jpg)
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 %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/14.jpg)
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 %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/15.jpg)
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 %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/16.jpg)
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 %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/17.jpg)
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 %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/18.jpg)
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 %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/19.jpg)
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 %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/20.jpg)
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 %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/21.jpg)
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 %>%](https://reader031.vdocuments.net/reader031/viewer/2022030416/5aa1cce57f8b9a84398c2ab0/html5/thumbnails/22.jpg)
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)