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;
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
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 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.