Calculation method logic
When you configure the analysis metrics in Events Analysis, or the Also Show metrics in Retention Analysis or Distribution Analysis, you need to choose an appropriate calculation method based on what you're analyzing. This section explains the logic of some of these methods.
Preset calculation methods
- Event total: How many times the event was triggered
- Uniques: How many distinct users triggered the event
- Times per user: Event total / Uniques, that is, the average number of times each user who triggered the event triggered it
Numeric properties
| Calculation method | Logic |
|---|---|
| Average | Sum of property values / number of property values |
| Per User | Sum of property values / Uniques, that is, the average sum of property values per user who triggered the event |
| Median | The middle value after sorting property values from largest to smallest; if the number of property values is even, the median is the average of the two middle values |
The average reflects the overall level of the data, but when some property values are significantly higher or lower than the others, the median represents the overall situation better than the average. Suppose 4 users triggered the payment event 7 times in total:
| User | Amount per payment |
|---|---|
| A | 6、648 |
| B | 30、30、30 |
| C | 128 |
| D | 6 |
- Average = 125.43
- Per User = 219.5
- Median = 30
| Calculation method | Logic |
|---|---|
| Nth Percentile | The property value at the Nth percentile; the median is the 50th percentile |
Besides the median, the Nth percentile is also commonly used to better measure data distribution. For example, you can observe how the Nth percentile of core resource stock changes to decide whether to release new items that consume those resources.
| Calculation method | Logic |
|---|---|
| Variance | Calculate the average first, then the square of the difference between each property value and the average, and finally take the average of these squares |
| Std Dev | The square root of the variance |
Variance and standard deviation measure how much the data fluctuates. Suppose the Experiment Group and the Control Group have similar per-user payment amounts, but the standard deviation of the Experiment Group is significantly higher than that of the Control Group. This means the metric data of the Experiment Group is more strongly affected by large top-up orders.
List properties
| Calculation method | Logic |
|---|---|
| Deduplication of array | Treats each list as a whole and counts the number of distinct lists |
| Deduplication of set | Deduplicates and sorts the elements in each list to get a set, then counts the number of distinct sets |
| Deduplication of element | Takes all elements from all lists, then counts the number of distinct elements |
In games, the IDs of the heroes deployed in a lineup are often recorded in a list property. To analyze how many heroes have been deployed, use Deduplication of element. You can also use Deduplication of array or Deduplication of set to analyze how many distinct lineups there are; the latter does not distinguish the order of heroes in the list or whether a hero appears more than once.
Suppose there are 4 list property values: [a,b,c], [a,b,c,c], [c,b,a], and [a,b,c,d]:
- Deduplication of array = 4
- Deduplication of set = 2
- Deduplication of element = 4
Boolean properties
| Calculation method | Logic |
|---|---|
| True totals, False totals | Number of events whose property value is True/False |
| Null totals, Not null totals | Number of events whose property value is null/not null |

