Publication date: 07/15/2025

Example of a By Variable

This example shows you how to use a By variable to create a separate analysis for each level of a categorical variable.

1. Select Help > Sample Data Folder and open Lipid Data.jmp.

2. Select Analyze > Distribution.

3. Click the triangle next to the Cholesterol column group to expand it.

4. Select Cholesterol and click Y, Columns.

5. Click the triangle next to the Personal Information column group to expand it.

6. Select Sex and click By.

This results in a separate analysis for each level of Sex (female and male).

7. Click OK.

Change the orientation of the histograms and the reports.

8. Click the Distributions red triangle and select Stack.

Add a smooth curve to both histograms.

9. Hold down the Ctrl key. Click the Cholesterol red triangle and select Continuous Fit > Fit Smooth Curve.

Hide the Compare Distributions report.

10. Hold down the Ctrl key. Click the gray disclosure icon next to Compare Distributions.

Figure 3.13 Separate Distributions by Sex 

Separate Distributions by Sex

Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).