Help using Base SAS procedures

Showing outliers values on a boxplot

Reply
Occasional Contributor
Posts: 10

Showing outliers values on a boxplot

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

Super User
Posts: 10,490

Re: Showing outliers values on a boxplot

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.

Occasional Contributor
Posts: 10

Re: Showing outliers values on a boxplot

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

Super User
Posts: 17,801

Re: Showing outliers values on a boxplot

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

Occasional Contributor
Posts: 10

Re: Showing outliers values on a boxplot

SAS 9.4

Frequent Contributor
Posts: 91

Re: Showing outliers values on a boxplot

[ Edited ]

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

Occasional Contributor
Posts: 10

Re: Showing outliers values on a boxplot

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

Super User
Posts: 10,490

Re: Showing outliers values on a boxplot

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

Super User
Posts: 17,801

Re: Showing outliers values on a boxplot

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

 

You may need an annotate dataset for that...

Occasional Contributor
Posts: 10

Re: Showing outliers values on a boxplot

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

Super User
Posts: 17,801

Re: Showing outliers values on a boxplot

Post your code and log

Occasional Contributor
Posts: 10

Re: Showing outliers values on a boxplot

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;

Super User
Posts: 17,801

Re: Showing outliers values on a boxplot

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.

Occasional Contributor
Posts: 10

Re: Showing outliers values on a boxplot

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...

Super User
Posts: 17,801

Re: Showing outliers values on a boxplot

[ Edited ]

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.  

Ask a Question
Discussion stats
  • 20 replies
  • 797 views
  • 2 likes
  • 5 in conversation