How to make a colored boxplot with one group variable?

How to make a colored boxplot with one group variable?

book

Article ID: KB0074313

calendar_today

Updated On:

Products Versions
Spotfire Statistica 13.0 and later

Description

This article details the steps of plotting a categorized boxplot where colors of bars from different categories are filled differently. The rats.sta data available in Statistica example dataset folder is used. The Rats data has two categorical variables, “ENVIRNM” and “STRAIN,” and one numeric variable, “ERROR”. Let's use “ERROR” as the dependent variable and “ENVIRNM” as the only group variable


 

Issue/Introduction

How to make a colored boxplot with one group variable?

Resolution

1.Open Rats.sta data.

2.Select Graphs|Box in Common group(Figure 1).

Figure 1

3.Select Advanced Tab under “2D Box Plots” dialog(Figure 2).

4.Select “Box-Whiskers” and “Multiple” under Graph Type .

5.Click “Variables” to choose the dependent variable ("ERROR") and the Grouping variable ("ENVIRNMT") in the “Select Variables for Box Plot” dialog.

6.Click “OK” in the “Select Variables for Box Plot” dialog.

7.Select “Overlaid” under Multiple box layout in the Advanced Tab(Figure 2).

Figure 2

8.Select Categorized Tab under “2D Box Plots” dialog (Figure 3).

9.Check “On” under X-Categories in the Categorized Tab.

10.Select “Overlaid” under Layout.

11.Click “Change variables”  to select “ENVIRNMT” and then Click "OK" in the “Select Categorization Variable” dialog.

12.Click “OK” in the Categorized Tab, a boxplot will be generated with different colors representing different rats’ environments (Figure 4).

Figure 3

Figure 4