Hi,
Is there an equivalent of the following code {specifically the line in bold} (in ProcLogistic plots= effect statement works but in proc genmod it doesn't however the documentation says its a shared statement fro both procedure) for Proc Genmod?
/*Effects Plot*/
ods listing SGE=on;
ods trace on;
ods graphics on;
ods rtf style=journal;
proc logistic data=xyz;
plots(only)=effect (x= x3 at (x1=6 x2= 20 )) ;
CLASS gender age_group / param = ref ;
MODEL y(EVENT ='1')= gender age_group x1 x2 x3
x1*x2 x2*x3 x1*x3/ scale=none;
ods rtf close;
ods graphics off;
ods trace off;
Looking forward for help.
Best Regards,
Tasneem
Hi.
In your code, you need to remove the semicolon ';' before the plots statement;
proc logistic data=xyz plots(only)=effect (x= x3 at (x1=6 x2= 20 )) ;
Try and let us know.
Anca.
Hi Anca,
Thanks for your response. I tried what you suggested but it gives the following error:
PROC GENMOD DATA=a
plots(only)=effect (at (centred_AQ=6.33 centred_AC= 21 )) ;
ERROR 22-322: Syntax error, expecting one of the following: (, ALL, CLEVERAGE, CLUSTERCOOKSD,
CLUSTERDFIT, COOKSD, DCLS, DFBETA, DFBETAC, DFBETACS, DFBETAS, DOBS, LEVERAGE, MCLS,
NONE, PREDICTED, RESCHI, RESDEV, RESLIK, RESRAW, STDRESCHI, STDRESDEV.
ERROR 76-322: Syntax error, statement will be ignored.
Can you please suggest anything else?
Thanks
Tasneem
Would you remove the 'only" from the plots statement;
OR
add plots(only label) = ...
If I remove only from plots statement, I get the following error:
plots=effect (at (centred_AQ=6.33 centred_AC= 21 )) ;
ERROR 22-322: Syntax error, expecting one of the following: (, ALL, CLEVERAGE, CLUSTERCOOKSD,
CLUSTERDFIT, COOKSD, DCLS, DFBETA, DFBETAC, DFBETACS, DFBETAS, DOBS, LEVERAGE, MCLS,
NONE, PREDICTED, RESCHI, RESDEV, RESLIK, RESRAW, STDRESCHI, STDRESDEV.
ERROR 76-322: Syntax error, statement will be ignored.
Also, if I use "predicted" option I still get an error..
plots=predicted (at (centred_AQ=6.33 centred_AC= 21 )) ;
ERROR 79-322: Expecting a CLM.
ERROR 76-322: Syntax error, statement will be ignored.
I would appreciate any suggestions or comments.
Thanks
Tasneem
When I ran this code, it works...using my own data
ods listing SGE=on;
ods trace on;
ods graphics on;
ods rtf style=journal;
proc logistic data=my_data plots=effect (x= bmi at (age=50 dm= '1' )) ;
CLASS gender(ref = first) cs_dm(ref= first)/ param = ref ;
MODEL cs_htn = gender bmi age cs/scale = none;
run;
ods rtf close;
ods graphics off;
ods trace off;
the difference between my code and yours is that in the plots statement I have
plots= effect(x = my_var at (....))
and you have plots = effect(at (....));
...
and my code still worked after I removed x= my_var
So, not sure what the issue is
Hi Anca,
Thanks a lot for looking into my problem, I really appreciate your help.
I am using Proc Genmod , have you used effects plot option for PROC Genmod?
My code also works for proc logistic but the issue is with proc genmod
I am copying my entire code and I would really appreciate if you can have a look at it at your conveninece. I am really baffled as to why the same code works for PROC logistic but not PROC
PROC GENMOD DATA=xyz plots= effect(x=centred_SE at(centred_AQ=6.33 centred_AC= 21));
class gender grage gr_revenu2 SM02 cardiac_related_condition PHYSICIAN NAM PATIENT;
MODEL FOLLOWUP_T1_12M_OOC = gender grage gr_revenu2 SM02 cardiac_related_condition
centred_SE centred_AQ centred_AC centred_SE*centred_AC ;
Repeated subject=PATIENT(PHYSICIAN) / corr=exch corrw;
run;
Looking forward to your comments and suggestions.
Thanks
Tasneem
Message was edited by: Tasneem Zaihra
Hi Tasneem.
I realized that I've been using PROC LOGISTIC and not GENMOD, and after further reading, the GENMOD's syntax is different thatn that of LOGISTIC's.
So, you can't have ....plots = effect( x at (y = ... z = ...))
Instead you could use plots = all, in your GENMOD statement.
Of course that may not be what you want....
So, maybe someone more experienced can tell you how to replicate the PROC LOGISTIC plots = effect....in GENMOD.
Best of luck,
Anca.
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.