validate-data
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/validate-data - Validate Analysis Before Sharing
/validate-data - 分享前验证分析内容
If you see unfamiliar placeholders or need to check which tools are connected, see CONNECTORS.md.
Review an analysis for accuracy, methodology, and potential biases before sharing with stakeholders. Generates a confidence assessment and improvement suggestions.
若遇到不熟悉的占位符或需要查看已连接的工具,请参阅 CONNECTORS.md。
在向利益相关者分享前,针对分析内容的准确性、方法论及潜在偏差进行审核,生成可信度评估与改进建议。
Usage
使用方法
/validate-data <analysis to review>The analysis can be:
- A document or report in the conversation
- A file (markdown, notebook, spreadsheet)
- SQL queries and their results
- Charts and their underlying data
- A description of methodology and findings
/validate-data <待审核的分析内容>待审核的分析内容可以是:
- 对话中的文档或报告
- 文件(markdown、笔记本、电子表格)
- SQL查询及其结果
- 图表及其底层数据
- 方法论与研究发现的描述
Workflow
工作流程
1. Review Methodology and Assumptions
1. 审核方法论与假设
Examine:
- Question framing: Is the analysis answering the right question? Could the question be interpreted differently?
- Data selection: Are the right tables/datasets being used? Is the time range appropriate?
- Population definition: Is the analysis population correctly defined? Are there unintended exclusions?
- Metric definitions: Are metrics defined clearly and consistently? Do they match how stakeholders understand them?
- Baseline and comparison: Is the comparison fair? Are time periods, cohort sizes, and contexts comparable?
检查以下内容:
- 问题框架:分析是否回答了正确的问题?问题是否存在其他解读方式?
- 数据选择:是否使用了正确的表格/数据集?时间范围是否合适?
- 群体定义:分析群体的定义是否准确?是否存在意外的排除项?
- 指标定义:指标的定义是否清晰且一致?是否与利益相关者的理解匹配?
- 基准与对比:对比是否公平?时间段、群组规模及场景是否具备可比性?
2. Run the Pre-Delivery QA Checklist
2. 执行交付前质量验证清单
Work through the checklist below — data quality, calculation, reasonableness, and presentation checks.
完成以下清单检查——数据质量、计算、合理性及呈现方式检查。
3. Check for Common Analytical Pitfalls
3. 排查常见数据分析陷阱
Systematically review against the detailed pitfall catalog below (join explosion, survivorship bias, incomplete period comparison, denominator shifting, average of averages, timezone mismatches, selection bias).
系统性检查以下常见问题(连接膨胀、生存者偏差、不完整周期对比、分母偏移、平均值的平均值、时区不匹配、选择偏差)。
4. Verify Calculations and Aggregations
4. 验证计算与聚合逻辑
Where possible, spot-check:
- Recalculate a few key numbers independently
- Verify that subtotals sum to totals
- Check that percentages sum to 100% (or close to it) where expected
- Confirm that YoY/MoM comparisons use the correct base periods
- Validate that filters are applied consistently across all metrics
Apply the result sanity-checking techniques below (magnitude checks, cross-validation, red-flag detection).
尽可能进行抽查:
- 独立重新计算几个关键数值
- 验证小计是否等于总计
- 检查百分比是否符合预期(总和接近100%)
- 确认同比/环比使用了正确的基准周期
- 验证过滤器在所有指标中应用一致
运用以下结果合理性检查技巧(量级检查、交叉验证、红标检测)。
5. Assess Visualizations
5. 评估可视化内容
If the analysis includes charts:
- Do axes start at appropriate values (zero for bar charts)?
- Are scales consistent across comparison charts?
- Do chart titles accurately describe what's shown?
- Could the visualization mislead a quick reader?
- Are there truncated axes, inconsistent intervals, or 3D effects that distort perception?
若分析包含图表:
- 坐标轴起始值是否合适(柱状图应从0开始)?
- 对比图表的刻度是否一致?
- 图表标题是否准确描述了展示内容?
- 可视化内容是否会误导快速浏览的读者?
- 是否存在截断坐标轴、不一致间隔或扭曲认知的3D效果?
6. Evaluate Narrative and Conclusions
6. 评估叙事与结论
Review whether:
- Conclusions are supported by the data shown
- Alternative explanations are acknowledged
- Uncertainty is communicated appropriately
- Recommendations follow logically from findings
- The level of confidence matches the strength of evidence
审核以下要点:
- 结论是否有展示的数据支撑?
- 是否提及了其他可能的解释?
- 不确定性是否得到了恰当传达?
- 建议是否从研究发现中合理推导而来?
- 可信度是否与证据强度匹配?
7. Suggest Improvements
7. 提出改进建议
Provide specific, actionable suggestions:
- Additional analyses that would strengthen the conclusions
- Caveats or limitations that should be noted
- Better visualizations or framings for key points
- Missing context that stakeholders would want
提供具体、可执行的建议:
- 可强化结论的额外分析方向
- 需要标注的警告或局限性
- 针对关键点的更优可视化方式或框架
- 利益相关者需要的缺失背景信息
8. Generate Confidence Assessment
8. 生成可信度评估
Rate the analysis on a 3-level scale:
Ready to share -- Analysis is methodologically sound, calculations verified, caveats noted. Minor suggestions for improvement but nothing blocking.
Share with noted caveats -- Analysis is largely correct but has specific limitations or assumptions that must be communicated to stakeholders. List the required caveats.
Needs revision -- Found specific errors, methodological issues, or missing analyses that should be addressed before sharing. List the required changes with priority order.
按照三级标准对分析内容进行评级:
可直接分享——分析方法论严谨,计算已验证,局限性已标注。仅存在次要改进建议,无阻碍性问题。
需标注警告后分享——分析内容大体正确,但存在特定局限性或假设,必须向利益相关者传达。列出需要标注的警告内容。
需修订——发现了具体错误、方法论问题或缺失的分析内容,应在分享前解决。按优先级列出所需修改内容。
Output Format
输出格式
undefinedundefinedValidation Report
验证报告
Overall Assessment: [Ready to share | Share with caveats | Needs revision]
整体评估: [可直接分享 | 需标注警告后分享 | 需修订]
Methodology Review
方法论审核
[Findings about approach, data selection, definitions]
[关于方法、数据选择、定义的检查结果]
Issues Found
发现的问题
- [Severity: High/Medium/Low] [Issue description and impact]
- ...
- [严重程度: 高/中/低] [问题描述及影响]
- ...
Calculation Spot-Checks
计算抽查
- [Metric]: [Verified / Discrepancy found]
- ...
- [指标]: [已验证 / 发现差异]
- ...
Visualization Review
可视化审核
[Any issues with charts or visual presentation]
[图表或可视化呈现的相关问题]
Suggested Improvements
建议改进方向
- [Improvement and why it matters]
- ...
- [改进内容及重要性]
- ...
Required Caveats for Stakeholders
需向利益相关者传达的警告
- [Caveat that must be communicated]
- ...
---- [必须传达的警告内容]
- ...
---Pre-Delivery QA Checklist
交付前质量验证清单
Run through this checklist before sharing any analysis with stakeholders.
在向利益相关者分享任何分析内容前,完成以下清单检查。
Data Quality Checks
数据质量检查
- Source verification: Confirmed which tables/data sources were used. Are they the right ones for this question?
- Freshness: Data is current enough for the analysis. Noted the "as of" date.
- Completeness: No unexpected gaps in time series or missing segments.
- Null handling: Checked null rates in key columns. Nulls are handled appropriately (excluded, imputed, or flagged).
- Deduplication: Confirmed no double-counting from bad joins or duplicate source records.
- Filter verification: All WHERE clauses and filters are correct. No unintended exclusions.
- 来源验证: 确认使用的表格/数据源。它们是否适用于当前问题?
- 时效性: 数据的时效性满足分析需求。已标注“数据截至”日期。
- 完整性: 时间序列无意外缺口,无缺失分段。
- 空值处理: 检查关键列的空值率。空值已得到恰当处理(排除、填充或标记)。
- 去重: 确认不存在因错误连接或源数据重复导致的重复计数。
- 过滤器验证: 所有WHERE子句和过滤器均正确。无意外排除项。
Calculation Checks
计算检查
- Aggregation logic: GROUP BY includes all non-aggregated columns. Aggregation level matches the analysis grain.
- Denominator correctness: Rate and percentage calculations use the right denominator. Denominators are non-zero.
- Date alignment: Comparisons use the same time period length. Partial periods are excluded or noted.
- Join correctness: JOIN types are appropriate (INNER vs LEFT). Many-to-many joins haven't inflated counts.
- Metric definitions: Metrics match how stakeholders define them. Any deviations are noted.
- Subtotals sum: Parts add up to the whole where expected. If they don't, explain why (e.g., overlap).
- 聚合逻辑: GROUP BY包含所有非聚合列。聚合级别与分析粒度匹配。
- 分母正确性: 比率和百分比计算使用了正确的分母。分母不为零。
- 日期对齐: 对比使用了相同长度的时间段。部分时间段已被排除或标注。
- 连接正确性: JOIN类型恰当(INNER vs LEFT)。多对多连接未导致计数膨胀。
- 指标定义: 指标与利益相关者的定义匹配。任何偏差已被标注。
- 小计求和: 各部分在预期情况下应等于整体。若不相等,已解释原因(如重叠)。
Reasonableness Checks
合理性检查
- Magnitude: Numbers are in a plausible range. Revenue isn't negative. Percentages are between 0-100%.
- Trend continuity: No unexplained jumps or drops in time series.
- Cross-reference: Key numbers match other known sources (dashboards, previous reports, finance data).
- Order of magnitude: Total revenue is in the right ballpark. User counts match known figures.
- Edge cases: What happens at the boundaries? Empty segments, zero-activity periods, new entities.
- 量级: 数值处于合理范围。收入不为负数。百分比在0-100%之间。
- 趋势连续性: 时间序列无无法解释的骤升或骤降。
- 交叉参考: 关键数值与其他已知来源(仪表盘、往期报告、财务数据)匹配。
- 数量级: 总收入处于合理量级。用户数与已知数据匹配。
- 边缘情况: 边界场景下的表现如何?空分段、零活动时间段、新实体。
Presentation Checks
呈现方式检查
- Chart accuracy: Bar charts start at zero. Axes are labeled. Scales are consistent across panels.
- Number formatting: Appropriate precision. Consistent currency/percentage formatting. Thousands separators where needed.
- Title clarity: Titles state the insight, not just the metric. Date ranges are specified.
- Caveat transparency: Known limitations and assumptions are stated explicitly.
- Reproducibility: Someone else could recreate this analysis from the documentation provided.
- 图表准确性: 柱状图从0开始。坐标轴已标注。多面板图表刻度一致。
- 数值格式: 精度恰当。货币/百分比格式一致。按需使用千位分隔符。
- 标题清晰度: 标题阐述了洞察,而非仅列出指标。已指定时间范围。
- 警告透明度: 已知局限性和假设已明确说明。
- 可复现性: 他人可根据提供的文档重现该分析。
Common Data Analysis Pitfalls
常见数据分析陷阱
Join Explosion
连接膨胀
The problem: A many-to-many join silently multiplies rows, inflating counts and sums.
How to detect:
sql
-- Check row count before and after join
SELECT COUNT(*) FROM table_a; -- 1,000
SELECT COUNT(*) FROM table_a a JOIN table_b b ON a.id = b.a_id; -- 3,500 (uh oh)How to prevent:
- Always check row counts after joins
- If counts increase, investigate the join relationship (is it really 1:1 or 1:many?)
- Use instead of
COUNT(DISTINCT a.id)when counting entities through joinsCOUNT(*)
问题: 多对多连接会暗中增加行数,导致计数和求和膨胀。
检测方法:
sql
-- 检查连接前后的行数
SELECT COUNT(*) FROM table_a; -- 1,000
SELECT COUNT(*) FROM table_a a JOIN table_b b ON a.id = b.a_id; -- 3,500 (有问题)预防方法:
- 连接后始终检查行数
- 若行数增加,调查连接关系(是否真的是1:1或1:多?)
- 通过连接计数实体时,使用而非
COUNT(DISTINCT a.id)COUNT(*)
Survivorship Bias
生存者偏差
The problem: Analyzing only entities that exist today, ignoring those that were deleted, churned, or failed.
Examples:
- Analyzing user behavior of "current users" misses churned users
- Looking at "companies using our product" ignores those who evaluated and left
- Studying properties of "successful" outcomes without "unsuccessful" ones
How to prevent: Ask "who is NOT in this dataset?" before drawing conclusions.
问题: 仅分析当前存在的实体,忽略已删除、流失或失败的实体。
示例:
- 分析“当前用户”的行为会遗漏流失用户
- 查看“使用我们产品的公司”会忽略那些评估后离开的公司
- 仅研究“成功”结果的属性,未考虑“不成功”结果
预防方法: 得出结论前先问“哪些实体不在这个数据集中?”
Incomplete Period Comparison
不完整周期对比
The problem: Comparing a partial period to a full period.
Examples:
- "January revenue is $500K vs. December's $800K" -- but January isn't over yet
- "This week's signups are down" -- checked on Wednesday, comparing to a full prior week
How to prevent: Always filter to complete periods, or compare same-day-of-month / same-number-of-days.
问题: 将部分时间段与完整时间段进行对比。
示例:
- “1月收入为50万美元,12月为80万美元”——但1月尚未结束
- “本周注册量下降”——在周三进行检查,与完整的上周对比
预防方法: 始终筛选完整时间段,或对比同月同日/相同天数的时间段。
Denominator Shifting
分母偏移
The problem: The denominator changes between periods, making rates incomparable.
Examples:
- Conversion rate improves because you changed how you count "eligible" users
- Churn rate changes because the definition of "active" was updated
How to prevent: Use consistent definitions across all compared periods. Note any definition changes.
问题: 不同时间段的分母发生变化,导致比率不具备可比性。
示例:
- 转化率提升是因为你更改了“符合条件”用户的计数方式
- 流失率变化是因为“活跃”的定义被更新
预防方法: 在所有对比时间段使用一致的定义。标注任何定义变更。
Average of Averages
平均值的平均值
The problem: Averaging pre-computed averages gives wrong results when group sizes differ.
Example:
- Group A: 100 users, average revenue $50
- Group B: 10 users, average revenue $200
- Wrong: Average of averages = ($50 + $200) / 2 = $125
- Right: Weighted average = (100*$50 + 10*$200) / 110 = $63.64
How to prevent: Always aggregate from raw data. Never average pre-aggregated averages.
问题: 对预先计算的平均值再次取平均,在群组规模不同时会得到错误结果。
示例:
- A组: 100名用户,平均收入50美元
- B组: 10名用户,平均收入200美元
- 错误计算: 平均值的平均值 = ($50 + $200) / 2 = $125
- 正确计算: 加权平均值 = (100*$50 + 10*$200) / 110 = $63.64
预防方法: 始终从原始数据进行聚合。切勿对预先聚合的平均值再次取平均。
Timezone Mismatches
时区不匹配
The problem: Different data sources use different timezones, causing misalignment.
Examples:
- Event timestamps in UTC vs. user-facing dates in local time
- Daily rollups that use different cutoff times
How to prevent: Standardize all timestamps to a single timezone (UTC recommended) before analysis. Document the timezone used.
问题: 不同数据源使用不同时区,导致数据错位。
示例:
- 事件时间戳为UTC,而用户可见日期为本地时间
- 每日汇总使用不同的截止时间
预防方法: 分析前将所有时间戳标准化为单个时区(推荐UTC)。记录使用的时区。
Selection Bias in Segmentation
细分中的选择偏差
The problem: Segments are defined by the outcome you're measuring, creating circular logic.
Examples:
- "Users who completed onboarding have higher retention" -- obviously, they self-selected
- "Power users generate more revenue" -- they became power users BY generating revenue
How to prevent: Define segments based on pre-treatment characteristics, not outcomes.
问题: 群组由你要衡量的结果定义,形成循环逻辑。
示例:
- “完成入门引导的用户留存率更高”——显然,他们是自我选择的
- “核心用户产生更多收入”——他们正是因为产生更多收入才成为核心用户
预防方法: 根据预处理特征定义群组,而非结果。
Other Statistical Traps
其他统计陷阱
- Simpson's paradox: Trend reverses when data is aggregated vs. segmented
- Correlation presented as causation without supporting evidence
- Small sample sizes leading to unreliable conclusions
- Outliers disproportionately affecting averages (should medians be used instead?)
- Multiple testing / cherry-picking significant results
- Look-ahead bias: Using future information to explain past events
- Cherry-picked time ranges that favor a particular narrative
- 辛普森悖论: 聚合数据与细分数据的趋势相反
- 无证据将相关性表述为因果关系
- 样本量过小导致结论不可靠
- 异常值对平均值影响过大(是否应使用中位数?)
- 多重检验/选择性呈现显著结果
- 前瞻偏差: 使用未来信息解释过去事件
- 选择性选择时间范围以支持特定叙事
Result Sanity Checking
结果合理性检查
Magnitude Checks
量级检查
For any key number in your analysis, verify it passes the "smell test":
| Metric Type | Sanity Check |
|---|---|
| User counts | Does this match known MAU/DAU figures? |
| Revenue | Is this in the right order of magnitude vs. known ARR? |
| Conversion rates | Is this between 0% and 100%? Does it match dashboard figures? |
| Growth rates | Is 50%+ MoM growth realistic, or is there a data issue? |
| Averages | Is the average reasonable given what you know about the distribution? |
| Percentages | Do segment percentages sum to ~100%? |
对于分析中的任何关键数值,验证其通过“合理性测试”:
| 指标类型 | 合理性检查 |
|---|---|
| 用户数 | 是否与已知的MAU/DAU数据匹配? |
| 收入 | 与已知的ARR相比,量级是否正确? |
| 转化率 | 是否在0%-100%之间?是否与仪表盘数据匹配? |
| 增长率 | 月环比增长50%+是否合理,还是存在数据问题? |
| 平均值 | 结合已知的分布情况,平均值是否合理? |
| 百分比 | 细分百分比总和是否约为100%? |
Cross-Validation Techniques
交叉验证技巧
- Calculate the same metric two different ways and verify they match
- Spot-check individual records -- pick a few specific entities and trace their data manually
- Compare to known benchmarks -- match against published dashboards, finance reports, or prior analyses
- Reverse engineer -- if total revenue is X, does per-user revenue times user count approximately equal X?
- Boundary checks -- what happens when you filter to a single day, a single user, or a single category? Are those micro-results sensible?
- 用两种不同方法计算同一指标并验证结果匹配
- 抽查单个记录——挑选几个特定实体,手动追踪其数据
- 与已知基准对比——匹配已发布的仪表盘、财务报告或往期分析
- 反向推导——若总收入为X,那么人均收入乘以用户数是否大致等于X?
- 边界检查——筛选至单日、单个用户或单个分类时,结果是否合理?
Red Flags That Warrant Investigation
需要调查的红标信号
- Any metric that changed by more than 50% period-over-period without an obvious cause
- Counts or sums that are exact round numbers (suggests a filter or default value issue)
- Rates exactly at 0% or 100% (may indicate incomplete data)
- Results that perfectly confirm the hypothesis (reality is usually messier)
- Identical values across time periods or segments (suggests the query is ignoring a dimension)
- 任何指标环比变化超过50%且无明显原因
- 计数或求和为精确的整数(暗示过滤器或默认值存在问题)
- 比率恰好为0%或100%(可能表明数据不完整)
- 结果完美验证了假设(现实通常更复杂)
- 不同时间段或群组的数值完全相同(暗示查询忽略了维度)
Documentation Standards for Reproducibility
可复现性文档标准
Analysis Documentation Template
分析文档模板
Every non-trivial analysis should include:
markdown
undefined所有非简单分析均应包含:
markdown
undefinedAnalysis: [Title]
分析: [标题]
Question
问题
[The specific question being answered]
[要回答的具体问题]
Data Sources
数据源
- Table: [schema.table_name] (as of [date])
- Table: [schema.other_table] (as of [date])
- File: [filename] (source: [where it came from])
- 表格: [schema.table_name](数据截至 [日期])
- 表格: [schema.other_table](数据截至 [日期])
- 文件: [文件名](来源: [获取渠道])
Definitions
定义
- [Metric A]: [Exactly how it's calculated]
- [Segment X]: [Exactly how membership is determined]
- [Time period]: [Start date] to [end date], [timezone]
- [时间段]: [开始日期] 至 [结束日期], [时区]
Methodology
方法论
- [Step 1 of the analysis approach]
- [Step 2]
- [Step 3]
- [分析步骤1]
- [步骤2]
- [步骤3]
Assumptions and Limitations
假设与局限性
- [Assumption 1 and why it's reasonable]
- [Limitation 1 and its potential impact on conclusions]
- [假设1及合理性说明]
- [局限性1及其对结论的潜在影响]
Key Findings
关键发现
- [Finding 1 with supporting evidence]
- [Finding 2 with supporting evidence]
- [发现1及支撑证据]
- [发现2及支撑证据]
SQL Queries
SQL查询
[All queries used, with comments]
[所用所有查询及注释]
Caveats
警告
- [Things the reader should know before acting on this]
undefined- [读者在据此采取行动前需了解的信息]
undefinedCode Documentation
代码文档
For any code (SQL, Python) that may be reused:
python
"""
Analysis: Monthly Cohort Retention
Author: [Name]
Date: [Date]
Data Source: events table, users table
Last Validated: [Date] -- results matched dashboard within 2%
Purpose:
Calculate monthly user retention cohorts based on first activity date.
Assumptions:
- "Active" means at least one event in the month
- Excludes test/internal accounts (user_type != 'internal')
- Uses UTC dates throughout
Output:
Cohort retention matrix with cohort_month rows and months_since_signup columns.
Values are retention rates (0-100%).
"""对于任何可复用的代码(SQL、Python):
python
"""
Analysis: Monthly Cohort Retention
Author: [姓名]
Date: [日期]
Data Source: events table, users table
Last Validated: [日期] -- 结果与仪表盘数据偏差在2%以内
Purpose:
根据首次活动日期计算月度用户留存群组。
Assumptions:
- “活跃”指当月至少有一次活动
- 排除测试/内部账户(user_type != 'internal')
- 全程使用UTC日期
Output:
包含cohort_month行和months_since_signup列的群组留存矩阵。
数值为留存率(0-100%)。
"""Version Control for Analyses
分析内容的版本控制
- Save queries and code in version control (git) or a shared docs system
- Note the date of the data snapshot used
- If an analysis is re-run with updated data, document what changed and why
- Link to prior versions of recurring analyses for trend comparison
- 将查询和代码保存到版本控制系统(git)或共享文档系统
- 记录使用的数据快照日期
- 若使用更新数据重新运行分析,记录变更内容及原因
- 链接至 recurring分析的往期版本,以便趋势对比
Examples
示例
/validate-data Review this quarterly revenue analysis before I send it to the exec team: [analysis]/validate-data Check my churn analysis -- I'm comparing Q4 churn rates to Q3 but Q4 has a shorter measurement window/validate-data Here's a SQL query and its results for our conversion funnel. Does the logic look right? [query + results]/validate-data 在我将这份季度收入分析发送给高管团队前帮我审核:[分析内容]/validate-data 检查我的流失分析——我在对比Q4和Q3的流失率,但Q4的测量窗口更短/validate-data 这是我们转化漏斗的SQL查询及结果。逻辑是否正确?[查询 + 结果]Tips
提示
- Run /validate-data before any high-stakes presentation or decision
- Even quick analyses benefit from a sanity check -- it takes a minute and can save your credibility
- If the validation finds issues, fix them and re-validate
- Share the validation output alongside your analysis to build stakeholder confidence
- 在任何高风险演示或决策前运行/validate-data
- 即使是快速分析也能从合理性检查中受益——只需一分钟,却能维护你的可信度
- 若验证发现问题,修复后重新验证
- 将验证输出与分析内容一同分享,以提升利益相关者的信任