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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1233 views
  • 0 likes
  • 2 in conversation