Introduction
This article describes how to create a Density plot, like this:
Requirements
A variable containing numeric data, either in a loaded data set or a table.
A categorical variable (Nominal, Ordinal, Binary) to use for groupings.
Method
- From the toolbar, select Create > Charts > Visualization > Distributions > Density.
- Under Inputs > DATA SOURCE > Variables select your numeric variable.
- Click Calculate and/or ensure Automatic is checked.
- If your numeric data is stored in a table rather than a numeric variable, in step 2, use Inputs > DATA SOURCE > Output and select the appropriate table.
Comparing between groups
When you use variables as an input you can split the density plot up and make comparisons between groups. For example, to compare the distribution of age according to what type of cola they drink.
- From the toolbar, select Create > Charts > Visualization > Distributions > Density.
- Under Inputs > DATA SOURCE > Variables select your numeric variable.
- Under Inputs > DATA SOURCRE > Groups select your grouping variable.
- Click Calculate and/or ensure Automatic is checked.
- If your numeric data is stored in a table rather than a numeric variable, in step 2, use Inputs > DATA SOURCE > Output and select the appropriate table.
Next
How to Create a Density Plot Using R