PROC GENMOD DATA=TEST;
CLASS
ID
THERAPY (REF="0" PARAM=ref)
AGE_GROUP (REF="0" PARAM=ref)
SEX (REF="F PARAM=ref);
MODEL COMPLETION=THERAPY AGE_GROUP SEX/ DIST=poisson LINK=log;
REPEATED SUBJECT=ID/TYPE=EXCH COVB CORRW;
ESTIMATE 'THERAPY 0 v. 1' THERAPY 1/EXP;
ESTIMATE 'AGE_GROUP 0 v. 1' AGE_GROUP 1/EXP;
ESTIMATE 'AGE_GROUP 0 v. 2' AGE_GROUP 0 1/EXP;
ESTIMATE 'AGE_GROUP 0 v. 3' AGE_GROUP 0 0 1/EXP;
ESTIMATE 'SEX female v. male' SEX 1/EXP;
RUN;
I am trying to write the code for a model that will give me the relative risk of completion of a program based on whether or not you received THERAPY (dichotomous), which AGE_GROUP (4 levels) you were in, and your SEX (dichotomous). I am new to the ESTIMATE function, but I need to use GENMOD because this is to calculate the relative risk. My concern lies in whether or not I correctly codes the estimates for each predictor variable?
You must specify all levels of a variable. Please use variable level information from the output to make sure you are correctly understanding the reference category. Hope the below code helps!
PROC GENMOD DATA=TEST;
CLASS
ID
THERAPY (REF="0" PARAM=ref)
AGE_GROUP (REF="0" PARAM=ref)
SEX (REF="F PARAM=ref);
MODEL COMPLETION=THERAPY AGE_GROUP SEX/ DIST=poisson LINK=log;
REPEATED SUBJECT=ID/TYPE=EXCH COVB CORRW;
ESTIMATE 'THERAPY 0 v. 1' THERAPY 0 1/EXP;
ESTIMATE 'AGE_GROUP 0 v. 1' AGE_GROUP 0 1 0 0/EXP;
ESTIMATE 'AGE_GROUP 0 v. 2' AGE_GROUP 0 0 1 0/EXP;
ESTIMATE 'AGE_GROUP 0 v. 3' AGE_GROUP 0 0 0 1/EXP;
ESTIMATE 'SEX female v. male' SEX 0 1/EXP;
RUN;
Thanks,
Rajesh.
You must specify all levels of a variable. Please use variable level information from the output to make sure you are correctly understanding the reference category. Hope the below code helps!
PROC GENMOD DATA=TEST;
CLASS
ID
THERAPY (REF="0" PARAM=ref)
AGE_GROUP (REF="0" PARAM=ref)
SEX (REF="F PARAM=ref);
MODEL COMPLETION=THERAPY AGE_GROUP SEX/ DIST=poisson LINK=log;
REPEATED SUBJECT=ID/TYPE=EXCH COVB CORRW;
ESTIMATE 'THERAPY 0 v. 1' THERAPY 0 1/EXP;
ESTIMATE 'AGE_GROUP 0 v. 1' AGE_GROUP 0 1 0 0/EXP;
ESTIMATE 'AGE_GROUP 0 v. 2' AGE_GROUP 0 0 1 0/EXP;
ESTIMATE 'AGE_GROUP 0 v. 3' AGE_GROUP 0 0 0 1/EXP;
ESTIMATE 'SEX female v. male' SEX 0 1/EXP;
RUN;
Thanks,
Rajesh.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.