# Chapter 8 Box plot

## 8.1 Intro

Boxplots are normally used to inspect the distribution of continuous (cardinal, e.g. interval or ratio-level) variables.

### 8.1.1 Example dataset

This example uses the Rosetta Stats example dataset “pp15” (see Chapter 1 for information about the datasets and Chapter 3 for an explanation of how to load datasets).

### 8.1.2 Variable(s)

From this dataset, this example uses variable xtcUsePillHigh.

## 8.2 Input: jamovi

Open the “Exploration” menu and select the “Descriptives” option as shown in Figure 8.1.

In the “Descriptives” dialog that appears, expand the “Plots” section at the bottom and check the checkbox labelled “Box plot” as shown in Figure 8.2.

Select the variable(s) for which you want to produce a box plot by dragging those variables from the list at the top left to the box marked “Variables” just to the right of that list. The box plot will be automatically produced in the output pane on the right-hand side.

## 8.3 Input: R

These sections require the rosetta package to be installed, see section 2.2.2, and the example dataset to be stored under name dat, see section 3.

### 8.3.1 Input: rosetta

rosetta::ggBoxplot(dat\$xtcUsePillHigh);

## 8.4 Input: SPSS GUI

First activate the dat dataset by clicking on it (see 2.3.1).

Open the “Graphs” menu and select the “Chart Builder” option as shown in Figure 8.3.

In the “Chart Builder” dialog, select “Boxplot” from “Gallery” and drag “1-D Boxplot” to the “Chart Preview” as shown in Figure 8.4.

Under the “Variables” menu, select “xtcUsePillHigh” and drag it onto the “X-Axis?” option in “Chart Preview” as shown in Figure 8.5. The variable you put on the vertical x-axis must be labeled as “scale” type. Note that there are options to modify the aesthetics of the graph on the right side of the screen under “Element Properties”, “Chart Appearance”, and “Options”.

Press OK and the graph will appear in the SPSS output window.

## 8.5 Input: SPSS Syntax

Use the following command (this requires the dat dataset to be the active dataset, see 2.3.1):

GRAPH /BOXPLOT = xtcUsePillHigh.