空间回归模型ppt课件

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Area/lattice data
Data reported for some regular or irregular areal unit
2 key components of spatial data:
Attribute data Spatial data
Tobler’s First Law of Geography
4. Run a OLS regression
Determine what type of spatial regression to run
5. Run a spatial regression
Apply weights matrix
Let’s start with spatial autocorrelation
“All places are related but nearby places are more related than distant places”
Spatial autocorrelation is the formal property that measures the degree to which near and distant things are related
Statistical test of match between locational similarity and attribute similarity
Positive, negative or zero relationship
Spatial regression
Steps in determining the extent of spatial autocorrelation in your data and running a spatial regression: 1. Choose a neighborhood criterion
> sids<-readShapePoly ("C:/Users/ERoot/Desktop/R/sids2.shp")
> class(sids) [1] "SpatialPolygonsDataFrame" attr(,"package")
Importing a shapefile (2)
> library(rgdal)
> sids<-readOGR dsn="C:/Users/ERoot/Desktop/R",layer="sids2") OGR data source with driver: ESRI Shapefile Source: "C:/Users/Elisabeth Root/Desktop/Quant/R/shapefiles", layer:
Which areas are linked?
2. Assign weights to the areas that are linked
Create a spatial weights matrix
3. Run statistical test to examine spatial autocorrelation
Spatial Autocorrelation and Spatial Regression
Elisabeth Root Department of Geography
A few good books…
Bivand, R., E.J. Pebesma and V. Gomez-Rubio.
Applied Spatial Data Analysis with R. New York:
Importing shapefiles into R and constructing neighborhood sets
R libraries we’ll use
SET YOUR CRAN MIRROR
> install.packages(“ctv”) > library(“ctv”) > install.views(“Spatial”)
How many “neighbors” to include, what distance do we use?
General weights (social distance, distance decay)
Step 1: Choose a neighborhood criterion
ቤተ መጻሕፍቲ ባይዱpatial weights matrices
Neighborhoods can be defined in a number of ways
Contiguity (common boundary)
What is a “shared” boundary?
Distance (distance band, K-nearest neighbors)
> library(maptools) > library(rgdal) > library(spdep)
You only need to do this once on your computer
Importing a shapefile
> library(maptools)
> getinfo.shape("C:/Users/ERoot/Desktop/R/sids2.shp") Shapefile type: Polygon, (5), # of Shapes: 100
"sids2" with 100 features and 18 fields Feature type: wkbPolygon with 2 dimensions
Springer.
Ward, M.D. and K.S. Gleditsch (2008). Spatial Regression Models. Thousand Oaks, CA: Sage.
First, a note on spatial data
Point data
Accuracy of location is very important
相关文档
最新文档