第4講 空間計量経済学

ある地域の観測値が近隣地域の観測値で推測できる時、そこには空間的自己相関が存在する.
この空間自己相関構造をもつ地理空間データに対して、近隣地域の観測値を説明項に入れた回帰モデルを空間自己回帰モデルという.
このモデルは、時系列分析え発展した自己回帰モデルの考え方を空間に拡張したものである.

$$ y = \rho W_1 y + X \beta + u $$$$ u = \lambda W_2 u + \epsilon $$$$ \epsilon \sim N(0, \sigma^2I_n $$


・$W_1, W_2$:空間重み行列


In [2]:
library(spdep)


Loading required package: sp
Loading required package: Matrix

In [3]:
data(oldcol)

In [5]:
names(COL.OLD)


Out[5]:
  1. 'AREA_PL'
  2. 'PERIMETER'
  3. 'COLUMBUS.'
  4. 'COLUMBUS.I'
  5. 'POLYID'
  6. 'NEIG'
  7. 'HOVAL'
  8. 'INC'
  9. 'CRIME'
  10. 'OPEN'
  11. 'PLUMB'
  12. 'DISCBD'
  13. 'X'
  14. 'Y'
  15. 'AREA_SS'
  16. 'NSA'
  17. 'NSB'
  18. 'EW'
  19. 'CP'
  20. 'THOUS'
  21. 'NEIGNO'
  22. 'PERIM'

In [13]:
COL.nb


Out[13]:
Neighbour list object:
Number of regions: 49 
Number of nonzero links: 232 
Percentage nonzero weights: 9.662641 
Average number of links: 4.734694 

In [12]:
COL.OLD


Out[12]:
AREA_PLPERIMETERCOLUMBUS.COLUMBUS.IPOLYIDNEIGHOVALINCCRIMEOPENellip.hXYAREA_SSNSANSBEWCPTHOUSNEIGNOPERIM
10010.2593292.236939312144.56721.23218.801755.2967235.6242.388.6211100100010012.236939
10020.0838411.427635524233.24.47732.387760.39442736.540.522.9081100100010021.427635
10030.2049542.139524938337.12511.33738.425863.48347836.7138.716.4391100100010032.139524
10040.2570842.5545778474758.4380.178269033.3638.4116.221100100010042.554577
10050.3094412.440629251580.46719.53115.725982.85074738.844.0710.3911110100010052.440629
10060.1924682.187547463626.3515.95630.626784.53464939.8241.186.9811110100010062.187547
10070.4888882.997133675723.22511.25250.731510.40566440.013816.8271110100010072.997133
10080.2830792.335634786828.7516.02926.066660.56307543.7539.288.9291110100010082.335634
10090.1066531.437606169159189.87348.585490.17432539.6134.913.2311111100010091.437606
10100.2466892.0872351110101096.413.59834.000841.54834847.6136.427.2681110100010102.087235
10110.1020871.3823591811171141.759.79836.868770.44823248.5834.463.4571110100010111.382359
10120.247122.1475282412231247.73321.15520.04850.53263249.6132.656.9010010100010122.147528
10130.185582.1089513313321340.318.94219.145592.22102250.1129.918.6710010100010132.108951
10140.1370241.5250974214411442.122.20718.905150.29331751.2427.84.6320010100010141.525097
10150.2452492.0799864815471542.518.9527.82286050.8925.247.9890010100010152.079986
10160.3029082.2854874116401661.9529.83316.24136.4513148.4427.938.7720010100010162.285486
10170.4446293.1746012117201781.26731.070.2237975.31860746.7331.9114.4530110100010173.174601
10180.5007553.169707101891852.617.58630.515920.52748843.4435.9216.1641110100010183.169707
10190.1928911.9927172319221930.4511.70933.705054.53975443.3733.466.841111100010191.992717
10200.1072981.4068232720262020.38.08540.969741.23828841.1333.143.71111100010201.406823
10210.1378021.7807512821272134.110.82252.7944319.368143.9531.615.70011100010211.780751
10220.0874721.5079713422332223.69.91841.96816044.130.42.0290011100010221.507971
10230.1754531.974937362335232712.81439.175054.22040143.729.186.380011100010231.974937
10240.0538810.9345093924382422.711.10753.71094041.0428.781.5570011100010240.934508
10250.1733371.8680444525442533.516.96125.962261.46399343.2327.316.3050010100010251.868044
10260.2059642.1991695026492635.818.79622.541490.25982642.6724.967.0050010100010262.199169
10270.0697621.1020324927482726.811.81326.645274.88438941.2125.92.6620011100010271.102032
10280.2564312.1930394628452827.73314.13529.028491.00611839.3225.858.7850011100010282.193039
10290.0602410.9677934429432925.713.3836.66361041.0927.492.2740011100010290.967793
10300.1211541.4022523830373043.317.01742.445084.83927338.3228.827.5730011100010301.402253
10310.1747731.6371482931283122.857.85656.919780.50930541.3130.95.1670011100010311.637148
10320.171681.6664892632253217.98.46161.29917039.3632.885.5541111100010321.666489
10330.0859721.3121583033293332.58.68160.75045039.7230.642.2180011100010331.312158
10340.1043551.5249313134303422.513.90668.892041.6387838.2930.353.1930001100010341.524931
10350.1922262.2403922535243553.214.23638.297870.6262236.632.096.02871101100010352.240392
10360.0931541.3400611736163618.87.62554.838710.53373737.634.083.591101100010361.34006
10370.0357690.9021251337123719.910.04856.705673.15789537.1336.121.4721101100010370.902125
10380.0410120.9194881238113819.77.46762.27545037.8536.31.2851101100010380.919488
10390.0343770.936591439133941.79.54946.71613035.9536.41.0931101100010390.93659
10400.0608841.1284241540144042.99.96357.066130.47710435.7235.62.0771101100010401.128423
10410.0613421.2492472041194130.611.61854.521970.11111135.7634.661.3691101100010411.249247
10420.0554941.183352194218426013.18543.9624924.9980736.1533.922.6911101100010421.183352
10430.6992585.077492243214319.97510.65540.074071.64375634.0830.4221.2820001100010435.077491
10440.2265942.5191323544344428.4514.94823.974033.02908730.3228.267.6080000100010442.519132
10450.1174091.7160473245314531.816.9417.677213.93644327.9429.853.8121100100010451.716046
10460.178131.7900583746364636.318.73914.305566.77333127.2728.215.1910000100010461.790058
10470.1748232.3354024047394739.618.47719.10086024.2526.696.4020000100010472.335402
10480.1247281.8410294748464876.118.32416.530539.68395325.4725.713.8220000100010481.841029
10490.2665412.1765434349424944.33325.87316.491891.79299329.0226.588.6950000100010492.176543

本講義で扱うデータを読み込む.
米国オハイオ州コロンバス市の犯罪データセットである.
近隣に住む1000世帯あたりの不法行為目的侵入および自動車窃盗(CRIME)、家の評価額(HOVAL、単位は\$1000)、世帯収入(INC、単位は\$1000)が含まれる。


In [8]:
COL.ols <- lm(CRIME ~ INC + HOVAL, data = COL.OLD)

In [9]:
summary(COL.ols)


Out[9]:
Call:
lm(formula = CRIME ~ INC + HOVAL, data = COL.OLD)

Residuals:
    Min      1Q  Median      3Q     Max 
-34.418  -6.388  -1.580   9.052  28.649 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  68.6190     4.7355  14.490  < 2e-16 ***
INC          -1.5973     0.3341  -4.780 1.83e-05 ***
HOVAL        -0.2739     0.1032  -2.654   0.0109 *  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 11.43 on 46 degrees of freedom
Multiple R-squared:  0.5524,	Adjusted R-squared:  0.5329 
F-statistic: 28.39 on 2 and 46 DF,  p-value: 9.341e-09

In [14]:
W <- nb2listw(COL.nb, style = "W")

In [18]:
moran.test(COL.OLD$CRIME, W)


Out[18]:
	Moran I test under randomisation

data:  COL.OLD$CRIME  
weights: W  

Moran I statistic standard deviate = 5.6341, p-value = 8.797e-09
alternative hypothesis: greater
sample estimates:
Moran I statistic       Expectation          Variance 
      0.510951264      -0.020833333       0.008908762 

In [15]:
lm.LMtests(COL.ols, listw = W, test = c("LMlag", "LMerr"))


Out[15]:
	Lagrange multiplier diagnostics for spatial dependence

data:  
model: lm(formula = CRIME ~ INC + HOVAL, data = COL.OLD)
weights: W

LMlag = 9.3637, df = 1, p-value = 0.002213


	Lagrange multiplier diagnostics for spatial dependence

data:  
model: lm(formula = CRIME ~ INC + HOVAL, data = COL.OLD)
weights: W

LMerr = 5.7231, df = 1, p-value = 0.01674

In [ ]: