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
- /
- Proc Countreg Negbin Model with Fixed Effects for ...

Topic Options

- Subscribe to 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
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-02-2016 05:26 PM

Hello,

I want to estimate a Negative Binomial model with panel data (balanced panel) with fixed effects. My N is large (~ 12,000) and the dataset is large (~600,000). Introducing fixed effects as dummy variables in Proc Genmod tells me I don't have enough memory. So I tried Proc Countreg with the following specification. As best as I can tell, the specification of groupid and errorcomp is what tells Proc Countreg to do a fixed effects model.

proc countreg data = one

groupid = year_market;

class nu_week ;

model y = x

nu_week

/ dist = negbin errorcomp = fixed;

output out = predicted_free mean = free_pred;

store out = results;

run;

From the results, as best as I can tell, year_market is not being used as a fixed effect. There are two reasons I say this. One, year_market does not appear anywhere in the output (I am not expecting to get estimates of the fixed effects, but at least something that says fixed effects are being used.) Second, I have a good idea of what to expect in terms of the coefficients of x when I include fixed effects, and the results suggest there are no fixed effects.

I would appreciate any suggestions on what I might be doing wrong here.

thanks

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

01-04-2016 11:03 AM

I can't guarantee this, but I think you have to specify year_market in the MODEL statement and the CLASS statement, as well as in the GROUPID= option. .

Given the size of your data, you may want to consider HPCOUNTREG as an alternative.

Steve Denham

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

01-05-2016 09:15 AM

Thank you, Steve.

The suggestions here (bottom of the page)

http://blogs.sas.com/content/sgf/2014/09/19/econometric-modeling-your-questions-answered/

indicate that the GROUPID variable does not need to be in the MODEL statement.

It is surprising to me that SAS documentation of PROC COUNTREG does not have any examples of the use of the ERRORCOMP or GROUPID options!

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

01-05-2016 09:21 AM

I agree about the lack of an example being really frustrating--they are always my first choice of ways to approach a new analysis, and the basis of most of my posts here.

Maybe Ken can comment on what we need to be thinking, so pinging @ets_kps

Steve Denham

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

06-22-2017 06:06 AM

Hello Steve,

I have used countreg statement for my negbin random and fixed effect modeling. I had some error and warning saying "Warning: Optimization cannot improve the function value". Can I use hpcountreg, would that help to find an output without error?

My hpcountreg coding is not running. I have used

proc hpcountreg data=Panel groupid=id;

performance nthreads=2 nodes=1 details;

model PDO = ADT_Maj ADT_Min L_Maj L_Min LL_Maj LL_Min RL_Maj RL_Min Med_Maj Med_Min park skew Rain Snow ydr dui/dist=negbin errorcomp=fixed;

run;

Would you please check, what is wrong with my coding?