rangebar2

How to download and try this example

Usage: pl -gif rangebar2.htm

Demonstrates outlier display and 1.5 IQR tails.

#proc page #if @DEVICE in gif,png scale: 0.7 #endif backgroundcolor: 0.9 pagesize: 8 6 title: Example of boxplots conforming to the formal Tukey specification #proc getdata data: -4.5 Haynes -4 Jones -3.2 Smith -2.3 Belweather -0.7 Harris -0.1 Scott 0.0 Samuels 0.0 Harding 0.0 Sherman 0.0 Pershing 0.1 Filla 0.2 Margo 0.4 Hamton 0.4 Whitestone 0.6 Perry 0.8 Pomeroy 1.1 Mason 1.1 Parson 1.3 Carey 1.4 Johns 1.6 Cray 2.0 Goldsmith 5.5 McDaniels // set up the area and scaling.. #proc areadef title: Vertical rectangle: 1 1 3 4 xrange: 0 2 yrange: -6 6 areacolor: white // do a Y axis (grid only).. #proc yaxis grid: color=green stubs: inc 2 // do the 1st boxplot.. #proc rangebar showstats: yes datafield: 1 barloc: 1 tailmode: 1.5iqr nlocation: -6.5(s) color: pink mediansym: line taildetails: width=1 showoutliers: yes outlierlabelfield: 2 outlierlabeldetails: style=I meansym: yes #saveas R // Do horizontal bars example.. set up the area and scaling.. #proc areadef title: Horizontal rectangle: 3.5 1 7 3 yrange: 0 2 xrange: -6 6 areacolor: white // do a X axis (grid only).. #proc xaxis grid: color=green stubs: inc 2 // do the horizontal boxplot.. #proc rangebar axis: x nlocation: 7(s) #clone R // set up a legend... #proc legendentry sampletype: symbol details: shape=circle style=filled fillcolor=black radius=0.02 label: Mean #proc legendentry sampletype: symbol details: shape=circle style=outline radius=0.05 label: Near outliers, <= 3 IQR #proc legendentry sampletype: symbol details: shape=circle style=spokes radius=0.05 label: Far outliers, > 3 IQR #proc legend location: 5 4