BookmarkSubscribeRSS Feed
TZaihra
Fluorite | Level 6

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

8 REPLIES 8
AncaTilea
Pyrite | Level 9

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.

TZaihra
Fluorite | Level 6

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

AncaTilea
Pyrite | Level 9

Would you remove the 'only" from the plots statement;

OR

add plots(only label) = ...

TZaihra
Fluorite | Level 6

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

AncaTilea
Pyrite | Level 9

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;

AncaTilea
Pyrite | Level 9

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

Smiley Sad

TZaihra
Fluorite | Level 6

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

AncaTilea
Pyrite | Level 9

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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 8 replies
  • 2525 views
  • 3 likes
  • 2 in conversation