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
- /
- SAS Programming
- /
- SAS/GRAPH and ODS Graphics
- /
- Graphing points with error bars

Topic Options

- 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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-14-2013 01:56 PM

We don't yet have SAS/GRAPH and are considering purchasing. Can you describe the process (short version) to add vertical error bars around a series of points? These will be confidence intervals around the mean. Would this be GPLOT or GCHART or other? Anything else we should know? Thanks

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

Posted in reply to onpoint1

03-14-2013 02:06 PM

Hi.

Both will do it for you.

proc gchart data = sashelp.class;

vbar sex/ type=MEAN **errorbar=BOTH** clm=95 sumvar=age;

run; quit;

And here is more info:

http://www.nesug.org/proceedings/nesug07/ff/ff17.pdf

For proc gplot you will have to calculate yourself the mean +/- s.e. to get the upper/lower Confidence Limits.Then use an overlay to plot.

Here is more information:

42515 - Plot means with standard error bars from calculated data with PROC GPLOT

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

Posted in reply to onpoint1

03-14-2013 03:31 PM

You can also use PROC SGPLOT. For bar charts, line charts, and dot plots, you can have the procedure compute three types of limits: clm, stderr, and stddev. YOu can also specify a multiplier for stderr and stddev.

proc sgplot data=sashelp.class;

vbar age / response=weight stat=mean limitstat=clm;

run;

For plots, you can use overlays to plot the limit bars:

proc sgplot data=somedata;

series x=xvar y=yvar;

scatter x=xvar y=yvar / yerrorupper=ulimitvar yerrorlower=llimitvar;

run;

The SG procedure were introduced in SAS 9.2 as part of SAS/GRAPH; however, as of SAS 9.3, they are part of BASE SAS.

Hope this helps!

Dan