# 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.

## A numeric example

Your survey might have a question where you ask respondents to 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 mean" from the context menu:

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."

## A categorical example

Your survey might ask multiple categorical questions, such ratings or rankings, like this example from the Pew Research Gender & Generations Survey where respondents were asked to rate their views of difference between generations:

For variables with formats, Protobi shows additional options to compact to top- or bottom-box scores.

This example shows the question compacted to top-box percentages for each item: