如何使用 sas 进行 Hausman 测试?

How to do Hausman test using sas?

我有面板数据,想做固定效应和随机效应的 Hausman 检验。 这是我的代码:

Proc glm DATA=Sampledata_adjvol;
 absorb TRD_STCK_CD;
 class TRD_EVENT_ROUFOR;
 model adjusted_volume_5 = TRD_EVENT_ROUFOR / solution;
run;

如果不使用 PROC PANEL 或面板程序,我该如何进行测试? 提前致谢。

proc panel data = Sampledata_adjvol3;
    id TRD_STCK_CD DateTime;
    class TRD_EVENT_ROUFOR;
    model adjusted_volume_5 = TRD_EVENT_ROUFOR / fixone;
run;

* Regression with dummy variables in approach 2;
* Creating dummy variables manually;
data Sampledata_adjvol3_1;
  set Sampledata_adjvol3;
        if TRD_EVENT_ROUNDED = 34200 then TRD_EVENT_ROUNDED_1 = 1; 
    else TRD_EVENT_ROUNDED_1 = 0;
    if TRD_EVENT_ROUNDED = 36000 then TRD_EVENT_ROUNDED_2 = 1; 
    else TRD_EVENT_ROUNDED_2 = 0;
    if TRD_EVENT_ROUNDED = 37800 then TRD_EVENT_ROUNDED_3 = 1; 
    else TRD_EVENT_ROUNDED_3 = 0;
    if TRD_EVENT_ROUNDED = 39600 then TRD_EVENT_ROUNDED_4 = 1; 
    else TRD_EVENT_ROUNDED_4 = 0;
    if TRD_EVENT_ROUNDED = 41400 then TRD_EVENT_ROUNDED_5 = 1; 
    else TRD_EVENT_ROUNDED_5 = 0;
    if TRD_EVENT_ROUNDED = 43200 then TRD_EVENT_ROUNDED_6 = 1; 
    else TRD_EVENT_ROUNDED_6 = 0;
run;

proc sort data=Sampledata_adjvol3_1 out=Sampledata_adjvol3_1;
    by TRD_STCK_CD DateTime;
run;
proc tscsreg data= Sampledata_adjvol3_1;
    model adjusted_volume_5 = TRD_EVENT_ROUNDED_1 TRD_EVENT_ROUNDED_2 TRD_EVENT_ROUNDED_3 TRD_EVENT_ROUNDED_4
TRD_EVENT_ROUNDED_5 TRD_EVENT_ROUNDED_6/ fixone;
    id TRD_STCK_CD datetime;
run;