logo
分类于: 计算机基础 云计算&大数据

简介

Applied Spatial Data Analysis with R, Second Edition

Applied Spatial Data Analysis with R, Second Edition 0.0分

资源最后更新于 2020-11-26 07:36:30

作者:Roger S. Bivand

出版社:Springer

出版日期:2013-01

ISBN:9781461476177

文件格式: pdf

标签: R 空间分析 数据挖掘 地理 R语言 GIS 统计学 经济商业统计

简介· · · · · ·

Applied Spatial Data Analysis with R, second edition, is divided into two basic parts, the first presenting R packages, functions, classes and methods for handling spatial data. This part is of interest to users who need to access and visualise spatial data. Data import and export for many file formats for spatial data are covered in detail, as is the interface between R and th...

想要: 点击会收藏到你的 我的收藏,可以在这里查看

已收: 表示已经收藏

Tips: 注册一个用户 可以通过用户中心得到电子书更新的通知哦

目录

Preface (Second Edition) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
Preface (First Edition) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
1 Hello World: Introducing Spatial Data . . . . . . . . . . . . . . . . . . . 1
1.1 Applied Spatial Data Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Why Do We Use R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.1 ... In General? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.2 ...for Spatial Data Analysis? . . . . . . . . . . . . . . . . . . . . . . 3
1.2.3 ...and for Reproducible Research? . . . . . . . . . . . . . . . . . 4
1.3 R and GIS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3.1 What Is GIS? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3.2 Service-Oriented Architectures . . . . . . . . . . . . . . . . . . . . . 6
1.3.3 Further Reading on GIS. . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4 Types of Spatial Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.5 Storage and Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.6 Applied Spatial Data Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.7 R Spatial Resources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.8 Layout of the Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Part I Handling Spatial Data in R
2 Classes for Spatial Data in R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.2 Classes and Methods in R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.3 Spatial Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.4 SpatialPoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.4.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.4.2 Data Frames for Spatial Point Data . . . . . . . . . . . . . . . . 33
2.5 SpatialLines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.6 SpatialPolygons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.6.1 SpatialPolygonsDataFrame Objects . . . . . . . . . . . . . . . 44
2.6.2 Holes and Ring Direction. . . . . . . . . . . . . . . . . . . . . . . . . . 46
2.7 SpatialGrid and SpatialPixel Objects . . . . . . . . . . . . . . . . . . 48
2.8 Raster Objects and the raster Package . . . . . . . . . . . . . . . . . . . 54
3 Visualising Spatial Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.1 The Traditional Plot System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.1.1 Plotting Points, Lines, Polygons, and Grids . . . . . . . . . . 60
3.1.2 Axes and Layout Elements . . . . . . . . . . . . . . . . . . . . . . . . 61
3.1.3 Degrees in Axes Labels and Reference Grid . . . . . . . . . . 65
3.1.4 Plot Size, Plotting Area, Map Scale,
and Multiple Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
3.1.5 Plotting Attributes and Map Legends . . . . . . . . . . . . . . . 68
3.2 Trellis/Lattice Plots with spplot .. . . . . . . . . . . . . . . . . . . . . . . . 69
3.2.1 A Straight Trellis Example . . . . . . . . . . . . . . . . . . . . . . . . 70
3.2.2 Plotting Points, Lines, Polygons, and Grids . . . . . . . . . . 70
3.2.3 Adding Reference and Layout Elements to Plots . . . . . 73
3.2.4 Arranging Panel Layout .. . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.3 Alternatives Routes: ggplot, latticeExtra . . . . . . . . . . . . . . . . . 75
3.4 Interactive Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
3.4.1 Interacting with Base Graphics. . . . . . . . . . . . . . . . . . . . . 77
3.4.2 Interacting with spplot and Lattice Plots . . . . . . . . . . . 78
3.5 Colour Palettes and Class Intervals . . . . . . . . . . . . . . . . . . . . . . . 79
3.5.1 Colour Palettes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
3.5.2 Class Intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
4 Spatial Data Import and Export . . . . . . . . . . . . . . . . . . . . . . . . . . 83
4.1 Coordinate Reference Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
4.1.1 Using the EPSG List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
4.1.2 PROJ.4 CRS Specification. . . . . . . . . . . . . . . . . . . . . . . . . 86
4.1.3 Projection and Transformation .. . . . . . . . . . . . . . . . . . . . 88
4.1.4 Degrees, Minutes, and Seconds . . . . . . . . . . . . . . . . . . . . . 90
4.2 Vector File Formats. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
4.2.1 Using OGR Drivers in rgdal . . . . . . . . . . . . . . . . . . . . . . . 92
4.2.2 Other Import/Export Functions. . . . . . . . . . . . . . . . . . . . 99
4.3 Raster File Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
4.3.1 Using GDAL Drivers in rgdal . . . . . . . . . . . . . . . . . . . . . . 100
4.3.2 Other Import/Export Functions. . . . . . . . . . . . . . . . . . . . 107
4.4 Google Earth™, Google Maps™ and Other Formats . . . . . . . . . 108
4.5 Geographical Resources Analysis Support System (GRASS). . 112
4.5.1 Broad Street Cholera Data . . . . . . . . . . . . . . . . . . . . . . . . 118
4.6 Other Import/Export Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . 122
4.6.1 Analysis and Visualisation Applications . . . . . . . . . . . . . 122
4.6.2 TerraLib and aRT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
4.6.3 Other GIS Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
4.7 Installing rgdal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
5 Further Methods for Handling Spatial Data . . . . . . . . . . . . . . 127
5.1 Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
5.2 Handling and Combining Features . . . . . . . . . . . . . . . . . . . . . . . . 130
5.2.1 The rgeos Package.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
5.2.2 Using rgeos.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
5.3 Map Overlay or Spatial Join . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
5.3.1 Spatial Aggregation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
5.3.2 Using the raster Package for Extract Operations . . . . . 145
5.3.3 Spatial Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
5.4 Auxiliary Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
6 Spatio-Temporal Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
6.2 Types of Spatio-Temporal Data . . . . . . . . . . . . . . . . . . . . . . . . . . 151
6.2.1 Spatial Point or Area, Time Instance or Interval. . . . . . 152
6.2.2 Are Space and Time of Primary Interest? . . . . . . . . . . . 152
6.2.3 Regularity of Space-Time Layouts . . . . . . . . . . . . . . . . . . 152
6.2.4 Do Objects Change Location? . . . . . . . . . . . . . . . . . . . . . 153
6.3 Classes in spacetime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
6.4 Handling Time Series Data with xts . . . . . . . . . . . . . . . . . . . . . . 155
6.5 Construction of STObjects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
6.6 Selection, Addition, and Replacement of Attributes . . . . . . . . . 158
6.7 Overlay and Aggregation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
6.8 Visualisation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
6.8.1 Multi-panel Plots. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
6.8.2 Space-Time Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
6.8.3 Animated Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
6.8.4 Time Series Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
6.9 Further Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
6.9.1 Handling Spatio-Temporal Data . . . . . . . . . . . . . . . . . . . . 165
6.9.2 Analysing Spatio-Temporal Data . . . . . . . . . . . . . . . . . . . 165
6.10 Outlook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Part II Analysing Spatial Data
7 Spatial Point Pattern Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
7.2 Packages for the Analysis of Spatial Point Patterns . . . . . . . . . 174
7.3 Preliminary Analysis of a Point Pattern . . . . . . . . . . . . . . . . . . . 178
7.3.1 Complete Spatial Randomness . . . . . . . . . . . . . . . . . . . . . 179
7.3.2 G Function: Distance to the Nearest Event . . . . . . . . . . 179
7.3.3 F Function: Distance from a Point
to the Nearest Event. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
7.4 Statistical Analysis of Spatial Point Processes . . . . . . . . . . . . . . 182
7.4.1 Homogeneous Poisson Processes .. . . . . . . . . . . . . . . . . . . 183
7.4.2 Inhomogeneous Poisson Processes . . . . . . . . . . . . . . . . . . 184
7.4.3 Estimation of the Intensity . . . . . . . . . . . . . . . . . . . . . . . . 184
7.4.4 Likelihood of an Inhomogeneous Poisson Process . . . . . 187
7.4.5 Second-Order Properties . . . . . . . . . . . . . . . . . . . . . . . . . . 190
7.5 Some Applications in Spatial Epidemiology . . . . . . . . . . . . . . . . 192
7.5.1 Case–Control Studies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
7.5.2 Binary Regression Estimator.. . . . . . . . . . . . . . . . . . . . . . 198
7.5.3 Binary Regression Using Generalised
Additive Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
7.5.4 Point Source Pollution . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
7.5.5 Accounting for Confounding and Covariates . . . . . . . . . 206
7.6 Further Methods for the Analysis
of Point Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
8 Interpolation and Geostatistics . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
8.2 Exploratory Data Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
8.3 Non-geostatistical Interpolation Methods . . . . . . . . . . . . . . . . . . 215
8.3.1 Inverse Distance Weighted Interpolation. . . . . . . . . . . . . 215
8.3.2 Linear Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
8.4 Estimating Spatial Correlation: The Variogram.. . . . . . . . . . . . 217
8.4.1 Exploratory Variogram Analysis. . . . . . . . . . . . . . . . . . . . 219
8.4.2 Cutoff, Lag Width, Direction Dependence . . . . . . . . . . . 222
8.4.3 Variogram Modelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
8.4.4 Anisotropy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
8.4.5 Multivariable Variogram Modelling . . . . . . . . . . . . . . . . . 229
8.4.6 Residual Variogram Modelling . . . . . . . . . . . . . . . . . . . . . 230
8.5 Spatial Prediction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
8.5.1 Universal, Ordinary, and Simple Kriging . . . . . . . . . . . . 233
8.5.2 Multivariable Prediction: Cokriging .. . . . . . . . . . . . . . . . 233
8.5.3 Collocated Cokriging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
8.5.4 Cokriging Contrasts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
8.5.5 Kriging in a Local Neighbourhood . . . . . . . . . . . . . . . . . . 237
8.5.6 Change of Support: Block Kriging . . . . . . . . . . . . . . . . . . 238
8.5.7 Stratifying the Domain. . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
8.5.8 Trend Functions and Their Coefficients. . . . . . . . . . . . . . 241
8.5.9 Non-linear Transforms of the Response Variable . . . . . . 242
8.5.10 Singular Matrix Errors .. . . . . . . . . . . . . . . . . . . . . . . . . . . 243
8.6 Kriging, Filtering, Smoothing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
8.7 Model Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
8.7.1 Cross Validation Residuals . . . . . . . . . . . . . . . . . . . . . . . . 247
8.7.2 Cross Validation z-Scores.. . . . . . . . . . . . . . . . . . . . . . . . . 249
8.7.3 Multivariable Cross Validation . . . . . . . . . . . . . . . . . . . . . 250
8.7.4 Limitations to Cross Validation . . . . . . . . . . . . . . . . . . . . 250
8.8 Geostatistical Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
8.8.1 Sequential Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
8.8.2 Non-linear Spatial Aggregation and Block Averages.. . 254
8.8.3 Multivariable and Indicator Simulation. . . . . . . . . . . . . . 255
8.9 Model-Based Geostatistics and Bayesian Approaches .. . . . . . . 256
8.10 Monitoring Network Optimisation . . . . . . . . . . . . . . . . . . . . . . . . 256
8.11 Other R Packages for Interpolation and Geostatistics. . . . . . . . 258
8.11.1 Non-geostatistical Interpolation . . . . . . . . . . . . . . . . . . . . 258
8.11.2 Spatial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
8.11.3 RandomFields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
8.11.4 geoR and geoRglm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
8.11.5 Fields. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
8.11.6 spBayes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
8.12 Spatio-Temporal Prediction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
9 Modelling Areal Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
9.2 Spatial Neighbours and Spatial Weights . . . . . . . . . . . . . . . . . . . 266
9.2.1 Neighbour Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
9.2.2 Spatial Weights Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
9.2.3 Handling Spatial Weights Objects . . . . . . . . . . . . . . . . . . 273
9.2.4 Using Weights to Simulate Spatial Autocorrelation . . . 274
9.3 Testing for Spatial Autocorrelation . . . . . . . . . . . . . . . . . . . . . . . 275
9.3.1 Global Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
9.3.2 Local Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
9.4 Fitting Models of Areal Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
9.4.1 Spatial Statistics Approaches . . . . . . . . . . . . . . . . . . . . . . 290
9.4.2 Spatial Econometrics Approaches. . . . . . . . . . . . . . . . . . . 303
9.4.3 Other Methods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
10 Disease Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
10.2 Statistical Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
10.2.1 Poisson-Gamma Model. . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
10.2.2 Log-Normal Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
10.2.3 Marshall’s Global EB Estimator. . . . . . . . . . . . . . . . . . . . 326
10.3 Spatially Structured Statistical Models . . . . . . . . . . . . . . . . . . . . 328
10.4 Bayesian Hierarchical Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
10.4.1 The Poisson-Gamma Model Revisited . . . . . . . . . . . . . . . 332
10.4.2 Spatial Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
10.5 Geoadditive Models. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
10.6 Detection of Clusters of Disease . . . . . . . . . . . . . . . . . . . . . . . . . . 347
10.6.1 Testing the Homogeneity of the Relative Risks . . . . . . . 348
10.6.2 Moran’s I Test of Spatial Autocorrelation . . . . . . . . . . . 350
10.6.3 Tango’s Test of General Clustering . . . . . . . . . . . . . . . . . 351
10.6.4 Detection of the Location of a Cluster . . . . . . . . . . . . . . 352
10.6.5 Geographical Analysis Machine . . . . . . . . . . . . . . . . . . . . 353
10.6.6 Kulldorff’s Statistic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
10.6.7 Stone’s Test for Localised Clusters. . . . . . . . . . . . . . . . . . 355
10.7 Spatio-Temporal Disease Mapping . . . . . . . . . . . . . . . . . . . . . . . . 356
10.7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
10.7.2 Spatio-Temporal Modelling of Disease. . . . . . . . . . . . . . . 357
10.8 Other Topics in Disease Mapping . . . . . . . . . . . . . . . . . . . . . . . . . 361
Afterword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
R and Package Versions Used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
Data Sets Used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
Subject Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Functions Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401