जब से यहोशू Katz प्रकाशित इन dialect maps कि आप all over the webharvard's dialect survey का उपयोग कर प्राप्त कर सकते हैं, मैं कॉपी करने के लिए कोशिश कर रहे हैं और उसकी विधियों को सामान्यीकृत करें .. लेकिन इनमें से अधिकतर मेरे सिर पर है। जोश ने अपनी कुछ विधियों को in this poster का खुलासा किया, लेकिन (जहां तक मुझे पता है) ने अपने किसी भी कोड का खुलासा नहीं किया है।कैसे आर में भारित (सर्वे) डेटा के साथ सुंदर सीमारहित भौगोलिक विषयक/हीटमैप बनाने के लिए, शायद बिंदु टिप्पणियों पर स्थानिक चौरसाई का उपयोग कर
मेरा लक्ष्य इन विधियों को सामान्यीकृत करना है, इसलिए किसी भी संयुक्त राज्य सरकार के सर्वेक्षण डेटा के उपयोगकर्ताओं के लिए यह आसान है कि वे अपने भारित डेटा को एक फ़ंक्शन में डाल दें और उचित भौगोलिक मानचित्र प्राप्त करें। भूगोल भिन्न होता है: कुछ सर्वेक्षण डेटा सेटों में जेडसीटीए होते हैं, कुछ में काउंटी होती है, कुछ में राज्य होते हैं, कुछ मेट्रो क्षेत्र आदि होते हैं। सेंट्रॉइड पर प्रत्येक बिंदु की साजिश करके शुरू करना शायद स्मार्ट है - सेंट्रॉइड पर here पर चर्चा की जाती है और अधिकांश भूगोल में उपलब्ध है the census bureau's 2010 gazetteer files। इसलिए, प्रत्येक सर्वेक्षण डेटा बिंदु के लिए, आपके पास मानचित्र पर एक बिंदु है। लेकिन कुछ सर्वेक्षण प्रतिक्रियाओं में वजन 10 है, दूसरों के वजन 100,000 है! जाहिर है, जो भी "गर्मी" या चिकनाई या रंग जो आखिरकार नक्शे पर समाप्त होता है, अलग-अलग वजन के लिए खाते की आवश्यकता होती है।
मैं सर्वेक्षण डेटा के साथ अच्छा हूं लेकिन मुझे स्थानिक चिकनाई या कर्नेल अनुमान के बारे में कुछ भी पता नहीं है। जोश जो उसके पोस्टर में उपयोग करता है वह k-nearest neighbor kernel smoothing with gaussian kernel
है जो मेरे लिए विदेशी है। मैं मैपिंग में एक नौसिखिया हूं, लेकिन अगर मैं जानता हूं कि लक्ष्य क्या होना चाहिए तो मैं आम तौर पर काम कर सकता हूं।
नोट: यह प्रश्न a question asked ten months ago that no longer contains available data के समान है। on this thread की जानकारी के टिड-बिट भी हैं, लेकिन अगर किसी के पास मेरे सटीक प्रश्न का उत्तर देने का एक स्मार्ट तरीका है, तो मैं स्पष्ट रूप से इसे देखता हूं।
आर सर्वेक्षण पैकेज में svyplot
फ़ंक्शन है, और यदि आप कोड की इन पंक्तियों को चलाते हैं, तो आप कार्टेशियन निर्देशांक पर भारित डेटा देख सकते हैं। लेकिन वास्तव में, मैं जो करना चाहता हूं, उसके लिए साजिश को मानचित्र पर ओवरलैड करने की आवश्यकता है।
library(survey)
data(api)
dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat, fpc=~fpc)
svyplot(api00~api99, design=dstrat, style="bubble")
मामले में यह किसी काम के नहीं है, मैं कुछ उदाहरण कोड है कि किसी को मुझे एक त्वरित तरीका कोर आधारित सांख्यिकीय क्षेत्रों (एक और भूगोल प्रकार) पर कुछ सर्वेक्षण डेटा के साथ शुरू करने के लिए सहायता करने के इच्छुक दे देंगे पोस्ट किया है।
कोई भी विचार, सलाह, मार्गदर्शन की सराहना की जाएगी (और श्रेय अगर मैं एक औपचारिक ट्यूटोरियल प्राप्त कर सकते हैं/http://asdfree.com/ के लिए/कैसे लिखा मार्गदर्शन)
धन्यवाद !!!!!!!!!!
# load a few mapping libraries
library(rgdal)
library(maptools)
library(PBSmapping)
# specify some population data to download
mydata <- "http://www.census.gov/popest/data/metro/totals/2012/tables/CBSA-EST2012-01.csv"
# load mydata
x <- read.csv(mydata , skip = 9 , h = F)
# keep only the GEOID and the 2010 population estimate
x <- x[ , c('V1' , 'V6') ]
# name the GEOID column to match the CBSA shapefile
# and name the weight column the weight column!
names(x) <- c('GEOID10' , "weight")
# throw out the bottom few rows
x <- x[ 1:950 , ]
# convert the weight column to numeric
x$weight <- as.numeric(gsub(',' , '' , as.character(x$weight)))
# now just make some fake trinary data
x$trinary <- c(rep(0:2 , 316) , 0:1)
# simple tabulation
table(x$trinary)
# so now the `x` data file looks like this:
head(x)
# and say we just wanted to map
# something easy like
# 0=red, 1=green, 2=blue,
# weighted simply by the population of the cbsa
# # # end of data read-in # # #
# # # shapefile read-in? # # #
# specify the tiger file to download
tiger <- "ftp://ftp2.census.gov/geo/tiger/TIGER2010/CBSA/2010/tl_2010_us_cbsa10.zip"
# create a temporary file and a temporary directory
tf <- tempfile() ; td <- tempdir()
# download the tiger file to the local disk
download.file(tiger , tf , mode = 'wb')
# unzip the tiger file into the temporary directory
z <- unzip(tf , exdir = td)
# isolate the file that ends with ".shp"
shapefile <- z[ grep('shp$' , z) ]
# read the shapefile into working memory
cbsa.map <- readShapeSpatial(shapefile)
# remove CBSAs ending with alaska, hawaii, and puerto rico
cbsa.map <- cbsa.map[ !grepl("AK$|HI$|PR$" , cbsa.map$NAME10) , ]
# cbsa.map$NAME10 now has a length of 933
length(cbsa.map$NAME10)
# convert the cbsa.map shapefile into polygons..
cbsa.ps <- SpatialPolygons2PolySet(cbsa.map)
# but for some reason, cbsa.ps has 966 shapes??
nrow(unique(cbsa.ps[ , 1:2 ]))
# that seems wrong, but i'm not sure how to fix it?
# calculate the centroids of each CBSA
cbsa.centroids <- calcCentroid(cbsa.ps)
# (ignoring the fact that i'm doing something else wrong..because there's 966 shapes for 933 CBSAs?)
# # # # # # as far as i can get w/ mapping # # # #
# so now you've got
# the weighted data file `x` with the `GEOID10` field
# the shapefile with the matching `GEOID10` field
# the centroids of each location on the map
# can this be mapped nicely?
गिरी सामान्य रूप में चौरसाई के बारे में जानने के लिए, मैं अत्यधिक अध्याय 6 Hastie, Tibshirani की सलाह देते हैं है, और फ्राइडमैन के [ सांख्यिकीय सीखने के तत्व] (http://statweb.stanford.edu/~tibs/ElemStatLearn/)। फॉर्मूला 6.5 (और इसके चारों ओर का पाठ!) बताता है कि एक के-निकटतम पड़ोसी कर्नेल (संभवतः गॉसियन) एक आयाम में कैसा दिखता है। एक बार जब आप इसे समझ लेंगे, तो दो आयामों का विस्तार अवधारणात्मक रूप से सरल है। (इसे कार्यान्वित करना एक और मामला है, और किसी और को फिर से वजन करना होगा: आर में मौजूदा कार्यान्वयन) –
@ जोशो'ब्रायन धन्यवाद! ऐसा लगता है कि पूरी पुस्तक वेब पर है और जिस सूत्र का आप उल्लेख कर रहे हैं वह http://datweb.stanford.edu/~tibs/ElemStatLearn/printings/ESLII_print10.pdf#page=212 –
के पीडीएफ पृष्ठ 212 पर है उन मानचित्रों ने आज एनईटी फ्रंट पेज पर क्लिक किया: http://www.nytimes.com/interactive/2014/05/12/upshot/12-upshot-nba-basketball.html?hp –