- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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:
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;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
What's your output destination, PDF, RTF?
Anyways, change the style to Journal, Journal1 or something in that family.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
What's your output destination, PDF, RTF?
Anyways, change the style to Journal, Journal1 or something in that family.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
NO output destination. I am reviewing and grabbing the image from the "Results Review" window.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The first attachment is the desired graph and the second is what I get.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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,
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I am also trying to get black and white gragh. Can I have code for this black and white graph?
Thanks,
Bikash
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@bikashten are you expecting the line to be X/O's or to be a dashed line with X/O's for the points?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
different patterns of lines so that reviews can easily visualize the differences between the treatments..
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.