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
- /
- SAS Programming
- /
- SAS Procedures
- /
- Count regression code

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

11-30-2013 03:49 PM

Hi All,

I want to run a regression where the dependent variable, Numcomment, is a count of number of comments a firm would receive. In the regression, I also need to control for industry fixed effects. Can someone provide me with the SAS code for count regression that controls for industry fixed effects?

Thank you,

S

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

Posted in reply to shalmali

11-30-2013 07:31 PM

How do you expect anyone posting actual code without you providing sample data (a data step creating such data) and a description of how the result should look like.

Also: What are your thoughts about how this could be done? Have you already developed some code? If yes: Post it as well.

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

Posted in reply to Patrick

11-30-2013 10:00 PM

Sorry for the incomplete information. The subset of data looks as follows:

Gvkey Year Numcomment X1 X2 industry

001 2001 5 0.5 1 13

001 2002 9 0.8 1 13

002 2001 2 0.5 0 56

002 2002 4 0.8 1 56

003 2001 7 0.5 1 46

003 2002 5 0.8 0 46

004 2001 4 0.5 0 13

004 2002 4 0.8 0 13

Gvkey is the firm identtifier, Numcomment is the dependent variable and is the number of comments (count variable), X1 and X2 are some independent variables, and industry is the control for industry.

The two codes I got from my searches is as follows:

proc genmod data = have ;

class gvkey industry;

model numcomment =x1 x2 industry/link=log dist=poisson;

run; quit;

proc countreg data=have;

model numcomment =x1 x2 industry / dist=poisson printall;

run;quit;

Can someone please tell me which of the above codes will be more appropriate when the dependent variable is a count? Also I need to control for industry fixed effect.

Thank you.

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

Posted in reply to shalmali

12-01-2013 04:57 AM

Hi,

I think there is no difference in the estimations parts of two PROC. but some additional features are different.

There are some major topics you should consider to check the appropriateness of your fitted model. One of them is zero inflated:

http://www2.sas.com/proceedings/forum2008/322-2008.pdf

There are also AIC,BIC and overdispersion problems:

http://www2.sas.com/proceedings/forum2008/372-2008.pdf

I think you should take consideration on your modeling strategy instead of choosing the more appropriate SAS procedure.

In the following paper, you can find approximately all you need for answering your question: