楼主: burnpark
2335 0

Fama-MacBeth t值的置信区间 [推广有奖]

  • 1关注
  • 2粉丝

已卖:1份资源

讲师

21%

还不是VIP/贵宾

-

威望
0
论坛币
2979 个
通用积分
6.6000
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
4270 点
帖子
128
精华
0
在线时间
591 小时
注册时间
2009-3-17
最后登录
2024-10-13

楼主
burnpark 发表于 2014-6-30 15:29:44 |AI写论文
500论坛币
  1. %macro regby(dset=,byvar=,yvar=,xvars=,minobs=0,print_est=yes,print_r2=yes,indformat=);

  2. %if &indformat ne
  3.    %then %let prntfmt = format &indformat indfmt.;
  4.    %else %let prntfmt = ;
  5.    
  6. proc sort data=&dset out=xdset;
  7.     by &byvar;
  8.     run;

  9. ods listing close;
  10. ods output ParameterEstimates = xpe(drop=DF Dependent Model);
  11. ods output FitStatistics = xr2;
  12. ods output ANOVA = xanova;
  13. proc reg data=xdset;
  14.     by &byvar;
  15.     model &yvar = &xvars;
  16.     run;
  17. ods output close;
  18. ods listing;

  19. data xpeprint;
  20.     set xpe;
  21.     where substr(Variable,1,3) not in ('Int', 'dy_', 'di_');
  22.     run;

  23. proc sort data=xpeprint;
  24.     by Variable &byvar;
  25.     run;
  26.    
  27. %if &print_est = 'yes' %then %do;
  28.     proc print data=xpeprint;
  29.         &prntfmt;
  30.         run;
  31. %end;

  32. data xanova;
  33.     set xanova;
  34.     where Source = 'Corrected Total';
  35.     nobs = DF + 1;
  36.     keep &byvar nobs;
  37.     run;

  38. data xpe (drop = &byvar nobs);
  39.     merge xanova xpe (drop = Probt StdErr);
  40.     by &byvar;
  41.     if nobs ge &minobs;
  42.     z1temp = tValue / sqrt((nobs-1)/(nobs-3));
  43.     run;

  44. proc sort data=xpe;
  45.     by Variable;
  46.     run;

  47. proc means data=xpe(keep = Variable z1temp) noprint;
  48.     by Variable;
  49.     output out=xmeans1(drop=_:) sum=;
  50.     run;

  51. proc means data=xpe noprint;
  52.     by Variable;
  53.     var Estimate tValue;
  54.     output out=xmeans2(drop=_type_ rename=(_freq_=n))
  55.            mean   =meanEst   meant
  56.            median =medianEst mediant
  57.            stddev =stdEst    stdt;
  58.     run;

  59. data xpe;
  60.     set xpe (rename = (Estimate = estPos tValue = tSigPos));
  61.     tSigNeg = tSigPos;
  62.     if estPos  <  0.00 then estPos  = .;
  63.     if tSigPos <  1.65 then tSigPos = .;
  64.     if tSigNeg > -1.65 then tSigNeg = .;
  65.     drop z1temp;
  66.     run;

  67. proc means data=xpe noprint;
  68.     by Variable;
  69.     output out=xmeans3 n=;
  70.     run;

  71. data xr2;
  72.     set xr2(rename=(nValue2=adjr2));
  73.     where Label2 = 'Adj R-Sq';
  74.     keep &byvar adjr2;
  75.     run;

  76. data xother;
  77.     merge xanova xr2;
  78.     by &byvar;
  79.     run;

  80. %if &print_r2 = 'yes' %then %do;
  81.     proc print data=xother;
  82.         &prntfmt;
  83.         run;
  84. %end;

  85. proc means data=xother noprint;
  86.     var nobs adjr2;
  87.     output out=xmeans4(drop=_:) mean=;
  88.     run;

  89. proc transpose data=xmeans4 out=xmeans4(rename=(_name_=Variable COL1=meanEst));
  90.     run;

  91. data xout;
  92.     merge xmeans1 xmeans2 xmeans3;
  93.     by Variable;
  94.     run;

  95. data xout;
  96.     set xout xmeans4;
  97.     fmt = meanEst * sqrt(n-1) / stdEst;
  98.     z1 = z1temp / sqrt(n);
  99.     z2 = meant * sqrt(n-1) / stdt;
  100.     estNeg = n - estPos;
  101.     run;

  102. proc print data=xout noobs round;
  103.     var Variable n meanEst medianEst estPos estNeg meant mediant tSigPos tSigNeg fmt z1 z2;
  104.     run;

  105. %mend;
复制代码


我在网上找了一个Fama-MacBeth回归的程序,请问Fama-MacBeth t值(fmt)的置信区间要怎么求?

关键词:macbeth 置信区间 Beth FAMA Bet 置信区间 close

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-31 17:38