Skip to content

docs: Add example for aggregating percentage changes in DataTable#3274

Open
RamiNoodle733 wants to merge 1 commit intoevidence-dev:mainfrom
RamiNoodle733:docs-aggregate-percentage-changes
Open

docs: Add example for aggregating percentage changes in DataTable#3274
RamiNoodle733 wants to merge 1 commit intoevidence-dev:mainfrom
RamiNoodle733:docs-aggregate-percentage-changes

Conversation

@RamiNoodle733
Copy link

Description

This PR adds documentation explaining how to properly aggregate percentage changes (e.g., year-over-year growth rates) in DataTable total rows.

Problem

Users needed guidance on how to correctly aggregate percentage changes. A simple average can be misleading when aggregating growth rates across entities of different sizes.

Solution

Added a new "Aggregating Percentage Changes" section to the DataTable documentation that:

  • Explains why weighted mean is preferred over simple average for percentage changes
  • Shows how to use \totalAgg=weightedMean\ with \weightCol\ to calculate properly weighted averages
  • Provides a clear code example demonstrating the pattern

Changes

  • Added new documentation section with explanation and example
  • Shows how to weight growth rates by revenue/size for accurate aggregation

Fixes #2592

Adds a new documentation section explaining how to properly aggregate
percentage changes (e.g., growth rates) using weightedMean with a
custom weightCol, rather than a simple average which can be misleading.

Fixes evidence-dev#2592
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs]: Show example of how to aggregate percentage changes in DataTable

1 participant