> Sexample=read.csv("Sexample.csv")
> Uexample=read.csv("Uexample.csv")
> data(Sexample, package = "Ecdat")
警告信息:
In data(Sexample, package = "Ecdat") : 没有‘Sexample’这个数据集
> data(Uexample)
警告信息:
In data(Uexample) : 没有‘Uexample’这个数据集
> fm <- log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp
> ## the two standard specifications (SEM and SAR) one with FE
> ## and the other with RE:
> ## fixed effects panel with spatial errors
> fespaterr <- spml(fm, data = Sexample, listw = mat2listw(Uexample), model="within", spatial.error="b")
错误于mat2listw(Uexample) : x is not a matrix
> summary(fespaterr)
错误于summary(fespaterr) :
在为'summary'函数选择方法时评估'object'参数出了错: 错误: 找不到对象'fespaterr'
> ## random effects panel with spatial lag
> respatlag <- spml(fm, data = Sexample, listw = mat2listw(Uexample), model="random", spatial.error="none", lag=TRUE)
错误于mat2listw(Uexample) : x is not a matrix
> summary(respatlag)
错误于summary(respatlag) :
在为'summary'函数选择方法时评估'object'参数出了错: 错误: 找不到对象'respatlag'
>
> Example
错误: 找不到对象'Example'
> Sexample
X state year pcap hwy water util pc gsp emp unemp
1 1 ALABAMA 1970 15032.67 7325.80 1655.68 6051.20 35793.80 28418 1010.5 4.7
2 2 ALABAMA 1971 15501.94 7525.94 1721.02 6254.98 37299.91 29375 1021.9 5.2
3 3 ALABAMA 1972 15972.41 7765.42 1764.75 6442.23 38670.30 31303 1072.3 4.7
4 4 ALABAMA 1973 16406.26 7907.66 1742.41 6756.19 40084.01 33430 1135.5 3.9
5 5 ALABAMA 1974 16762.67 8025.52 1734.85 7002.29 42057.31 33749 1169.8 5.5
6 6 ALABAMA 1975 17316.26 8158.23 1752.27 7405.76 43971.71 33604 1155.4 7.7
7 7 ALABAMA 1976 17732.86 8228.19 1799.74 7704.93 50221.57 35764 1207.0 6.8
8 8 ALABAMA 1977 18111.93 8365.67 1845.11 7901.15 51084.99 37463 1269.2 7.4
9 9 ALABAMA 1978 18479.74 8510.64 1960.51 8008.59 52604
本文来自: 人大经济论坛 S-Plus&R专版 版,详细出处参考:
https://bbs.pinggu.org/forum.php? ... 5&from^^uid=11232