BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
H
Pyrite | Level 9 H
Pyrite | Level 9

I am trying to overlay predictors from a logistic regression using ROC curves. I have done this many times, but noticed when using the below code, I do not get the same figures as in the SAS document, see link. In particular, my lines in the "ROC Curves for Comparisons" do not have patterns (i.e., not dashed). I would like the patterned lines, in that the image will be saved in black and white for publication purposes. 

 

I will note, I am using SAS 9.4 and the example comes from SAS 9.2. I only have access to 9.4 and does anyone have a way for me to make lines patterned or distinguishable in a black and whiite image.

 

Thanks,

 

H

 

Example output that I desire:

https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_logistic_se...

 

Code I am using:

   data roc;
      input alb tp totscore popind @@;
      totscore = 10 - totscore;
      datalines;
   3.0 5.8 10 0   3.2 6.3  5 1   3.9 6.8  3 1   2.8 4.8  6 0   
   3.2 5.8  3 1   0.9 4.0  5 0   2.5 5.7  8 0   1.6 5.6  5 1   
   3.8 5.7  5 1   3.7 6.7  6 1   3.2 5.4  4 1   3.8 6.6  6 1   
   4.1 6.6  5 1   3.6 5.7  5 1   4.3 7.0  4 1   3.6 6.7  4 0   
   2.3 4.4  6 1   4.2 7.6  4 0   4.0 6.6  6 0   3.5 5.8  6 1   
   3.8 6.8  7 1   3.0 4.7  8 0   4.5 7.4  5 1   3.7 7.4  5 1   
   3.1 6.6  6 1   4.1 8.2  6 1   4.3 7.0  5 1   4.3 6.5  4 1   
   3.2 5.1  5 1   2.6 4.7  6 1   3.3 6.8  6 0   1.7 4.0  7 0   
   3.7 6.1  5 1   3.3 6.3  7 1   4.2 7.7  6 1   3.5 6.2  5 1   
   2.9 5.7  9 0   2.1 4.8  7 1   2.8 6.2  8 0   4.0 7.0  7 1   
   3.3 5.7  6 1   3.7 6.9  5 1   3.6 6.6  5 1   
   ;

      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;
   ods graphics off;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

What's your output destination, PDF, RTF?

 

Anyways, change the style to Journal, Journal1 or something in that family. 

View solution in original post

13 REPLIES 13
Reeza
Super User

What's your output destination, PDF, RTF?

 

Anyways, change the style to Journal, Journal1 or something in that family. 

H
Pyrite | Level 9 H
Pyrite | Level 9

NO output destination. I am reviewing and grabbing the image from the "Results Review" window.

H
Pyrite | Level 9 H
Pyrite | Level 9

The first attachment is the desired graph and the second is what I get.


SAS desired.pngSAS Output.png
H
Pyrite | Level 9 H
Pyrite | Level 9

Yes, that worked, but I had wondered why there was this difference as well, Is it a version change?  Attached is the Journal style version.

 

Thank you,


SAS Journal Style.png
Jay54
Meteorite | Level 14

With SAS 9.3, the HTML destination uses the HTMLBlue style that has an ATTRPRIORITY=COLOR.  This means that group values first get different colors only.  When all 12 colors are used (with solid pattern), then the pattern (or marker symbol) changes to the next one.  If you want the color and pattern (or symbol) to change with each group, use one of the ATTRPRIORITY=NONE styles (almost all other SAS shipped styles).  You can also change the style behavior by specifying ATTRPRIORITY on the ODS Graphics statement.

 

See:  http://blogs.sas.com/content/graphicallyspeaking/2015/06/28/attributes-priority-for-the-inquiring-mi...

bikashten
Fluorite | Level 6

I am also trying to get black and white gragh. Can I have code for this black and white graph?

 

Thanks,

Bikash

H
Pyrite | Level 9 H
Pyrite | Level 9

I believe this was the code piece I used, attention to the "Journal" part.

 

ods graphics on;
ods html style=Journal;
proc logistic data=pct_post plots=roc(id=prob);
	where final_pna_result ne 1;
	MODEL Final_PNA_result (event = '2') =	PCT_1_c							                                                        Temperature_in_ER
										WBC_1	/ nofit;
	roc 'Procalcitonin'  PCT_1_c;
	roc 'Temperature' Temperature_in_ER;
	roc 'White Blood Cell Count' WBC_1;
    roccontrast reference('Procalcitonin') / estimate e;
run;
ods graphics off;
bikashten
Fluorite | Level 6
Thank you,


bikashten
Fluorite | Level 6

Got you. Are there any way to change the pattern of lines like:----x-x-x-x or ----o-o-o-o-o-- ? I really want to this types of lines.

 

Thanks,

Bikash 

H
Pyrite | Level 9 H
Pyrite | Level 9

I don't know how to change line styles. I would imagine Sanjay or others may know how and it may require changing template settings or some code intensive process. I agree that it would be nice if that was a readily accessible option/process.

 

Reeza
Super User

@bikashten are you expecting the line to be X/O's or to be a dashed line with X/O's for the points?

bikashten
Fluorite | Level 6

different patterns of lines so that reviews can easily visualize the differences between the treatments..

Jay54
Meteorite | Level 14

It seems to me this issue was resolved (as marked).  However, if you want to change the actual patterns using PROC LOGISTIC, you need to change the associated Style.  You can use PROC TEMPLATE, or the %MODSTYLE macro to derive a new style from JOURNAL with the changed patterns and then use that style on the destination.

 

If you are using SAS 9.40 or later wityh PROC SGPLOT, you can change the patterns in the code directly using the STYLEATTRS statement.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 13 replies
  • 3699 views
  • 7 likes
  • 4 in conversation