全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Gauss专版
2012-1-3 08:44:10
epoh 发表于 2012-1-3 08:30
DOT(VALUE=i) 1-29;
  IF choice(i)=1; THEN;
    DO;
epoh老师,明白了,非常感谢您
哈哈,其实我一直想问,为什么程序都是要加"."号
比如
PARAM a. b1. b2. c1. c2. ;
CONVERT ys.=y.;

那个符号是代表 i 吗?
wald.rar
大小:(198.03 KB)

 马上下载

本附件包括:

  • wald.PDF




二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-3 13:55:30
ywh19860616 发表于 2012-1-3 08:44
epoh老师,明白了,非常感谢您
哈哈,其实我一直想问,为什么程序都是要加"."号
比如
你提供的程序应该是
testing causality from X to Y in (2)
而Muhsin Kar是根据Konya (2006)
请看Granger Causality Analysis on OECD Countries
     with a Panel Data Approach.pdf (Konya)
http://editorialexpress.com/cgi- ... 04&paper_id=167
page 10/25, Step 1 - Step 5
  Step 3, formula(9)
所以倒数第4句程序是对的
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-3 16:41:16
epoh 发表于 2012-1-3 13:55
你提供的程序应该是
testing causality from X to Y in (2)
而Muhsin Kar是根据Konya (2006)
谢谢epoh老师,我看了您传的那篇文章公式(9)
和这个程序还是有区别
ystarm(u,v)=beta(v,1)+beta(v,2)*ystarm(u1,v)+beta(v,3)*ystarm(u2,v)+epsstarm(u,v)
您看公式右边只有y(i,t-1)项,而只是其前面的系数随着L变化,如L=1 to mly1
所以我想程序是不是为:
ystarm(u,v)=beta(v,1)+beta(v,2)*ystarm(u1,v)+beta(v,3)*ystarm(u1,v)+epsstarm(u,v)
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-3 17:02:45
ywh19860616 发表于 2012-1-3 16:41
谢谢epoh老师,我看了您传的那篇文章公式(9)
和这个程序还是有区别
ystarm(u,v)=beta(v,1)+beta(v,2) ...
哈哈!你先想一下
假设
mly1=1
mly1=2
mly1=3
会如何?
mly1=1,b11(beta1)*y(t-1)
mly1=2,b11(beta1)*y(t-1)+b12(beta2)*y(t-2)
mly1=3,b11(beta1)*y(t-1)+b12(beta2)*y(t-2)+b13(beta3)*y(t-3)

ps:

刚注意到

你看得这篇文献印刷错误

你也可以看35楼我发的文献

Page 6/13 formula(1)


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-3 19:03:31
epoh 发表于 2012-1-3 17:02
哈哈!你先想一下
假设
mly1=1
噢噢 ,epoh老师,请原谅我还是没有看懂啊,哈哈
您提到的35楼文献formula(1)是估计是利用的model,但是不是bootstrap时使用的方程
我看过您提到的Konya(2006)正式发表的一文,您看到page 3/15 formula(1)也与其bootstrap时的方程 page 8/15 formula(9)不一致的,是不是也是印刷错误呢?

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-3 19:06:44
ywh19860616 发表于 2012-1-3 19:03
噢噢 ,epoh老师,请原谅我还是没有看懂啊,哈哈
您提到的35楼文献formula(1)是估计是利用的model, ...
哈哈!他没印错
公式(9)是小写L不是1
其实你也可以这样看
前半段是估计VAR model 系数
后半段是bootstrap wald test
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-3 19:10:53
epoh 发表于 2012-1-3 19:06
哈哈!他没印错
公式(9)是小写L不是1
其实你也可以这样看
啊,怎么和和号下面的下标L差别那么大啊,看起来是1,因为我看好几篇论文都是这样的

epoh老师,您修改的程序还是会提示如下错误,原因在哪?
190      ENDDO;
*** ERROR in command 190: Operator required before item ====>   ENDDO
191  ENDPROC;
*** WARNING in command 191: ENDP statement encountered but there are
    unfinished DO loop(s) ====>    1
192  ;END;
*** WARNING in command 192: END  statement encountered but there are
    unfinished DO loop(s) ====>    1

而且您看cdfwald值,应该不可能全为0的
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-3 19:36:58
ywh19860616 发表于 2012-1-3 19:10
啊,怎么和和号下面的下标L差别那么大啊,看起来是1,因为我看好几篇论文都是这样的

epoh老师,您修改 ...
程序跑得很顺啊
  file\open\ywhtsp_lag2.tsp
  modules\run TSP
我把 ntrial=1000的结果及cdfwald.xls
上传供你参考
ntrial1000_lag2_result(need pw)
   

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-3 19:50:09
epoh 发表于 2012-1-3 19:36
程序跑得很顺啊
  file\open\ywhtsp_lag2.tsp
  modules\run TSP
啊啊啊,我差点要崩溃了
可以了,非常感谢epoh老师
我是先 file\open\ywhtsp_lag2.tsp
然后modules\Start TSP
再打开的TSP窗口输入 input ywhtsp_lag2.tsp
然后就提示刚才的错误
而按老师您的方法,又完全可以

真是非常抱歉,揪住这样一个小问题,打扰epoh老师那么久
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-5 10:02:35
ywh19860616 发表于 2012-1-3 19:50
啊啊啊,我差点要崩溃了
可以了,非常感谢epoh老师
我是先 file\open\ywhtsp_lag2.tsp
老兄:
前半段在R package"systemfit",method: SUR
系数几乎与TSP完全相同
Wald test结果也相近
不过我用公式计算的结果
Wald test跟R相同.
底下结果先供你参考(lag1)
#####
eqwald=systemfit(eq,method="SUR")
systemfit results
method: SUR

Coefficients:
eq1_(Intercept)      eq1_yx[, 2]      eq1_yx[, 3]
      -0.3116236        0.7912344        0.3156800
eq2_(Intercept)      eq2_yx[, 5]      eq2_yx[, 6]
      -1.9283919        0.7911999        0.6604992
eq3_(Intercept)      eq3_yx[, 8]      eq3_yx[, 9]
       4.2491434        0.4663545       -1.1681224
eq4_(Intercept)     eq4_yx[, 11]     eq4_yx[, 12]
       2.3589350        0.9056093       -0.6801068
eq5_(Intercept)     eq5_yx[, 17]     eq5_yx[, 18]
      -0.3052477        0.9767467        0.1238494
eq6_(Intercept)     eq6_yx[, 20]     eq6_yx[, 21]
       2.3518272        0.7743578       -0.6510128
eq7_(Intercept)     eq7_yx[, 23]     eq7_yx[, 24]
       1.6635026        0.7141601       -0.3865834
eq8_(Intercept)     eq8_yx[, 29]     eq8_yx[, 30]
      -1.1089478        0.7368887        0.5098353
eq9_(Intercept)     eq9_yx[, 35]     eq9_yx[, 36]
      -0.9212822        0.8625009        0.3588030
eq10_(Intercept)    eq10_yx[, 38]    eq10_yx[, 39]
      -1.6699922        0.9390333        0.5252955
eq11_(Intercept)    eq11_yx[, 41]    eq11_yx[, 42]
       2.6285152        0.6096717       -0.6554067
eq12_(Intercept)    eq12_yx[, 44]    eq12_yx[, 45]
       0.6020769        0.7294215       -0.1217231
eq13_(Intercept)    eq13_yx[, 47]    eq13_yx[, 48]
       2.0472847        0.8808392       -0.5324068
eq14_(Intercept)    eq14_yx[, 50]    eq14_yx[, 51]
      -2.2657726        0.6590231        0.7412438
eq15_(Intercept)    eq15_yx[, 53]    eq15_yx[, 54]
      -4.3419847        0.8962998        1.3894646
eq16_(Intercept)    eq16_yx[, 56]    eq16_yx[, 57]
       2.0852281        0.7243596       -0.6305963
eq17_(Intercept)    eq17_yx[, 59]    eq17_yx[, 60]
       1.3373892        0.5247059       -0.4812741
eq18_(Intercept)    eq18_yx[, 62]    eq18_yx[, 63]
       2.4454699        0.5115543       -0.6443949
eq19_(Intercept)    eq19_yx[, 68]    eq19_yx[, 69]
       0.3636687        0.7631305       -0.0839331
eq20_(Intercept)    eq20_yx[, 71]    eq20_yx[, 72]
      -3.6582452        1.0674442        1.2167685
eq21_(Intercept)    eq21_yx[, 74]    eq21_yx[, 75]
       0.3640366        0.9407530       -0.1071344
eq22_(Intercept)    eq22_yx[, 77]    eq22_yx[, 78]
      -3.0892490        1.0079176        1.0312585
eq23_(Intercept)    eq23_yx[, 83]    eq23_yx[, 84]
      -0.8411777        0.8838691        0.3719530
eq24_(Intercept)    eq24_yx[, 86]    eq24_yx[, 87]
      -0.4724494        0.7554644        0.2264534
> #Wald test
> Rmat <- matrix(0, nrow = 24, ncol = 72)
> for(i in 1:24){
+ Rmat[i,(3*i)]=1
+ print(linearHypothesis( eqwald, Rmat[i,], test = "Chisq" ))
+ }
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eqyx[, 3] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)
1    817                     
2    816  1 0.3689     0.5436
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq2_yx[, 6] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)  
1    817                       
2    816  1 3.4862    0.06188 .
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq3_yx[, 9] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)   
1    817                        
2    816  1 7.4933   0.006193 **
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq4_yx[, 12] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)
1    817                     
2    816  1 1.4515     0.2283
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq5_yx[, 18] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)
1    817                     
2    816  1 0.2375      0.626
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq6_yx[, 20

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)
1    817                     
2    816  1 0.8304     0.3621
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq7_yx[, 24] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)
1    817                     
2    816  1 0.5466     0.4597
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq8_yx[, 30] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)
1    817                     
2    816  1 0.2118     0.6454
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq9_yx[, 36] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)
1    817                     
2    816  1 2.2131     0.1368
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq10_yx[, 39] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)   
1    817                        
2    816  1 9.2704   0.002329 **
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq1yx[, 42] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)
1    817                     
2    816  1 1.6489     0.1991
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq12_yx[, 45] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)
1    817                     
2    816  1 0.0428     0.8362
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq13_yx[, 48] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)  
1    817                       
2    816  1 4.8809    0.02716 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq14_yx[, 50

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)
1    817                     
2    816  1 0.8869     0.3463
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq15_yx[, 54] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)  
1    817                       
2    816  1 3.7559    0.05262 .
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq16_yx[, 57] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)
1    817                     
2    816  1 2.6813     0.1015
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq17_yx[, 60] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)  
1    817                       
2    816  1 5.1157    0.02371 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq18_yx[, 63] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)   
1    817                        
2    816  1 15.399  8.705e-05 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq19_yx[, 69] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)
1    817                     
2    816  1 0.1866     0.6657
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq20_yx[, 72] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)
1    817                     
2    816  1 1.6842     0.1944
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq2yx[, 75] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)
1    817                     
2    816  1 0.1678     0.6821
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq22_yx[, 78] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df Chisq Pr(>Chisq)   
1    817                       
2    816  1 7.738   0.005407 **
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq23_yx[, 84] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)
1    817                     
2    816  1 0.1639     0.6856
Linear hypothesis test (Chi^2 statistic of a Wald test)

Hypothesis:
eq24_yx[, 87] = 0

Model 1: restricted model
Model 2: eqwald

  Res.Df Df  Chisq Pr(>Chisq)
1    817                     
2    816  1 0.3989     0.5277

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-5 19:09:05
epoh 发表于 2012-1-5 10:02
老兄:
前半段在R package"systemfit",method: SUR
系数几乎与TSP完全相同
谢谢epoh老师帮忙,一直帮忙关注着
好的,我仔细先看下,不懂再请教您
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-5 19:43:01
epoh 发表于 2012-1-3 13:55
你提供的程序应该是
testing causality from X to Y in (2)
而Muhsin Kar是根据Konya (2006)
epoh老师, 我曾问过您如何在模型中加入时间趋势项t
您在43楼给出了
FREQ A;
SMPL fyear lyear;
TREND t;
上述步骤生成时间虚拟变量,如果我要加入到模型中,比如
ys.=a.+b1.*ys.(-1)+c1.*xs.(-1) 想加上时间虚拟变量,是不是写为:
ys.=a.+b1.*ys.(-1)+c1.*xs.(-1)+d1.*t ?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-5 20:34:17
ywh19860616 发表于 2012-1-5 19:43
epoh老师, 我曾问过您如何在模型中加入时间趋势项t
您在43楼给出了
FREQ A;
对,是这样修改
这个结果跟在R一样

systemfit results
method: SUR

Coefficients:
eq1_(Intercept)      eq1_yx[, 2]      eq1_yx[, 3]            eq1_t
    -1.880830254      0.829877954      1.008130163     -0.028001048
eq2_(Intercept)      eq2_yx[, 5]      eq2_yx[, 6]            eq2_t
    -1.920151777      0.796588404      0.668688097     -0.002093038
eq3_(Intercept)      eq3_yx[, 8]      eq3_yx[, 9]            eq3_t
     3.973957711      0.466633952     -1.101841973      0.003169787
eq4_(Intercept)     eq4_yx[, 11]     eq4_yx[, 12]            eq4_t
     1.898459626      0.832565522     -0.441466427     -0.012753589
eq5_(Intercept)     eq5_yx[, 17]     eq5_yx[, 18]            eq5_t
     0.275970284      0.664242717     -0.173126911      0.024406248
eq6_(Intercept)     eq6_yx[, 20]     eq6_yx[, 21]            eq6_t
     3.103964703      0.758784532     -1.026842587      0.024873605
eq7_(Intercept)     eq7_yx[, 23]     eq7_yx[, 24]            eq7_t
     4.072692530      0.712823231     -1.031947275     -0.017750092
eq8_(Intercept)     eq8_yx[, 29]     eq8_yx[, 30]            eq8_t
    -0.781034199      0.636660602      0.581885954     -0.019597135
eq9_(Intercept)     eq9_yx[, 35]     eq9_yx[, 36]            eq9_t
    -1.363171303      0.873149323      0.482868322      0.001526354
eq10_(Intercept)    eq10_yx[, 38]    eq10_yx[, 39]           eq10_t
     0.358764927      0.689562621      0.115481714     -0.019773675
eq11_(Intercept)    eq11_yx[, 41]    eq11_yx[, 42]           eq11_t
     2.834613702      0.630491222     -0.689400608     -0.006169193
eq12_(Intercept)    eq12_yx[, 44]    eq12_yx[, 45]           eq12_t
     0.306087648      0.644760542      0.053645813     -0.009752240
eq13_(Intercept)    eq13_yx[, 47]    eq13_yx[, 48]           eq13_t
     3.425176253      0.500437287     -0.803191847      0.031743285
eq14_(Intercept)    eq14_yx[, 50]    eq14_yx[, 51]           eq14_t
    -3.812201513      0.710893800      1.144207522      0.009384382
eq15_(Intercept)    eq15_yx[, 53]    eq15_yx[, 54]           eq15_t
    -3.594382961      0.859010597      1.151689113      0.005609711
eq16_(Intercept)    eq16_yx[, 56]    eq16_yx[, 57]           eq16_t
     3.624525550      0.685826183     -1.008111232     -0.016945119
eq17_(Intercept)    eq17_yx[, 59]    eq17_yx[, 60]           eq17_t
     1.270033804      0.519252777     -0.451830521     -0.000860993
eq18_(Intercept)    eq18_yx[, 62]    eq18_yx[, 63]           eq18_t
     2.002317611      0.344972093     -0.295062853     -0.022814302
eq19_(Intercept)    eq19_yx[, 68]    eq19_yx[, 69]           eq19_t
    -0.327622664      0.762469180      0.161364205     -0.004934733
eq20_(Intercept)    eq20_yx[, 71]    eq20_yx[, 72]           eq20_t
    -7.854875474      1.442323406      2.566815114      0.022365190
eq21_(Intercept)    eq21_yx[, 74]    eq21_yx[, 75]           eq21_t
     0.616458357      0.981416041     -0.220253062      0.001525778
eq22_(Intercept)    eq22_yx[, 77]    eq22_yx[, 78]           eq22_t
    -2.747200926      1.010365270      0.944929392     -0.004568194
eq23_(Intercept)    eq23_yx[, 83]    eq23_yx[, 84]           eq23_t
     0.861219305      0.845931826     -0.023070598     -0.021581375
eq24_(Intercept)    eq24_yx[, 86]    eq24_yx[, 87]           eq24_t
     1.196128844      0.652512965     -0.186136803     -0.011909153
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-5 20:46:04
epoh 发表于 2012-1-5 20:34
对,是这样修改
这个结果跟在R一样
谢谢epoh老师
您看以下错误是如何
我前面已经定义了
TREND t;
FRML eq. ys.=a.+b1.*ys.(-1)+c1.*xs.(-1)+d1.*zs.(-1)+e1.*ws.(-1)+f1.*t.
这个方程运行提示错误,最后一项t应该如何写呢


老师,R实现好像更为简单些,只是bootstrap这步也得自己编写程序

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-5 20:59:48
ywh19860616 发表于 2012-1-5 20:46
谢谢epoh老师
您看以下错误是如何
我前面已经定义了
R实现的确更为简单明了,
bootstrap是要自己编程
顺利除错的话
这一两天就会完成.
FRML eq. ys.=a.+b1.*ys.(-1)+c1.*xs.(-1)+d1.*zs.(-1)+e1.*ws.(-1)+f1.*t.
这个错误,还有劳你把原因贴出来
未必是最后一项t所引起
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-5 21:12:53
epoh 发表于 2012-1-5 20:59
R实现的确更为简单明了,
bootstrap是要自己编程
顺利除错的话
epoh老师,您看错误提示,应该是我把t这一项书写错误
命令: FRML eq. ys.=a.+b1.*ys.(-1)+b2.*ys.(-2)+c1.*xs.(-1)+c2.*xs.(-2)+d1.*t.;
提示:
C:\Program Files\TSP 5.0\ywhtsp_lag2.tsp (95):  ERROR
*** ERROR in command 74 Procedure SUR: Illegal variable type or variable
    missing ====>  T1
C:\Program Files\TSP 5.0\ywhtsp_lag2.tsp (95):  ERROR
*** ERROR in command 74 Procedure SUR: Illegal variable type or variable
    missing ====>  T2

同样还有T3,....,T21,..
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-5 22:04:57
ywh19860616 发表于 2012-1-5 21:12
epoh老师,您看错误提示,应该是我把t这一项书写错误
命令: FRML eq. ys.=a.+b1.*ys.(-1)+b2.*ys.(-2 ...
同样修改
在我这儿跑得很顺
请注意短信息
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-5 22:16:19
epoh 发表于 2012-1-5 22:04
同样修改
在我这儿跑得很顺
请注意短信息
呵呵,epoh老师,我在t后面多写了一个点
因为我看到xs,ys后面都打了一个点
ok了,程序跑的很顺
非常感谢
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-6 14:29:25
ywh19860616 发表于 2012-1-5 22:16
呵呵,epoh老师,我在t后面多写了一个点
因为我看到xs,ys后面都打了一个点
ok了,程序跑的很顺
还是在TSP做好了
在R速度慢很多
bootstrap ntrial 1000
又loop 24 equations 算wald stat
就花了一个钟头
这是lag1,lag2会更久
lag1的waldstatm.csv(1000 x 29)
R_wald_1000.csv
  
R_wald_1000.rar
大小:(201.68 KB)

 马上下载

本附件包括:

  • R_wald_1000.csv


供你参考就行了.
若你要比较可以
sortwald=apply(waldstatm,2,sort)
sortwald[900,]
sortwald[950,]
sortwald[990,]
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-6 16:42:48
epoh 发表于 2012-1-6 14:29
还是在TSP做好了
在R速度慢很多
bootstrap ntrial 1000
好的,非常感谢epoh老师,花费您很多时间
哈哈,收藏慢慢研究

epoh老师,不知道您对cross-sectional dependence test了解多少。我对61楼我上传的文章
附录B的几个检验方法不是很明白。
我看了R里面的cross-sectional dependence test的检验方法(附件中),命令都是针对没有滞后项的回归得到的error terms进行cross-sectional dependence test的,而61楼附件中的文章,公式是包含滞后项的,可以直接用BP或者CD方法进行检验?
Panel101R[1].pdf
大小:(430.04 KB)

 马上下载




二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-6 16:43:25
epoh 发表于 2012-1-6 14:29
还是在TSP做好了
在R速度慢很多
bootstrap ntrial 1000
epch老师您好,不知道是否知道哪里可以下载面板分位数的gauss估计程序,谢谢
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-6 19:33:20
iloveyou21 发表于 2012-1-6 16:43
epch老师您好,不知道是否知道哪里可以下载面板分位数的gauss估计程序,谢谢
抱歉!我没见过panel quantile regression gauss code
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-6 19:34:15
ywh19860616 发表于 2012-1-6 16:42
好的,非常感谢epoh老师,花费您很多时间
哈哈,收藏慢慢研究
这个只要把数据先行处理就可以了
就类似systemfit 我也是先行处理成
y,y(-1),x(-1)然后建立equations
再使用function systemfit()
详见短信息
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-6 21:13:03
epoh 发表于 2012-1-6 19:34
这个只要把数据先行处理就可以了
就类似systemfit 我也是先行处理成
y,y(-1),x(-1)然后建立equations
恩,谢谢epoh老师,我先学习下
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-7 12:01:06
epoh 发表于 2012-1-6 19:34
这个只要把数据先行处理就可以了
就类似systemfit 我也是先行处理成
y,y(-1),x(-1)然后建立equations
epoh老师,我还有一个疑问,还是加入时间趋势变量t问题
上次您修改的程序只在
FRML eq. ys.=a.+b1.*ys.(-1)+b2.*ys.(-2)+c1.*xs.(-1)+c2.*xs.(-2)+d1.*t;
加入了t
而在后面两个算式:
FRML eq0. ys.=a0.+b01.*ys.(-1)+b02.*ys.(-2);
SET ystarm(u,v)=beta(v,1)+beta(v,2)*ystarm(u1,v)+beta(v,3)*ystarm(u2,v)+epsstarm(u,v)
未加入t
我感觉也是应该加入t项,您觉得?
我尝试过,会提示错误
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-7 14:12:51
ywh19860616 发表于 2012-1-7 12:01
epoh老师,我还有一个疑问,还是加入时间趋势变量t问题
上次您修改的程序只在
FRML eq. ys.=a.+b1.*y ...
假若bootstrap也要加入time trend的话
那就要自己建立一个time trend变量
才会准确.
因为bootstrap产生的epsstarm ystarm
都是 68 x 29 matrix,
要估计系数时,才取后面的 38 x 29 matrix
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-7 18:29:47
epoh 发表于 2012-1-7 14:12
假若bootstrap也要加入time trend的话
那就要自己建立一个time trend变量
才会准确.
epoh老师,第一次产生的C1,C2,...好像不是Konya(206)文章中的Test.Stat哦
C1,C2,...是指变量系数,就如
                         Standard
Parameter  Estimate        Error       t-statistic   P-value
CONSTR11   .767382       .220791       3.47560       [.001]


Wald Test for the Hypothesis that the given set of Parameters are jointly zero:

CHISQ(1) =   12.079798     ; P-value = 0.00051
这里的CHISQ(1) =   12.079798 感觉又不对,所以不懂Test.Stat是指什么?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-7 18:45:50
ywh19860616 发表于 2012-1-7 18:29
epoh老师,第一次产生的C1,C2,...好像不是Konya(206)文章中的Test.Stat哦
C1,C2,...是指变量系数,就 ...
对对,我笔误了
我意思是对C1,C2的wald test
也就是CHISQ(1) =   12.079798     
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-7 19:09:18
epoh 发表于 2012-1-7 18:45
对对,我笔误了
我意思是对C1,C2的wald test
也就是CHISQ(1) =   12.079798
恩,epoh老师,这正是我想问的问题,也是下午短信息里面问您的问题

比如您看这个结果:
Wald Test for the Hypothesis that the given set of Parameters are jointly zero:

CHISQ(2) =   5.0820414     ; P-value = 0.07879
从P-value = 0.07879显示是在90%下显著(因为0.07879>0.05且<0.01)

然而,从后面的CDFWALD 1-100个数值来看,第一个地区对应的第90个是
90      31.60622      (这个完整结果在短信息里面有)
                   CDFWALD

                     1             2             3             4             5
       1      0.030955       0.15930       0.27762      0.086290       0.00000
       2       0.19009       0.25981       0.50553       0.14964       0.00000

       .....
      90      31.60622      25.98711      34.55176      23.53901       0.00000
      91      32.42308      28.22461      34.74655      24.71901       0.00000
      92      38.00229      28.33852      36.65796      24.86017       0.00000
      93      43.94983      28.64702      40.39545      28.35431       0.00000
      94      45.84359      31.45108      40.64175      35.84975       0.00000
      95      54.10173      31.94527      42.41991      41.25981       0.00000
      96      58.13348      39.17221      42.46491      45.36430       0.00000
      97      82.72300      45.31820      44.06596      47.04643       0.00000
      98      85.09639      47.92266      44.79910      47.17659       0.00000
      99      97.18227      49.85334      51.20124      53.58117       0.00000
     100     137.84399      78.81898      52.12718      68.00179       0.00000


可以看出CHISQ(2) =   5.0820414     并未大于31.60622
那应该是不能拒绝原假设,这和P-value = 0.07879 在10%水平下拒绝原假设矛盾了

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-1-7 20:55:41
ywh19860616 发表于 2012-1-7 19:09
恩,epoh老师,这正是我想问的问题,也是下午短信息里面问您的问题

比如您看这个结果:
哈哈!这时候已经不看 P value
而是依据bootstrap critical values
这也是为甚么要做bootstrap 的原因.

chi-square critical values for one degree of freedom:
6.6349 (1%) 3.8415 (5%) 2.7055 (10%).

就如page 12/25 Table 1: LNEXP does not cause LNGDP
Australia而言
Test.Stat=14.0354
P=1-pchisq(Test.Stat,1)  = 0.0001794012
依旧无法拒绝null hypothesis
同理France, Greece, Japan, Korea, Luxembourg, Mexico,
        Norway, Portugal, Switzerland,the UK and the USA,

                             Bootstrap Critical Values
Country Test. Stat. 1%        5%        10%
Australia 14.0354 46.3559 23.9342 16.5506
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群