RATS 10.1
RATS 10.1

Graphics /

Box Plots (GBOX)

Home Page

← Previous Next →

Box plots (also known as box and whisker plots) provide a quick way to examine some basic statistical properties of one or more data series, and they can give you a visual indication of how the observations in the data are distributed. They can be done with the GBOX instruction (with a great deal of control over the appearance) or, for series in a Series List Window, with the View—Box Plot operation or  toolbar icon.

Elements of a Box Plot

Box plots include the following elements:

A line representing the median value

A box representing the interquartile range (IQR). The top and bottom lines of the box correspond to the 75th and 25th percentiles, respectively.

Vertical lines, or “whiskers” indicating (up to) 1.5 times the IQR in either direction from the 75th and 25th percentiles. This is about 2.7 standard deviations on either side of the median for a Normal series. (The whisker will be truncated at the maximum or minimum value if necessary—in the example below, the lower whisker is shorter because of that).

Short horizontal lines representing the maximum and minimum values.

Dots representing outliers: values outside the whiskers.

 

 

 

This simple example (from GRAPHBOXPLOT.RPF) draws box plots for two data series which list taxes as a share of total output for 22 countries in two different years. The first series contains the data for 1965, while the second series contains data for 1983:

 

open data CountryTaxData.xlsx

calendar(panelobs=22)

data(format=xlsx,org=columns) 1//1 1//22 Country Tax1965 Tax1983

gbox(header="Taxes as Share of Output for 22 Countries",$

     subheader="1965 vs 1983",labels=||"1965","1983"||,$

     frame=half,extend) 2

# tax1965

# tax1983

 

Here, we’ve used the LABELS option to tell GBOX to use “1965” and “1983” as the labels for the two series, rather than the series names. In this case, we use in-line matrix notation to provide the VECTOR of STRINGS.

 

 


Copyright © 2025 Thomas A. Doan