---
title: "Grouping dots by a Z variable"
slug: "grouping-by-a-z-variable"
updated: 2021-05-11T12:33:46Z
published: 2021-05-11T12:33:46Z
canonical: "userguide.dataclassroom.com/grouping-by-a-z-variable"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://userguide.dataclassroom.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Grouping dots by a Z variable

You've probably seen that a categorical Z variable can be used to [color your data](/v1/docs/coloring-by-categorical-z) on a graph.

But it can also be used to split your data up into further groups on the x-axis, both:

- Visually, so they appear separated on the graph
- Analytically, so each group gets its own descriptive stats / regression calculation / etc

This is done by clicking the **Group By Z checkbox**, which appears when it is relevant to use.

### Dot plot grouping by Z

Here is an example of a dot plot which has had a categorical Z variable added, which is coloring the data points. As there is a categorical Z variable available, the **Group By Z** checkbox is visible:

![](https://cdn.document360.io/62f8f41e-e041-42c4-b9bc-8ae1eb45d064/Images/Documentation/image-1617973542647.png)

Checking the Group By Z box will result in the groups being **split into four sub-groups**:

![](https://cdn.document360.io/62f8f41e-e041-42c4-b9bc-8ae1eb45d064/Images/Documentation/image-1617973721942.png)

Each sub-group will be considered separate for purposes of calculations, so adding **Descriptive Stats** will show **four** indicators of the mean and standard deviation:

![](https://cdn.document360.io/62f8f41e-e041-42c4-b9bc-8ae1eb45d064/Images/Documentation/image-1617973990824.png)

And if you show the **Values Table** for the descriptive stats, this will also now have four lines showing all the key statistics for each group separately.
