# Compact to...

### Grouping variables to summarize stats

Protobi allows you to compact groups of variables to summarize statistics for each one. This allows you to selectively expand individual variables to peek at their distributions. This tutorial will demonstrate how you can compact a group of variables with: 1. numeric, 2. categorical and 3. checkbox values.

## Numeric example

In this example of a numeric question respondents enter multiple percentages that sum to 100. Each individual percentage is its own question and has its own distribution. The results might appear as follows:

However, this is a lot of information to look at. Maybe you just want to know the **average** percent for each item. Press the square icon for the group and select "Compact to" from the context menu:

In the "Compact to" dialog choose mean:

The same data is now presented in compact form showing just the mean percentage. (Here we also set `{"maxValue": 100},`

so the means are graphed as bars.)

You can peek at the underlying distribution for one or more variables by pressing the triangle icon next to each state to expand the data:

To return the question to the original state, press the square icon for the group and select "Expand."

## Categorical example

Your survey might ask multiple categorical questions, such ratings or rankings. The example below is a typical set of ratings.

Below they are each shown individually, so you can see the entire distribution for each item.

You might wish to compact the distributions to just top-box scores, see top-box summary percentages but also see entire distributions stacked in compact, or expand them back to see all the details.

Press the square icon for the group, select "Compact to," and choose 'Strongly agree':

There is also an option to display the variable distributions as stacked bars.

Open the context menu again and choose "Display stacked":

Press the row icon to see the entire distribution for one item (seen below):

The top-box summaries in compact mode are selectable values, which you can select with *Press* or *Option+Press* or-select with *Shift-Press*.

For more advanced summaries, such as top-two box, select *Compact to...* and enter an array of unformatted values, e.g. `[1,2]`

.

### Video tutorial

## Checkbox example

The example below is a typical grid of checkbox items. They are each shown individually, so you can see the entire distribution for each item.

You can compact the distributions to see checked (ex. "yes", "true", "1") responses only, and be able to expand each item to see all the details.

To change the settings, press the edit icon (square) and select Compact to "Checkbox."

Press the row icon to see the entire distribution for one item (seen below):

### Video tutorial

## See related

In this tutorial, for the categorical example we showed you a typical set of *ratings*. To learn more about *ranking* questions in Protobi please see Ways to display rankings.