BookmarkSubscribeRSS Feed
NahidSultanakmc
Calcite | Level 5

 I am using proc genmod for logistic regression with repeated measures. However, the following code does not show the odds ratio. I need to know the odds ratio of the continuous variable "rcg00017033 ".

 

proc genmod data=spt_three_final;
class studyid ;
model spt(event='1')= rcg00017033 gender P10_Q5BirthWeight/ dist=bin link=logit;
repeated subject=studyid / type=cs;run;

6 REPLIES 6
Ksharp
Super User
https://support.sas.com/kb/35/189.html


You need to write ESTIMATE statement for continuous variable:

proc genmod data=uti;
freq count;
class diagnosis treatment;
model response = diagnosis treatment diagnosis*treatment / dist=binomial;
estimate 'trt A vs C in comp' treatment 1 0 -1
diagnosis*treatment 1 0 -1 0 0 0 / exp;
run;
NahidSultanakmc
Calcite | Level 5
Thank you very much for the help.
But I don't know the use of the numbers (0,1-1 ) in the estimate statement. Is there any specific rules?
Ksharp
Super User

It is for category variable ,not continuous variable.
estimate 'age at 7'  intercept 1  age 7 /exp;

NahidSultanakmc
Calcite | Level 5
Thank you very much again. The link is very helpful. So, if I need to know the odds ratio for two continuous variables (cg27664530, cg27664530*Time), should I use the below code?
proc genmod data=spt_three_final1;
class studyid ;
model spt(event='1')= cg27664530 cg27664530*time gender P10_Q5BirthWeight time/ dist=bin link=logit;
repeated subject=studyid / type=cs;
estimate 'cg27664530' cg27664530 2/exp;
estimate 'cg27664530*time' cg27664530*time 3/exp;
run;


Ksharp
Super User
I think you did not check URL I gave you .
https://support.sas.com/kb/35/189.html
Check example in it:
/* Odds ratio for change in StartVert from 5 to 6 */
contrast 'logOdds@x=5' intercept 1 startvert 5 startvert*startvert 25 / estimate=both;
contrast 'logOdds@x=6' intercept 1 startvert 6 startvert*startvert 36 / estimate=both;
contrast 'logOdds@6-logOdds@5' startvert 1 startvert*startvert 11 / estimate=both;

And better post it at State Forum :
https://communities.sas.com/t5/Statistical-Procedures/bd-p/statistical_procedures
and calling out @StatDave @ jiltao @SteveDenham .
I am NOT expert about this though.
Ksharp
Super User
proc logistic data=kyphosis;
model Kyphosis(event="1") = StartVert|StartVert;
estimate '4.5' intercept 1 startvert 4.5 startvert*startvert 20.25,
'5.5' intercept 1 startvert 5.5 startvert*startvert 30.25 / e;
estimate '9.5' intercept 1 startvert 9.5 startvert*startvert 90.25,
'10.5' intercept 1 startvert 10.5 startvert*startvert 110.25 / e;
ods output coef=c;
store log;
run;

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 557 views
  • 0 likes
  • 2 in conversation