楼主: zhangtao
10523 26

FMOLS Panel Group estimator [推广有奖]

21
ywh19860616 发表于 2011-11-16 22:29:23
epoh 发表于 2011-11-16 20:24
1.哈哈!两个虽然同名同性  但是语法不同  gauss 有gauss语法  winrats 有winrats语法,两者不能混用  不像OX ...
呵呵,是的啊,两者不能互相调用,要不就得一个软件要消失了
epoh老师,对您提到的这句话不能理解:
鼠移往右边slider按住,就可看到row number,找出错误修改

鼠标往右边滚动按住吗?这个不懂操作

我看错误提示是直接打开gauss_panel.prg,然后按照
c:\gauss9.0\examples\gauss_panel.prg(83) : error G0121 : Matrix not positive definite
提示,找到83行xxi = invpd(xp'xp);               /* keep the (x'x)^-1 matrix  
这里应该是指这个矩阵非正定,而不能求逆引起的

epoh老师,我没有找出您修改了哪个语句?


一份耕耘,一份收获。

22
epoh 发表于 2011-11-17 11:10:08

panel.prg程序,原本就是对的,没改.

20楼给的panel for gauss,内含数据,你跑看看

#########

要看line number,方法有二

1.压下sliderbar滑动

  Help\4. Introduction to the Windows Interface (Figure 4.1).

  command input-output window sliderbar(最右边)

  鼠标压下去滑动,就可看到line number

2.Help\4.1.16 GAUSS Status Bar

  Cursor Location

  The line number and column number where the cursor is located appear

  on the status bar for the active window. When a block of text is selected,

  the values indicate the first position of the selected text.

已有 1 人评分学术水平 热心指数 信用等级 收起 理由
ywh19860616 + 5 + 5 + 5 非常感谢您,epoh老师

总评分: 学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

23
ywh19860616 发表于 2011-11-17 12:37:53
epoh 发表于 2011-11-17 11:10
panel.prg程序,原本就是对的,没改.20楼给的panel for gauss,内含数据,你跑看看 #########要看line number,方 ...
恩,20楼程序可以运行,那可能是我自己下载的数据有问题
对于查找错误,我找下手册看看
哈哈,我太愚钝了

这次安装的gauss9好像也有点问题,点击help-keyboard,这个界面都打不开




一份耕耘,一份收获。

24
epoh 发表于 2011-11-17 13:53:26

我的Help\Keyboard也打不开

我都是看Help\User' Guide, Help\Reference

我楼上说的Help\,指的就是Help\User' Guide\

已有 1 人评分学术水平 热心指数 信用等级 收起 理由
ywh19860616 + 1 + 1 + 1 谢谢epoh老师,清楚了

总评分: 学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

25
zhangtao 发表于 2011-11-17 15:33:04
epoh 发表于 2011-11-15 15:57
上传底下两个文件,供你比较.两者使用的数据都是Grunfeld.datgauss_Panel是你曾上传过的. panel.prg (winrat ...
*
* PANEL.PRG
* Manual Example 14.4
*
cal(panelobs=20) 1935
all 10//1954:1
open data grunfeld.dat
data(format=prn,org=cols)
*
* Do fixed and random effect. The intercept is dropped from the fixed effects
* regression since it will be wiped out as a time-invariant variable
*
preg(method=fixed) invest
# firmvalue cstock
preg(method=random) invest
# constant firmvalue cstock
preg(method=fd) invest
# firmvalue cstock
preg(method=sur) invest
# constant firmvalue cstock
*
* Do fixed effects as least squares with dummy variables
*
dec vect[series] idummies(10)
do i=1,10
   set idummies(i) = %indiv(t)==i
end do i
linreg invest
# firmvalue cstock idummies
*
* Do random effects by using panel data transformations. %VRANDOM and %VINDIV are
* the estimates of the component variances from the PREGRESS instructions. The
* coefficient estimates are identical to those from PREGRESS, but the standard
* errors are slightly different because the LINREG on the transformed variables
* estimates a new SIGMA**2, while PREGRESS uses the %VRANDOM value.
*
compute theta=1-sqrt(%vrandom/(%vrandom+20*%vindiv))
panel(entry=1.0,indiv=-theta) invest / ifix
panel(entry=1.0,indiv=-theta) firmvalue / ffix
panel(entry=1.0,indiv=-theta) cstock / cfix
set constfix = 1-theta
linreg ifix
# constfix ffix cfix
## IO40. Expected SERIES NAME. Got "INTEGER".
## SX11. Identifier INVEST is Not Recognizable. Incorrect Option Field or Parameter Order?
>>>>thod=fixed) invest<<<<
epoh老师,您好!
为什么在winrats7中运行这个winratespanel程序会出现以上错误呢?
数学好就是要天天学

26
epoh 发表于 2011-11-17 17:54:02

zhangtao兄,程序没错.

我直接copy你贴上来的程序

还是可以执行.

更何况这是winrats自带的程序与数据.

难道你的winrats grunfeld.dat数据有混淆

grunfeld.dat 在gauss & winrats 是不同的.

已有 1 人评分学术水平 热心指数 信用等级 收起 理由
zhangtao + 5 + 5 + 5 对epoh大师致以最崇高的敬意!深表佩服!非.

总评分: 学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

27
zhangtao 发表于 2011-11-18 09:05:09
epoh 发表于 2011-11-17 17:54
zhangtao兄,程序没错.我直接copy你贴上来的程序还是可以执行.更何况这是winrats自带的程序与数据.难道你的w ...
epoh老师,您好!
确实是数据弄错了,非常感谢!
*
* PANEL.PRG
* Manual Example 14.4
*
cal(panelobs=20) 1935
all 10//1954:1
open data grunfeld.dat
data(format=prn,org=cols)
*
* Do fixed and random effect. The intercept is dropped from the fixed effects
* regression since it will be wiped out as a time-invariant variable
*
preg(method=fixed) invest
# firmvalue cstock
preg(method=random) invest
# constant firmvalue cstock
preg(method=fd) invest
# firmvalue cstock
preg(method=sur) invest
# constant firmvalue cstock
*
* Do fixed effects as least squares with dummy variables
*
dec vect[series] idummies(10)
do i=1,10
   set idummies(i) = %indiv(t)==i
end do i
linreg invest
# firmvalue cstock idummies
*
* Do random effects by using panel data transformations. %VRANDOM and %VINDIV are
* the estimates of the component variances from the PREGRESS instructions. The
* coefficient estimates are identical to those from PREGRESS, but the standard
* errors are slightly different because the LINREG on the transformed variables
* estimates a new SIGMA**2, while PREGRESS uses the %VRANDOM value.
*
compute theta=1-sqrt(%vrandom/(%vrandom+20*%vindiv))
panel(entry=1.0,indiv=-theta) invest / ifix
panel(entry=1.0,indiv=-theta) firmvalue / ffix
panel(entry=1.0,indiv=-theta) cstock / cfix
set constfix = 1-theta
linreg ifix
# constfix ffix cfix



Panel Regression - Estimation by Fixed Effects
Dependent Variable INVEST
Panel(20) of Annual Data From      1//1935:01 To     10//1954:01
Usable Observations    200      Degrees of Freedom   188
Centered R**2     0.944073      R Bar **2   0.940800
Uncentered R**2   0.961567      T x R**2     192.313
Mean of Dependent Variable      145.95825000
Std Error of Dependent Variable 216.87529623
Standard Error of Estimate       52.76796595
Sum of Squared Residuals        523478.14739
Regression F(11,188)                288.4996
Significance Level of F           0.00000000
Log Likelihood                   -1070.78103

   Variable                     Coeff       Std Error      T-Stat     Signif
*******************************************************************************
1.  FIRMVALUE                0.1101238041 0.0118566942      9.28790  0.00000000
2.  CSTOCK                   0.3100653413 0.0173545028     17.86656  0.00000000


Panel Regression - Estimation by Random Effects
Dependent Variable INVEST
Panel(20) of Annual Data From      1//1935:01 To     10//1954:01
Usable Observations    200      Degrees of Freedom   197
Mean of Dependent Variable      145.95825000
Std Error of Dependent Variable 216.87529623
Standard Error of Estimate       51.57371519
Sum of Squared Residuals        523990.07541
Log Likelihood                   -1095.28595
Hausman Test(2)                     2.096758
Significance Level                0.35050549

   Variable                     Coeff       Std Error      T-Stat     Signif
*******************************************************************************
1.  Constant                 -57.85559027  29.08837067     -1.98896  0.04670568
2.  FIRMVALUE                  0.10978718   0.01046421     10.49168  0.00000000
3.  CSTOCK                     0.30816608   0.01708824     18.03381  0.00000000


Panel Regression - Estimation by First Difference
Dependent Variable INVEST
Panel(20) of Annual Data From      1//1935:01 To     10//1954:01
Usable Observations    190      Degrees of Freedom   188
Total Observations    200      Skipped/Missing       10
Centered R**2     0.408055      R Bar **2   0.404906
Uncentered R**2   0.428844      T x R**2      81.480
Mean of Dependent Variable      10.580789474
Std Error of Dependent Variable 55.606632649
Standard Error of Estimate      42.896251341
Sum of Squared Residuals        345936.61527
Log Likelihood                    -982.76206

   Variable                     Coeff       Std Error      T-Stat     Signif
*******************************************************************************
1.  FIRMVALUE                0.0890628288 0.0082341070     10.81633  0.00000000
2.  CSTOCK                   0.2786940167 0.0471564164      5.90999  0.00000002


Panel Regression - Estimation by Cross Individual SUR
Dependent Variable INVEST
Panel(20) of Annual Data From      1//1935:01 To     10//1954:01
Usable Observations    200      Degrees of Freedom   197
Log Likelihood                    -881.09752

   Variable                     Coeff       Std Error      T-Stat     Signif
*******************************************************************************
1.  Constant                 -42.71436944   0.10075031   -423.96265  0.00000000
2.  FIRMVALUE                  0.11556216   0.00006181   1869.53078  0.00000000
3.  CSTOCK                     0.23067849   0.00026985    854.84996  0.00000000


Linear Regression - Estimation by Least Squares
Dependent Variable INVEST
Panel(20) of Annual Data From      1//1935:01 To     10//1954:01
Usable Observations    200      Degrees of Freedom   188
Centered R**2     0.944073      R Bar **2   0.940800
Uncentered R**2   0.961567      T x R**2     192.313
Mean of Dependent Variable      145.95825000
Std Error of Dependent Variable 216.87529623
Standard Error of Estimate       52.76796595
Sum of Squared Residuals        523478.14739
Regression F(11,188)                288.4996
Significance Level of F           0.00000000
Log Likelihood                   -1070.78103
Durbin-Watson Statistic             1.078912

   Variable                     Coeff       Std Error      T-Stat     Signif
*******************************************************************************
1.  FIRMVALUE                   0.1101238    0.0118567      9.28790  0.00000000
2.  CSTOCK                      0.3100653    0.0173545     17.86656  0.00000000
3.  IDUMMIES(1)               -70.2967175   49.7079588     -1.41419  0.15895875
4.  IDUMMIES(2)               101.9058137   24.9383232      4.08631  0.00006485
5.  IDUMMIES(3)              -235.5718410   24.4316165     -9.64209  0.00000000
6.  IDUMMIES(4)               -27.8092946   14.0777538     -1.97541  0.04968535
7.  IDUMMIES(5)              -114.6168128   14.1654333     -8.09130  0.00000000
8.  IDUMMIES(6)               -23.1612951   12.6687393     -1.82822  0.06910077
9.  IDUMMIES(7)               -66.5534735   12.8429734     -5.18209  0.00000056
10. IDUMMIES(8)               -57.5456573   13.9931464     -4.11242  0.00005848
11. IDUMMIES(9)               -87.2222724   12.8918932     -6.76567  0.00000000
12. IDUMMIES(10)               -6.5678435   11.8268910     -0.55533  0.57932822


Linear Regression - Estimation by Least Squares
Dependent Variable IFIX
Panel(20) of Annual Data From      1//1935:01 To     10//1954:01
Usable Observations    200      Degrees of Freedom   197
Centered R**2     0.769433      R Bar **2   0.767092
Uncentered R**2   0.776925      T x R**2     155.385
Mean of Dependent Variable       19.98207713
Std Error of Dependent Variable 109.30835918
Standard Error of Estimate       52.75282202
Sum of Squared Residuals        548223.46550
Regression F(2,197)                 328.7071
Significance Level of F           0.00000000
Log Likelihood                   -1075.39980
Durbin-Watson Statistic             0.997931

   Variable                     Coeff       Std Error      T-Stat     Signif
*******************************************************************************
1.  CONSTFIX                 -57.85559027  29.23429433     -1.97903  0.04920554
2.  FFIX                       0.10978718   0.01051671     10.43931  0.00000000
3.  CFIX                       0.30816608   0.01717397     17.94379  0.00000000




已有 1 人评分学术水平 热心指数 信用等级 收起 理由
epoh + 1 + 1 + 1 佩服追根究底的精神

总评分: 学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

数学好就是要天天学

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-25 15:05