kk22boy 发表于 2011-12-16 15:42 
谢谢epoh兄的回复!
systemfit包我已经看过,这个包好像是对面板的sur模型进行回归,并不是对面板联立方 ...
kk22boy老兄
我忘掉了R package "plm"
有个pseries (panel series)
A class for panel series for which several
useful computations are available.
底下有些function可用
between(x, ...)
Between(x, ...)
Within(x, ...)
#data type1
between-groups
#data type2
between-time-periods
#data type3
within-groups-and-time-periods
有了这些function,配合package "systemfit"
eq1= y1 ~ y2 + y3 + x1 + x2 + x3-1;
eq2= y2 ~ z1 + z2 + z3 + x1 + x2 + x3-1;
eq3= y3 ~ z1 + z2 + z3 + x1 + x2 + x3-1;
eq=list(eq1,eq2,eq3)
inst <- ~ z1+ z2+ z3+ x1+ x2+ x3
systemfit( eq, "3SLS",inst=inst,data = type1,control = systemfit.control
(methodResidCov = "noDfCor",method3sls = "GLS"))
systemfit( eq, "3SLS",inst=inst,data = type2,control = systemfit.control
(methodResidCov = "noDfCor",method3sls = "GLS"))
systemfit( eq, "3SLS",inst=inst,data = type3,control = systemfit.control
(methodResidCov = "noDfCor",method3sls = "GLS"))
就可依据 Analysis of Panel Data_CHENG HSIAO
chap5 Simultaneous-Equations Models
page 126 formula(5.3.24),formula(5.3.25)
结合出 EC3SLS estimator.
It is a
weighted combination of three 3SLS
(within, between-groups, and between-time-periods)
estimators of the structural parameters (
Baltagi (1981a)).
##########
es3sls.csv是个artificial data
N = 20, T = 10 , NT=N*T;
这个数据在TSP运行的结果是:
EC3SLS estimates
================
Standard
Parameter Estimate Error t-statistic P-value
AY2 2.09867 .173249 12.1136 [.000]
AY3 2.81814 .173011 16.2888 [.000]
AX1 1.05647 .273610 3.86122 [.000]
AX2 2.23706 .468995 4.76989 [.000]
AX3 3.19135 .619738 5.14952 [.000]
BZ1 .841134 .065666 12.8093 [.000]
BZ2 1.79433 .083007 21.6165 [.000]
BZ3 2.95608 .088837 33.2752 [.000]
BX1 .833237 .085284 9.77011 [.000]
BX2 1.84213 .085569 21.5281 [.000]
BX3 4.26827 .082978 51.4388 [.000]
CZ1 1.10205 .063534 17.3459 [.000]
CZ2 3.06440 .086328 35.4972 [.000]
CZ3 1.94955 .091493 21.3082 [.000]
CX1 1.08035 .087626 12.3291 [.000]
CX2 4.00091 .087992 45.4693 [.000]
CX3 .928418 .085612 10.8444 [.000]
#########
同样数据在R运行的结果,
几乎与TSP相同.
> coef
Value Std. Error t value Pr(>|t|)
1 2.0986729 0.17324959 12.113581 0.000000e+00
2 2.8181408 0.17301123 16.288774 0.000000e+00
3 1.0564684 0.27361058 3.861212 1.128260e-04
4 2.2370508 0.46899628 4.769869 1.843458e-06
5 3.1913567 0.61973874 5.149519 2.611548e-07
6 0.8411371 0.06566620 12.809286 0.000000e+00
7 1.7943307 0.08300745 21.616503 0.000000e+00
8 2.9560759 0.08883729 33.275170 0.000000e+00
9 0.8332361 0.08528437 9.770092 0.000000e+00
10 1.8421346 0.08556889 21.528087 0.000000e+00
11 4.2682707 0.08297780 51.438708 0.000000e+00
12 1.1020543 0.06353414 17.345859 0.000000e+00
13 3.0644023 0.08632836 35.497053 0.000000e+00
14 1.9495534 0.09149329 21.308157 0.000000e+00
15 1.0803494 0.08762621 12.329067 0.000000e+00
16 4.0009113 0.08799192 45.469075 0.000000e+00
17 0.9284183 0.08561262 10.844410 0.000000e+00