Forecasting using SAS Forecast Server, SAS/ETS, and more

m value for Hausman test not being reported in my proc panel results

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

m value for Hausman test not being reported in my proc panel results

I'm using proc panel to do a one-way random effects model, and the hausman test is not being reported in my results.  SAS is listing the number of coefficients and the degrees of freedom in the Hausman test section of the results, but a "." is showing up for the m statistic.  What does this mean, and what should I do?  There is no error message in my log.  I have included a picture of the results below.  I'm using SAS 9.4. 

 

screen shot_hausman.jpg

 

 

 

 

 

 


Accepted Solutions
Highlighted
Solution
‎02-16-2018 12:23 PM
SAS Employee
Posts: 36

Re: m value for Hausman test not being reported in my proc panel results

After running a test using a character variable that represented the levels of my cross-section variable, rather than an integer variable, I found that PROC PANEL returned the same results as when my cross-section variable was coded as an integer.  Therefore, if you need to run a one-way random effects model on time (rather than cross-section), then your original approach is fine.  You would just need to omit the HCCME= option if you want to see the Hausman m-statistic.

 

I hope this helps, and welcome back to SAS! Smiley Happy   

View solution in original post


All Replies
PROC Star
Posts: 1,283

Re: m value for Hausman test not being reported in my proc panel results

What does your code look like?

Occasional Contributor
Posts: 9

Re: m value for Hausman test not being reported in my proc panel results

Here is the code. ln_Rawshare is the dependent variable.  EFWS and ln_h are the regressors.  

 

proc sort data=Pooled_Panel;
by Year Country;
run;

 

proc panel data=Pooled_Panel;
model ln_Rawshare = EFWS ln_h /ranone hccme=1;
id Year Country;
run;

SAS Employee
Posts: 36

Re: m value for Hausman test not being reported in my proc panel results

Thanks for providing the code you are running. 

 

When the HCCME= option is specified, the Hausman test is no longer valid, therefore, the m-statistic is set to missing.  To fit your one-way random effects model and obtain the Hausman test, I would recommend you make the following changes to your code:

 

1)  in the PROC SORT step, change the BY statement to:  BY COUNTRY YEAR;

2)  in the PROC PANEL step,

  • omit the HCCME= option from the MODEL statement, and
  • change the ID statement to:  ID COUNTRY YEAR;

 

I hope this helps!

DW

Occasional Contributor
Posts: 9

Re: m value for Hausman test not being reported in my proc panel results

OK. Thank you! Removing the HCCME option seems to do the trick, and now I am getting the m-statistic. 

 

I was running a one-way random effects model with respect to time, and that is why I had sorted by Year and then Country. In general, the sorting shouldn't matter, correct?  Or is the Hausman test reported by SAS only valid for Country(cross-section) effects?

SAS Employee
Posts: 36

Re: m value for Hausman test not being reported in my proc panel results

I'm glad that removing the HCCME= option allowed you to obtain the Hausman m-statistic.

 

Regarding your question on fitting a one-way random effects model on time and computing Hausman's test, R&D indicated that your original specification (without the HCCME= option):

 

proc sort data=Pooled_Panel;
by Year Country;
run;

 

proc panel data=Pooled_Panel;
model ln_Rawshare = EFWS ln_h /ranone;
id Year Country;
run;

 

is an acceptable approach, as long as your COUNTRY variable is coded in such a way that it can be inferred as a time variable.  In other words, if the levels of COUNTRY are defined as integer values, then it should be fine. 

 

The Electricity data set in the Getting Started section of the PROC PANEL documentation is an example of a data set where this approach would be acceptable, since the cross-section variable, FIRM, takes on the values 1 thru 6.  The Electricity data set can be found in the following link:

 

http://go.documentation.sas.com/?docsetId=etsug&docsetVersion=14.3&docsetTarget=etsug_panel_gettings... 

 

I hope this helps!

DW

Occasional Contributor
Posts: 9

Re: m value for Hausman test not being reported in my proc panel results

OK. Thank you again for the reply.

 

I have another question now.

 

My country variable is currently not defined as an integer.  Does this mean my code (posted below):

 

proc sort data=Pooled_Panel;
by Year Country;
run;

 

proc panel data=Pooled_Panel;
model ln_Rawshare = EFWS ln_h /ranone;
id Year Country;
run;

 

is not telling SAS to run a one-way random effects model on time?  Or am I correctly coding for such a model, and you are just saying that because Country is not an integer, the hausman m-statistic is going to be inaccurate?

 

If the code above (with Country NOT an integer) is wrong, I'm not sure what to do.  If I do the following:

 

proc sort data=Pooled_Panel;
by Country Year;
run;

 

proc panel data=Pooled_Panel;
model ln_Rawshare = EFWS ln_h /ranone;
id Country Year;
run;

 

(sort by Country and then Year) then I am going to be estimating a one-way random effects model on Country, correct?  As far as I know, if I sort by Country and then Year, there is no "ranonetime" option or something similar that is analogous to the "fixonetime" option when doing fixed effects.

 

Are you saying that the Country variable(or whatever cross-section variable is being used) always needs to be an integer anytime a random effects model with respect to Year(or whatever time-series variable is being used) is run? Is this also true for a fixed effects model on time?

 

Another way, and perhaps a better way, to ask my question is this.  When it comes to fixed and random effects models (fixed time effects, fixed country effects, random time effects, and random country effects), when is it okay to have the Country variable coded as the country name, and when must it be coded as an integer?

 

I'm sorry to keep pestering you, but I greatly appreciate the help!  I'm switching back to SAS from MATLAB, and I want to make sure my code is giving me what I want it to.

Highlighted
Solution
‎02-16-2018 12:23 PM
SAS Employee
Posts: 36

Re: m value for Hausman test not being reported in my proc panel results

After running a test using a character variable that represented the levels of my cross-section variable, rather than an integer variable, I found that PROC PANEL returned the same results as when my cross-section variable was coded as an integer.  Therefore, if you need to run a one-way random effects model on time (rather than cross-section), then your original approach is fine.  You would just need to omit the HCCME= option if you want to see the Hausman m-statistic.

 

I hope this helps, and welcome back to SAS! Smiley Happy   

Occasional Contributor
Posts: 9

Re: m value for Hausman test not being reported in my proc panel results

OK. Thanks!

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 8 replies
  • 473 views
  • 1 like
  • 3 in conversation