楼主: ywh19860616
23994 168

[问答] 程序运行问题 [推广有奖]

61
ywh19860616 发表于 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



已有 1 人评分学术水平 热心指数 信用等级 收起 理由
epoh + 1 + 1 + 1 恭喜!通了!

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

一份耕耘,一份收获。

62
epoh 发表于 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句程序是对的
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
ywh19860616 + 5 + 5 + 5 谢谢epoh老师

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

63
ywh19860616 发表于 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)
一份耕耘,一份收获。

64
epoh 发表于 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)


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

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

65
ywh19860616 发表于 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)不一致的,是不是也是印刷错误呢?

一份耕耘,一份收获。

66
epoh 发表于 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
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
ywh19860616 + 1 + 1 + 1 呵呵,非常感谢epoh老师帮忙解决了主要问题.

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

67
ywh19860616 发表于 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的
一份耕耘,一份收获。

68
epoh 发表于 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)
    ntrial1000_lag2_result.rar (43.51 KB)

已有 2 人评分学术水平 热心指数 信用等级 收起 理由
zhangtao + 5 + 5 + 5 精彩帖子
ywh19860616 + 5 + 5 + 5 epoh老师,太神奇了

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

69
ywh19860616 发表于 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老师那么久
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
epoh + 1 + 1 + 1 恭喜!通了!

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

一份耕耘,一份收获。

70
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

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

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

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

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