Aggregating and summarizing group data using Transform

In Protobi, you can calculate aggregate values for a group based on its individual child elements using a feature called "Transform". This process is different from "Compact to..." because it doesn’t just summarize the individual child elements; it actually creates a new aggregate value for the entire parent group. This is useful when you want to get a higher-level summary that combines the individual data points.

In this tutorial, we’ll walk through the basics of how to use transforms in Protobi, including the different types of transforms available, such as transforms to sum, mean, median, and more.

What is "Transform"?

A "Transform" in Protobi allows you to perform calculations on the child elements of a group and generate an aggregate value for the parent group.

Types of Transforms

Whether you’re summing percentages, calculating averages, or counting how many options were selected, transforms provide a powerful way to analyze your survey data at a higher level. There are a few different types of transforms (Sum, Mean, Median, Min, Max, Std Dev, Condense, and Compact), you can manipulate and summarize your data in ways that make sense for your analysis.

Here are the different types of transforms you can apply in Protobi:

  • Sum: This transform adds up all the values from the child elements. For example, if you have a set of questions asking about the proportions of patients on each therapy, this transform will sum the proportions to check if the total for each respondent adds up correctly.

  • Mean: This transform calculates the average value of the child elements. It’s useful when you want to find the typical value across a group of questions.

  • Median: This transform calculates the the median value of the child elements. This transform is useful when you want to get a better sense of the "middle" response among the child elements.

  • Min: This transform returns the smallest value from the child elements. It’s useful when you want to know the lowest value among a group of child element. For instance, the loweset rated attribute in a set of attribute ratings for instance.

  • Max: The opposite of the Min transform, this one gives you the largest value from the child elements. It’s helpful when you want to find the highest response.

  • Std Dev: The standard deviation tells you how spread out the data is. If you want to understand the variability among the child elements of the group, this is the transform to use.

  • Condense: This transform will "squish" the child responses into one distribution. Instead of a group with child elements each with its own distribution to, all values from all the children will be in one distribution. For example, you might let respondents enter open-end text responses in multiple text boxes and each text box is show in Protobi as it's own element, but you want to see all open-end responses together in one distrubtion. See Condense text verbatims for its most common application and Transform to condense.

  • Compact: Nicknamed as "squash", this transform reduces the child responses to their compact values. For instance if you compact a 1-7 rating scale group to Top 2 Box values, then transform to Compact, you will no longer be able to expand each child to see the entire distrbution of ratings 1-7. But with transform to Compact, you can turn a group into a usable crosstab banner. See Transform to compact.

  • Custom: Use this option to create a custom calculation to use as your value.

Transform Examples

The "Transform to Sum" and "Transform to Condense" features are commonly used to simplify and aggregate data for easier analysis. Follow the steps below on how to use transform to combine a numeric group to Sum and Condese a text response group to one distribution.

Transform to Sum

To calculate the total sum of child values within a group, follow the steps below.

Example: Transform stated proportions to check if they sum to 100 Imagine you have a survey where respondents are asked to enter multiple proportions, and each proportion corresponds to a specific therapy. These proportions should sum up to 100, but you want to verify that they do. You can use a transform to sum all the individual proportions and check if every respondent's answers add up to 100.

Steps:

  1. Choose the group in your survey that contains the child elements you want to aggregate.

Note: To preserve the original view of the group, it's recommended that you clone the group first and then apply the transform to the clone.

  1. Press the square context menu icon for the group to bring up the transform options.

  2. Choose the "Transform..." option to open the transform dialog.

  1. Select Sum and press "Ok".

Note: You can also hide the distributions of each individual child of Q2 by checking the "Hide children" option in the transform dialog.

  1. The result is a distribution with the sum value of all the individual child elements within the group.

For Q2, respondents are asked to enter a proportion for each therapy, with the total across all therapies supposed to sum to 100. Some responses may be marked as [NA] because certain respondents didn’t see the question due to a skip pattern. In this case, had some respondents not sum to 100, we would recommend you follow up with the survey programmer to resolve the issue.

Sum checkbox groups

Transform to Sum can also help in other scenarios, such as counting how many options were selected in a "select-all-that-apply" question. Follow the above steps for a checkbox group to count the number of selected child elements.

Transform to Compact

Transform to Compact takes a group of elements—such as checkbox questions or rankings—and merges them into a single element with multiple response values.

Example: Transform checkbox grids into a single element that can be used as a crosstab banner

  1. Press the square context menu icon for the group to bring up the transform options.
  2. Choose the "Transform..." option to open the transform dialog.
  1. Select Compact (squash) and press "Ok".
  1. The result is a single distribution, where each option becomes a separate response value.

Keep in mind that because respondents can select multiple options, the percentages may add up to more than 100%.

  1. Use the trasnformed element as a crosstab banner

In its original state, Q8 (the checkbox group) cannot be used as a banner in a crosstab. However, after transforming the group to compact, Q8 can be dragged into another variable (e.g., Q10) to create a crosstab.

Transform to Condense

Transform to Condense allows you to combine responses from multiple elements into a single distribution. A common use case is when a survey asks respondents to provide open-ended text responses in multiple text boxes and you want to show all responses in one distribution in Protobi.

Example: Transform text open-ends in multiple elements into one distribution

  1. Press the square context menu icon for the group to bring up the transform options.
  2. Choose the "Transform..." option to open the transform dialog.
  1. Select Condense (squish) and press "Ok".

Note: You can also hide the distributions of each individual child of Q7 by checking the "Hide children" option in the transform dialog.

  1. The result is a single distribution with all responses from both elements (Q7_1, Q7_2).