BookmarkSubscribeRSS Feed
shalmali
Calcite | Level 5

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

3 REPLIES 3
Patrick
Opal | Level 21

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.

shalmali
Calcite | Level 5

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.

MohammadFayaz
Calcite | Level 5

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:

http://www2.sas.com/proceedings/sugi26/p247-26.pdf

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1408 views
  • 0 likes
  • 3 in conversation