turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Forecasting
- /
- Re: m value for Hausman test not being reported in...

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-06-2018 12:48 PM

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.

Accepted Solutions

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

Options

Solution

02-16-2018
12:23 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to bssturgi

02-16-2018 12:18 PM

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!

All Replies

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to bssturgi

02-10-2018 02:59 PM

What does your code look like?

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to draycut

02-10-2018 08:34 PM

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;

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to bssturgi

02-15-2018 11:07 AM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to DW_SAS

02-15-2018 01:37 PM

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?

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to bssturgi

02-15-2018 05:57 PM

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:

I hope this helps!

DW

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to DW_SAS

02-15-2018 07:17 PM

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
## Re: m value for Hausman test not being reported in my proc panel results

Options

Solution

02-16-2018
12:23 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to bssturgi

02-16-2018 12:18 PM

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!

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to DW_SAS

02-16-2018 12:23 PM

OK. Thanks!