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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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