BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
djohn051
Fluorite | Level 6
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?

1 ACCEPTED SOLUTION

Accepted Solutions
Rajesh3
Obsidian | Level 7

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.

 

View solution in original post

1 REPLY 1
Rajesh3
Obsidian | Level 7

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.

 

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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