BookmarkSubscribeRSS Feed
Jest
Obsidian | Level 7

Hi, 

 

I am trying to create ROC curves in proc PHREG.

 

Based on the following link the code is:

 

https://support.sas.com/resources/papers/proceedings17/SAS0462-2017.pdf

 

ods graphics on;

proc phreg data=Liver concordance plots=roc rocoptions(at=2 to 10 by 2);

model Time*Status(0)=Bilirubin Age Edema; run;

 

I am pretty much trying to do the same, but keep on getting a syntax error...I have SAS version 9.4...

 

any ideas.

 

thanks.

 

EDITED: via Reeza to fix link.

12 REPLIES 12
Reeza
Super User

You should post your log including the error.

Jest
Obsidian | Level 7

Thank you...

Here is the log with the error:

 

11396 ods graphics on;
11397 proc phreg data=data plots=roc;
---
22
76
ERROR 22-322: Syntax error, expecting one of the following: (, CIF, CMF, CUMHAZ, MCF, NONE, S,
SUR, SURV, SURVIVAL.
ERROR 76-322: Syntax error, statement will be ignored.

WarrenKuhfeld
Rhodochrosite | Level 12

The paper mentions release 14.2.  Is that what you see in your log near the top?  Or do you see 14.1 or some earlier release.  New features don't work in old releases.

Jest
Obsidian | Level 7

That must be it..I think I have an earlier release 

 

it says the following:

 


NOTE: Updated analytical products:

SAS/STAT 13.2
SAS/ETS 13.2
SAS/OR 13.2
SAS/IML 13.2
SAS/QC 13.2

 

Any idea how I can update to a newer release?

 

Thanks.

 

 

Reeza
Super User

Just for fun that doesn't match the code you initially posted....no ROCOPTIONS and the data reference is different.

 

Anyways, I get a similar error using the code from the documentation (not the paper referenced).

 

3401   title;
3402
3403   ods graphics on;
3404   proc phreg data=Liver concordance plots=roc rocoptions(at=2 to 10 by 2);
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and
              COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: ;, (, ALPHA, ATRISK, BRIEF,
              BRIEFSUMMARY, COVM, COVOUT, COVS, DATA, DETAILS, EV, EXPLVAR, FAST, IN, INEST,
              MULTIPASS, NAMELEN, NOPRINT, NOSUMMARY, OUT, OUTEST, PLOT, PLOTS, PRINT, SIMPLE,
              SUREV, TRACE, ZPH.
76: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN
      where the error has occurred.
ERROR 76-322: Syntax error, statement will be ignored.
3405      model Time*Status(0)=Bilirubin Age Edema;
3406   run;

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PHREG used (Total process time):
      real time           0.09 seconds
      cpu time            0.03 seconds


Full code/example is here:

http://documentation.sas.com/api/docsets/statug/14.3/content/statug_code_phrex16.htm?locale=en

 

 

I am SAS 9.4M3 though, which is SAS STAT 14.1, not 14.3

 

It may be worth contacting SAS Tech Support with this one.

 

 

Jest
Obsidian | Level 7

Yes. I am also getting the same error.  I did contact SAS support and they are looking into it but that it could be that one needs SAS 9.4M4 or SAS 9.4M5...It is kind of a nuisance. I work in an academic setting and get the software from here. One should expect that if you pay so much for the license to have everything available. This is another incentive to switch completely to R, which is what everyone is doing...

 

Thanks 

sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

Your university may manage SAS licenses differently than does mine. For me, when there is a new SAS release, I notify the SAS software coordinator in IT and she acquires the update files and creates a depot for installation within one or two weeks. I believe there is no charge to the university, that updates are included in the academic license. So there may be no reason for you to suffer with old versions, although you may have to be proactive.

 

Personally, for mixed models I much, much, much (much) prefer SAS software over R, for a multitude of reasons. I use both, but R only when the client needs R and then with a lot of muttering and grumbling on my part. My clients learn to tolerate hearing, "This would be so much easier in SAS."

 

Edit: And we pay only $90/year/license for the full SAS Foundation. Which IMO is essentially free. One of the perks of working at an academic institution.

 

Edit 2: And Tech Support! Nothing like it in R.

 

Reeza
Super User

@Jest There's no charge for updates. There's also a free version available to students, SAS UE that *IS* currently STAT 14.2. I tested it on there just now and it works fine. You could also access it via the cloud using Academics on Demand, which entails signing up which is easy enough. 

 

With R you might first have to wade through the a dozen packages, find the one that currently works, find out it doesn't have the option you need for the next step and then move onto the next package which won't work in the current version. The packages documentation can also be nonexistent to atrocious to absolutely perfect.  There's also this feeling that since the software is free companies incur no cost and they're also less likely to pay for training. Enterprise level software has it's issue, but so does open source. Pick your poison. 

Tzengz
Calcite | Level 5

Hi,

Am trying to compare models using ROC curves in phreg. Any help?

 

found the syntax below for logistic regression, I want the equivalent for Cox regression. I have tried substituting the model statement with that of Cox but doesn't work.

ods graphics on;
proc logistic data=roc plots=roc(id=prob);
   model popind(event='0') = alb tp totscore / nofit;
   roc 'Albumin' alb;
   roc 'K-G Score' totscore;
   roc 'Total Protein' tp;
   roccontrast reference('K-G Score') / estimate e;
run;

 

shivarajmishra
Calcite | Level 5

Hi,

I am using SAS to run a cox proportional hazard model in proc phreg and want to produce the corresponding roc curves. Using this paper, https://support.sas.com/resources/papers/proceedings17/SAS0462-2017.pdf, I applied "plots(overlay=individual)=roc rocoptions(at=2 6);" after the data statement in proc phreg. But it didnt work. I got the following error (below). I also found that you guys have also faced a similar issues. 

 

Do you have any suggestions, how I can run the model and get the ROC curves? I read that 'SAS 9.4 M5' can help with this from the post above? I am not sure what that means. Is it a SAS update? How one can request it (if it does help?).

 

my model

ods graphics on;
proc phreg data=alswh_new12 plots(overlay=individual)=roc rocoptions(at=2 6);
class rdrec (ref='>38-<=41 yrs');
model Yearsstroke*stroke_ever(0)=rdrec agelastgp/ALPHA=0.05 RISKLIMITS=wald;
format rdrec rdrecf.;
run;

 

error results

2186 ods graphics on;
2187 proc phreg data=alswh_new12 plots(overlay=individual)=roc rocoptions(at=2 6);
---
22
76
ERROR 22-322: Syntax error, expecting one of the following: (, CIF, CMF, CUMHAZ, MCF, NONE, S,
SUR, SURV, SURVIVAL.
ERROR 76-322: Syntax error, statement will be ignored.


2188 ods output FitStatistics=Fit ParameterEstimates = ParameterEstimates;
2189 class rdrec (ref='>38-<=41 yrs');
2190 model Yearsstroke*stroke_ever(0)=rdrec agelastgp/ALPHA=0.05 RISKLIMITS=wald;
2191 format rdrec rdrecf.;
2192 run;

 

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PHREG used (Total process time):
real time 0.04 seconds
cpu time

Reeza
Super User

What version of SAS do you have?

And what version of SAS/STAT?

 

You can check what you have licensed in SAS using:
proc setinit; run;
And what's installed on your system using:
proc product_status; run;
The output will be in the log. 

feeling
Calcite | Level 5

https://odamid.oda.sas.com/SASStudio/

You can try this online platform.

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
  • 12 replies
  • 3980 views
  • 1 like
  • 7 in conversation