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
- /
- Box and whisker plot generation

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

05-02-2016 07:08 AM

HI

I have a data:

Data have;

Input concentration;

49 50 53 56 59 60 40 30 44

How do I generate a box and whisker plot for this with 25th and 75th percentile?

THnaks

Archana

Accepted Solutions

Solution

05-19-2016
11:08 AM

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

Posted in reply to ArchanaSudhir

05-03-2016 10:55 AM

I strongly encourage you to read about box plots and the statistics that they represent. Here is a step-by-step introduction:

http://bolt.mph.ufl.edu/6050-6052/unit-1/one-quantitative-variable-introduction/boxplot/

The interquartile range is the value IQR = P75 - P25 where P75 is the 75th percentile value and P25 is the 25th percentile value.

The IQR is used to determine the length of the whiskers. Some software uses 1.25 as a multiplier, others use 1.5.

All Replies

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

Posted in reply to ArchanaSudhir

05-02-2016 08:33 AM

Please have a look at the excellent blogs by @Sanjay_SAS http://blogs.sas.com/content/graphicallyspeaking/?s=box+and+whisker

Bruno

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

Posted in reply to ArchanaSudhir

05-02-2016 09:23 AM

Here you go:

```
Data have;
Input concentration;
cards;
49
50
53
56
60
40
30
44
;
run;
proc sgplot data=have;
hbox concentration;
run;
```

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

Posted in reply to DanH_sas

05-02-2016 09:41 AM

Thanks, what does the centre line in hte box mean? Is it not the median?

Thanks

Archana

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

Posted in reply to ArchanaSudhir

05-02-2016 09:42 AM

Yes, the line is the median, and the marker is the mean.

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

Posted in reply to DanH_sas

05-02-2016 01:30 PM

Thanks a lot DanH_sas!

One last question, does mean needs to be plotted or geometric mean?

Thanks for all the help, appreciate it

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

Posted in reply to ArchanaSudhir

05-02-2016 01:38 PM

The mean on the box plot is the arithmetic mean, not the geometric mean.

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

Posted in reply to ArchanaSudhir

05-02-2016 01:46 PM - edited 05-02-2016 01:47 PM

The following link is to SAS documentation that you can use to learn more about what each part of a box plot represents:

Schematic box-and-whisker plot.

The SGPLOT procedure varies a little (using a diamond instead of a cross for the mean), but the basic idea applies to the VBOX statement in PROC SGPLOT.

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

Posted in reply to Rick_SAS

05-03-2016 10:47 AM

HI,

1. I am using SAS 9.2. And the Box plots are not getting generated with the code mentioned.

Results has plot. But when I open it just says loading and never loads.

2. What does " whiskers to the last data point within 1.25 times the interquartile range" mean?

Thanks,

Archana

Solution

05-19-2016
11:08 AM

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

Posted in reply to ArchanaSudhir

05-03-2016 10:55 AM

I strongly encourage you to read about box plots and the statistics that they represent. Here is a step-by-step introduction:

http://bolt.mph.ufl.edu/6050-6052/unit-1/one-quantitative-variable-introduction/boxplot/

The interquartile range is the value IQR = P75 - P25 where P75 is the 75th percentile value and P25 is the 25th percentile value.

The IQR is used to determine the length of the whiskers. Some software uses 1.25 as a multiplier, others use 1.5.