turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Learn SAS
- /
- Analytics U
- /
- Cannot produce a line-connected series plot with S...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-04-2017 11:22 PM

With an appropriate fussy data step I can get SD bars on a SCATTER plot in SGPLOT using the YERRORUPPER and YERRORLOWER options, but the only lines I can fit appear to be regression lines with REG. Apprently I can't connect the points with line segments. The other kinds of line graph in SGPLOT (VLINE and SERIES) don't appear to support YERRORUPPER and YERRORLOWER. Any suggestions? This deficiency is quite serious, if there is no solution. I would have to add lines manually in Powerpoint.

Will

Accepted Solutions

Solution

01-06-2017
03:03 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-05-2017 10:36 PM

All Replies

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-05-2017 01:36 AM

Since you can easily overlay plots, you can create your error bars as their own 'plot' by using a symbol IBEAM instead and a scatter statement. I also wonder if you can use a custom graph as an marker symbol...

Are these plots you're trying to create a one off or do you produce them regularly? If regularly, I would strongly recommend proc template and sgreneder instead since you'll have more control over the graphics. GTL is definitely harder to learn but its incredibly powerful.

Highly Customized Graphs Using ODS Graphics

http://support.sas.com/resources/papers/proceedings16/12260-2016.pdf

Or there's also the ODS Graphics Editor which will generate the code. This is from a Base SAS installation - I believe you said you had access to SAS 9.4 Base SAS? If so, the code you generate there should work in SAS UE - minus your font issue.

http://blogs.sas.com/content/graphicallyspeaking/2016/12/15/ods-graphics-designer/

WillTheKiwi wrote:

Any suggestions? This deficiency is quite serious, if there is no solution. I would have to add lines manually in Powerpoint.

Will

You tend to jump to this fairly often, there is a definite trade off in terms of programming a graph vs manual point and click in terms of time and accuracy. If you feel programming is not worth the effort then perhaps you shouldn't go down this road at all.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-05-2017 01:47 AM

Thanks, Reeza. Time series connected by line segments would likely be the

most common kind of graph in the biomedical disciplines: such graphs are the

default for randomized controlled trials. Both your suggested solutions

sound promising, but not for casual SAS users of the kind SAS is presumably

trying to attract from R and SPSS. It seems to me that some work needs to

be done here, urgently.

##- Please type your reply above this line. Simple formatting, no

attachments. -##

most common kind of graph in the biomedical disciplines: such graphs are the

default for randomized controlled trials. Both your suggested solutions

sound promising, but not for casual SAS users of the kind SAS is presumably

trying to attract from R and SPSS. It seems to me that some work needs to

be done here, urgently.

##- Please type your reply above this line. Simple formatting, no

attachments. -##

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-05-2017 01:47 AM

most common kind of graph in the biomedical disciplines: such graphs are the

default for randomized controlled trials. Both your suggested solutions

sound promising, but not for casual SAS users of the kind SAS is presumably

trying to attract from R and SPSS. It seems to me that some work needs to

be done here, urgently.

##- Please type your reply above this line. Simple formatting, no

attachments. -##

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-05-2017 01:55 AM

http://support.sas.com/kb/42/542.html

From 2011. If it's not on the SAS ballot you can always add it.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-05-2017 01:23 PM

Thanks for the link to the code for generating and plotting the SE bars

(http://support.sas.com/kb/42/542.html). I had generated similar code. Note

however that SEs should NEVER be shown or plotted. It should always be SDs

in the case of means, or confidence intervals in the case of effects.

Anyway, the problem, as you know, is line segments connecting the points,

rather than regression lines.

Thanks also for your suggestion about putting it in the SAS ballot. If

someone from SAS is reading this, they should realize that it is not a

question of going into a ballot. It's a serious oversight that needs to be

fixed in the next update.

##- Please type your reply above this line. Simple formatting, no

attachments. -##

(http://support.sas.com/kb/42/542.html). I had generated similar code. Note

however that SEs should NEVER be shown or plotted. It should always be SDs

in the case of means, or confidence intervals in the case of effects.

Anyway, the problem, as you know, is line segments connecting the points,

rather than regression lines.

Thanks also for your suggestion about putting it in the SAS ballot. If

someone from SAS is reading this, they should realize that it is not a

question of going into a ballot. It's a serious oversight that needs to be

fixed in the next update.

##- Please type your reply above this line. Simple formatting, no

attachments. -##

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-05-2017 01:23 PM

(http://support.sas.com/kb/42/542.html). I had generated similar code. Note

however that SEs should NEVER be shown or plotted. It should always be SDs

in the case of means, or confidence intervals in the case of effects.

Anyway, the problem, as you know, is line segments connecting the points,

rather than regression lines.

Thanks also for your suggestion about putting it in the SAS ballot. If

someone from SAS is reading this, they should realize that it is not a

question of going into a ballot. It's a serious oversight that needs to be

fixed in the next update.

##- Please type your reply above this line. Simple formatting, no

attachments. -##

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-05-2017 05:40 AM

Can you post a picture to explain what you are looking for ? proc sql; create table have as select age,mean(weight) as mean,min(weight) as min,max(weight) as max from sashelp.class group by age; quit; proc sgplot data=have; scatter x=age y=mean/ yerrorlower=min yerrorupper=max markerattrs=(symbol=circlefilled); series x=age y=mean; run;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-05-2017 01:35 PM

See attached for a default graph generated by my spreadsheet for controlled trials at http://www.sportsci.org/2006/wghcontrial.htm. Such graphs also needs cleaning up with Powerpoint. (Since Office 2007 that has become quite a challenge, because all lines in Excel now become narrow-gauge railway tracks when the graph is ungrouped in Powerpoint.)

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-05-2017 06:32 PM

Is this the graph you're trying to replicate in SAS?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-05-2017 06:58 PM

Yes, that's the kind of graph, but not with those data specifically. So

it's a time series (or several such) connected with line segments and

showing SD bars. If you use SCATTER in SGPLOT, you can get SD bars but no

line segments. If you use SERIES, you can get symbols with line segments

but no SD bars. If you use VLINE, you get line segments but no symbols and

no SD bars. Well, that seems to be the state of affairs, if I haven't missed

something.

##- Please type your reply above this line. Simple formatting, no

attachments. -##

it's a time series (or several such) connected with line segments and

showing SD bars. If you use SCATTER in SGPLOT, you can get SD bars but no

line segments. If you use SERIES, you can get symbols with line segments

but no SD bars. If you use VLINE, you get line segments but no symbols and

no SD bars. Well, that seems to be the state of affairs, if I haven't missed

something.

##- Please type your reply above this line. Simple formatting, no

attachments. -##

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-05-2017 06:58 PM

it's a time series (or several such) connected with line segments and

showing SD bars. If you use SCATTER in SGPLOT, you can get SD bars but no

line segments. If you use SERIES, you can get symbols with line segments

but no SD bars. If you use VLINE, you get line segments but no symbols and

no SD bars. Well, that seems to be the state of affairs, if I haven't missed

something.

##- Please type your reply above this line. Simple formatting, no

attachments. -##

Solution

01-06-2017
03:03 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-05-2017 10:36 PM