BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
dapenDaniel
Obsidian | Level 7

I am going to use Negative Binomial Regression to run some data.My dependent variable is count variable and independent variables are also count variable. Two moderators are continuous variables. 

 

I searched the following code. My question are:

 

1) if my independent variables are not categorical variable (device is a categorical variable in that example), what command do I need to use? Still use "class" (underlined) before the independent variables?

 

2) I will have two moderators, how can I add them in the code? Thanks in advance!

 

proc genmod data=have;
class device;
model count=device/ offset=logt dist=NB
link=log;
run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

If you don't want to treat your Device predictor as categorical (represented by a set of design variables, resulting in an effect with multiple degrees of freedom), then you can drop the CLASS statement. If it is only in the MODEL statement, then it will by treated as continuous (with 1 degree of freedom). You would probably want your moderator variables added to the MODEL statement as both main effects and interactions with your Device predictor:

 

model count = device a b device*a device*b

View solution in original post

1 REPLY 1
StatDave
SAS Super FREQ

If you don't want to treat your Device predictor as categorical (represented by a set of design variables, resulting in an effect with multiple degrees of freedom), then you can drop the CLASS statement. If it is only in the MODEL statement, then it will by treated as continuous (with 1 degree of freedom). You would probably want your moderator variables added to the MODEL statement as both main effects and interactions with your Device predictor:

 

model count = device a b device*a device*b

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 ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1221 views
  • 0 likes
  • 2 in conversation