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

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

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

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. 

View solution in original post

9 REPLIES 9
DanH_sas
SAS Super FREQ

Here you go:

 

Data have;
Input concentration;
cards;
49
50
53
56
60
40
30
44
;
run;

proc sgplot data=have;
hbox concentration;
run;
ArchanaSudhir
Obsidian | Level 7

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

 

Thanks

Archana

DanH_sas
SAS Super FREQ

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

ArchanaSudhir
Obsidian | Level 7

Thanks a lot DanH_sas!

 

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

 

Thanks for all the help, appreciate it:)

DanH_sas
SAS Super FREQ

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

Rick_SAS
SAS Super FREQ

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.

ArchanaSudhir
Obsidian | Level 7

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

Rick_SAS
SAS Super FREQ

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. 

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
  • 9 replies
  • 2254 views
  • 0 likes
  • 4 in conversation