楼主: ywh19860616
24273 168

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

51
ywh19860616 发表于 2012-1-2 12:02:41
epoh 发表于 2012-1-2 11:08
TSP最麻烦的地方在
产生错误时没说出原因
很不方便除错
epoh老师,您上面写的XS1 是表示什么?
可能我没有想到那么复杂,我的想法是现在要同时检验XS(-1)和XS(-2)前的系数是否同时为0,如c1==c2==0,如果在winrats,都有直接test函数可用,而TSP中不知道如何使用。因此,我才问
ANALYZ constr1 constr2
与分开两个命令写
ANALYZ constr1
ANALYZ constr2

有何区别?
一份耕耘,一份收获。

52
epoh 发表于 2012-1-2 14:51:32
ywh19860616 发表于 2012-1-2 12:02
epoh老师,您上面写的XS1 是表示什么?
可能我没有想到那么复杂,我的想法是现在要同时检验XS(-1)和XS(- ...
哈哈!老兄原来你才是罪魁祸首.
42楼你写错了
FRML eq. ys.=a.+b1.*ys(-1)+b2.*ys(-2)+c1.*xs.(-1)+c2.*xs(-2)
应该是  
FRML eq. ys.=a.+b1.*ys.(-1)+b2.*ys.(-2)+c1.*xs.(-1)+c2.*xs.(-2);
这才折腾了半天.呵呵
现在程序可以运行了,你试试.
请注意短信息

不过如果要做bootstrap
PROC RESIDNUL beta eps;   
还需要修改
因为原来是
FRML eq0. ys.=a0.+b01.*ys.(-1);
PARAM a0. b01.;

*******************
FRML constr1. c1.;
FRML constr2 c2.;
ANALYZ  constr1.;
ANALYZ constr2.;

FRML constr1. c1.;
FRML constr2 c2.;
ANALYZ  constr1. constr2.;
是不一样的
底下例子(MSGM_modified)可以说明:
MSGM_modified.tsp,HedPrice1.dat,Team.dat
   MSGM_modified.rar (12.44 KB)
frml c1 d1;
frml c2 d2;
frml c3 beta;

? Benchmark estimation with Wald test of separability
LSQ(MAXIT=500,TOL=0.0001) E1 E2 E3 E4;
set loglu=@logl;
analyz c1 c2 c3;

Results of Parameter Analysis
=============================

                         Standard
Parameter  Estimate        Error       t-statistic   P-value
C1         13.4943       18.7142       .721072       [.471]
C2         292.864       214.771       1.36361       [.173]
C3         18.7071       5.50715       3.39687       [.001]

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

CHISQ(3) =   19.941252     ; P-value = 0.00017

*******************

LSQ(MAXIT=500,TOL=0.0001) E1 E2 E3 E4;
set loglu=@logl;
analyz c1 ;
analyz c2 ;
analyz c3 ;

Results of Parameter Analysis
=============================


                         Standard
Parameter  Estimate        Error       t-statistic   P-value
C1         13.4940       18.7140       .721067       [.471]

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

CHISQ(1) =  0.51993751     ; P-value = 0.47087

Results of Parameter Analysi
=============================

                         Standard
Parameter  Estimate        Error       t-statistic   P-value
C2         292.867       214.769       1.36363       [.173]

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

CHISQ(1) =   1.8594975     ; P-value = 0.17268

Results of Parameter Analysis
=============================

                         Standard
Parameter  Estimate        Error       t-statistic   P-value
C3         18.7071       5.50717       3.39687       [.001]

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

CHISQ(1) =   11.538697     ; P-value = 0.00068
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
ywh19860616 + 5 + 5 + 5 哈哈,epoh老师,我错了

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

53
ywh19860616 发表于 2012-1-2 15:48:33
epoh 发表于 2012-1-2 14:51
哈哈!老兄原来你才是罪魁祸首.
42楼你写错了
FRML eq. ys.=a.+b1.*ys(-1)+b2.*ys(-2)+c1.*xs.(-1)+c2 ...
哈哈,epoh老师,是我自己写错了,罪过罪过了
如果
FRML c1;
FRML c2;
FRML c3;
然后
ANALYZ  c1 c2 c3;
这句命令是否可以认为是test c1==c2==c3==0?
一份耕耘,一份收获。

54
epoh 发表于 2012-1-2 16:16:45
ywh19860616 发表于 2012-1-2 15:48
哈哈,epoh老师,是我自己写错了,罪过罪过了
如果
FRML c1;
ANALYZ  c1 c2 c3;
这句命令是否可以认为是test c1==c2==c3==0?
对!就是.
另短信息提到的
我再帮你修改.

55
ywh19860616 发表于 2012-1-2 16:23:45
epoh 发表于 2012-1-2 16:16
ANALYZ  c1 c2 c3;
这句命令是否可以认为是test c1==c2==c3==0?
对!就是.
好的,谢谢epoh老师
您帮忙看看最后面的这句,如果lag length 改变,是否需要变化?
SET ystarm(u,v)=beta(v,1)+beta(v,2)*ystarm(u1,v)+epsstarm(u,v);
一份耕耘,一份收获。

56
epoh 发表于 2012-1-2 19:50:59
ywh19860616 发表于 2012-1-2 16:23
好的,谢谢epoh老师
您帮忙看看最后面的这句,如果lag length 改变,是否需要变化?
SET ystarm(u,v)=b ...
SET u1=u-1;
SET u2=u-2;
    DO v=1 TO ncountry;
SET ystarm(u,v)=beta(v,1)+beta(v,2)*ystarm(u1,v)+beta(v,3)*ystarm(u2,v)+epsstarm(u,v);
    ENDDO;

#####Results:
Current sample:  1962 to 1997
                  @NOB        @NCOEF             P
Value         36.00000     120.00000       5.00000
                  UAIC         USBIC           AIC          SBIC
Value        -19.62815     -14.34976      -0.10309       0.11685
                   C11           C21
Value          1.84125      -1.50339
                   C12           C22
Value         0.094831       0.26454
                   C13           C23
Value         -0.66898      -0.36604
.....
.....
                  C128          C228
Value          0.55224      0.048596
                  C129          C229
Value         -0.23415       0.83328
*************
Results of Parameter Analysis
=============================
                                     Standard
Parameter    Estimate        Error          t-statistic      P-value
CONSTR11   1.84125       .837120        2.19950      [.028]
CONSTR21   -1.50339      .798314       -1.88321      [.060]

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

CHISQ(2) =   4.9251172     ; P-value = 0.08522
.....
.....
                                       Standard
Parameter       Estimate        Error         t-statistic   P-value
CONSTR129  -.234145      .433760      -.539804      [.589]
CONSTR229  .833276       .435543       1.91319       [.056]
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
ywh19860616 + 5 + 5 + 5 epoh老师,谢谢您,我运行还是会出现错误呢

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

57
ywh19860616 发表于 2012-1-2 20:25:08
epoh 发表于 2012-1-2 19:50
SET u1=u-1;
SET u2=u-2;
    DO v=1 TO ncountry;
epoh老师,我运行您修改的程序会出现错误,为何?
错误提示:
183      ENDDO;
*** ERROR in command 183: Operator required before item ====>   ENDDO
184  ENDPROC;
*** WARNING in command 184: ENDP statement encountered but there are
    unfinished DO loop(s) ====>    1
185  ;END;
*** WARNING in command 185: END  statement encountered but there are
    unfinished DO loop(s) ====>    1

您修改程序有加上
SET u1=u-1;
SET u2=u-2;
    DO v=1 TO ncountry;
SET ystarm(u,v)=beta(v,1)+beta(v,2)*ystarm(u1,v)+beta(v,3)*ystarm(u2,v)+epsstarm(u,v);
    ENDDO;
这段再运行吗?
一份耕耘,一份收获。

58
epoh 发表于 2012-1-2 20:57:22
ywh19860616 发表于 2012-1-2 20:25
epoh老师,我运行您修改的程序会出现错误,为何?
错误提示:
183      ENDDO;
可能贴在短信息被截断了
我发在这里好了
ywhtsp_lag2.tsp (need pw)
   ywhtsp_lag2.rar (1.66 KB)

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

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

59
ywh19860616 发表于 2012-1-2 21:07:39
恩,epoh老师,我试试看
好像还是有错误,也许是我运行操作有问题
我是直接input 程序名

一份耕耘,一份收获。

60
epoh 发表于 2012-1-3 08:30:00
ywh19860616 发表于 2012-1-2 21:07
恩,epoh老师,我试试看
好像还是有错误,也许是我运行操作有问题
我是直接input 程序名
DOT(VALUE=i) 1-29;
  IF choice(i)=1; THEN;
    DO;
    .....
    .....
      IF i=1; THEN;
         LIST eq eq.;
      ELSE;
         LIST eq eq eq.;
    ENDDO;
ENDDOT;

漏掉回答这个问题
i  1 ~ 29
when i = 1 ,
执行这一句: LIST eq eq.;
        eq eq1
否则执行 LIST eq eq eq.;
i=2 , eq eq1 eq2
i=3 , eq eq1 eq2 eq3
...
i=5 , 都不执行
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
ywh19860616 + 5 + 5 + 5 epoh老师,早上好

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

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-22 06:05