BookmarkSubscribeRSS Feed
niconegrin
Calcite | Level 5

Hi ! I am new in this so my question is: how do I make SAS show the values of the outliers in my boxplots?

I used the "schematic" style, is there another style in boxplots that will show it?

Thanks

Nicolas

20 REPLIES 20
ballardw
Super User

Please show the code you are using as there are several ways to make box plots and some suggestions won't apply with your starting point.

niconegrin
Calcite | Level 5

proc boxplot data=assign1;

plot fat*trt/boxstyle=schematic;

run;

proc boxplot data=assign1;

plot rea*trt/boxstyle=schematic;

run;

proc boxplot data=assign1;

plot kph*trt/boxstyle=schematic;

run;

Thanks

Reeza
Super User

Also, what version of SAS - the graphing options are changing quickly between versions.

niconegrin
Calcite | Level 5

SAS 9.4

WendyT
Pyrite | Level 9

Hi Nicolas-

 

I think you may be looking for BOXSTYLE=SCHEMATICIDFAR.  (or SCHEMATICID)

 

Take a look at the last couple of boxplot examples (28.3.4) to see if this is what you want to display.

 

https://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_boxplot_exa...

 

title 'Analysis of Airline Departure Delays';
title2 'BOXSTYLE=SCHEMATICIDFAR';
proc boxplot data=Times;
   plot Delay*Day /
      boxstyle = schematicidfar
      odstitle  = title
      odstitle2 = title2
      nohlabel;
   id Reason;
   label Delay = 'Delay in Minutes';
run;

 

Hope this helps!

 

WendyT

niconegrin
Calcite | Level 5

Nop, it does not show the "values" but that I mean the actual figure, number, it shos the outlier OK but I actually want to show the value of that outliers (for ex. 0.62, etc).

Thanks anyway

ballardw
Super User

Use the ID option to specify a variable that labels outliers when using the boxstyle =schematicid or schematicidfar. You likely want the SchematicIdFar.

Reeza
Super User

Am I understanding correctly that you want the values only, no circles at the locations?

 

You may need an annotate dataset for that...

niconegrin
Calcite | Level 5

The circles and the values....

Thanks! I already tried the SCHEMATICID option but still shows the outlies circles (which is fine) but does not show the values the circles represent.

Thanks

Reeza
Super User

Post your code and log

niconegrin
Calcite | Level 5

proc boxplot data=assign1;

plot fat*trt/boxstyle=schematic;

run;

proc boxplot data=assign1;

plot rea*trt/boxstyle=schematic;

run;

proc boxplot data=assign1;

plot kph*trt/boxstyle=schematic;

run;

Reeza
Super User

That's the same code you posted above, please show with the boxstyle options suggested - ID/IDFAR.

 

Also, log and output that isn't what you expected.

niconegrin
Calcite | Level 5

proc boxplot data=assign1;

plot fat*trt/boxstyle=schematicidfar horizontal;

label;

run;

proc boxplot data=assign1;

plot rea*trt/boxstyle=schematicidfar horizontal;

run;

proc boxplot data=assign1;

plot kph*trt/boxstyle=schematicidfar horizontal;

run;

 

I also tried the horizontal option to see if it worked...

Reeza
Super User

1. Use boxstyle=schematicID

2. Use an ID statement to specify the ID variable - you've missed this step.

 


data class; set class; if name='Alfred' then weight=200; if name='Robert' then weight=500; if name='Alice' then weight=20; run; title; proc boxplot data=class; plot weight*sex / boxstyle = schematicid ; id name; run;quit;

 

This is @ballardw solution several response above, as well.  

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 20 replies
  • 10735 views
  • 2 likes
  • 5 in conversation