Statistical Analysis
AnthropicOfficialPublished by Anthropic
- Skill
- Guidelines
- Data and AI
- Apache-2.0
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured framework for performing statistical analysis, emphasizing practical application over theoretical complexity. It covers descriptive statistics, trend analysis, outlier detection, and hypothesis testing, while offering critical guidance on interpreting results and avoiding common statistical pitfalls like correlation-causation fallacies and Simpson's Paradox. It is designed to help analysts communicate data insights with appropriate nuance and rigor.
What it does
- Provides methodologies for descriptive statistics, including central tendency and variability measures.
- Offers techniques for trend analysis, seasonality detection, and simple forecasting.
- Outlines statistical approaches for identifying and handling outliers and anomalies.
- Explains the framework for hypothesis testing, including common tests and significance interpretation.
- Highlights common statistical traps such as survivorship bias and the multiple comparisons problem.
- Advises on how to communicate uncertainty and practical significance to stakeholders.
When to use it
- When analyzing data distributions to determine the best metrics for reporting.
- When identifying trends or seasonal patterns in time-series data.
- When evaluating whether observed differences in A/B tests are statistically significant.
- When cleaning datasets and deciding how to treat extreme values or anomalies.
- When interpreting business metrics to ensure claims are supported by evidence.
Advantages
- Promotes rigorous data interpretation by balancing statistical and practical significance.
- Encourages transparent reporting by recommending ranges instead of false precision.
- Provides clear guidance on choosing the right statistical tests for different data types.
- Helps prevent common analytical errors through awareness of cognitive and statistical biases.
Usage examples
- “How should I report the average revenue per user if my data is highly skewed?”
- The skill advises reporting both the mean and the median, noting that the gap between them illustrates the skew, and suggests using the median as a robust measure of the typical user.
- “Is my A/B test result statistically significant?”
- The skill provides a framework to define null and alternative hypotheses, choose a significance level, select the appropriate test (e.g., t-test or z-test), and evaluate both statistical and practical significance.
- “How do I handle outliers in my dataset?”
- The skill recommends investigating the cause of outliers (errors vs. genuine extremes) and suggests using robust statistics like the IQR method or segmenting the data rather than automatically deleting records.
- “What is the best way to forecast next month's signups?”
- The skill suggests using simple methods like seasonal naive or moving averages as a baseline, while emphasizing the importance of providing a range of outcomes rather than a single point estimate.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/anthropics/statistical-analysis/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip statistical-analysis.zip -d .agents/skills
Documentation by Anthropic
Statistical Analysis Skill
Descriptive statistics, trend analysis, outlier detection, hypothesis testing, and guidance on when to be cautious about statistical claims.
Descriptive Statistics Methodology
Central Tendency
Choose the right measure of center based on the data:
| Situation | Use | Why |
|---|---|---|
| Symmetric distribution, no outliers | Mean | Most efficient estimator |
| Skewed distribution | Median | Robust to outliers |
| Categorical or ordinal data | Mode | Only option for non-numeric |
| Highly skewed with outliers (e.g., revenue per user) | Median + mean | Report both; the gap shows skew |
Always report mean and median together for business metrics. If they diverge significantly, the data is skewed and the mean alone is misleading.
Spread and Variability
Standard deviation: How far values typically fall from the mean. Use with normally distributed data.
Interquartile range (IQR): Distance from p25 to p75. Robust to outliers. Use with skewed data.
Coefficient of variation (CV): StdDev / Mean. Use to compare variability across metrics with different scales.
Range: Max minus min. Sensitive to outliers but gives a quick sense of data extent.
Percentiles for Business Context
Report key percentiles to tell a richer story than mean alone:
p1: Bottom 1% (floor / minimum typical value)
p5: Low end of normal range
p25: First quartile
p50: Median (typical user)
p75: Third quartile
p90: Top 10% / power users
p95: High end of normal range
p99: Top 1% / extreme usersExample narrative: "The median session duration is 4.2 minutes, but the top 10% of users spend over 22 minutes per session, pulling the mean up to 7.8 minutes."
Describing Distributions
Characterize every numeric distribution you analyze:
Shape: Normal, right-skewed, left-skewed, bimodal, uniform, heavy-tailed
Center: Mean and median (and the gap between them)
Spread: Standard deviation or IQR
Outliers: How many and how extreme
Bounds: Is there a natural floor (zero) or ceiling (100%)?
Trend Analysis and Forecasting
Identifying Trends
Moving averages to smooth noise:
# 7-day moving average (good for daily data with weekly seasonality)
df['ma_7d'] = df['metric'].rolling(window=7, min_periods=1).mean()
# 28-day moving average (smooths weekly AND monthly patterns)
df['ma_28d'] = df['metric'].rolling(window=28, min_periods=1).mean()Period-over-period comparison:
Week-over-week (WoW): Compare to same day last week
Month-over-month (MoM): Compare to same month prior
Year-over-year (YoY): Gold standard for seasonal businesses
Same-day-last-year: Compare specific calendar day
Growth rates:
Simple growth: (current - previous) / previous
CAGR: (ending / beginning) ^ (1 / years) - 1
Log growth: ln(current / previous) -- better for volatile seriesSeasonality Detection
Check for periodic patterns:
Plot the raw time series -- visual inspection first
Compute day-of-week averages: is there a clear weekly pattern?
Compute month-of-year averages: is there an annual cycle?
When comparing periods, always use YoY or same-period comparisons to avoid conflating trend with seasonality
Forecasting (Simple Methods)
For business analysts (not data scientists), use straightforward methods:
Naive forecast: Tomorrow = today. Use as a baseline.
Seasonal naive: Tomorrow = same day last week/year.
Linear trend: Fit a line to historical data. Only for clearly linear trends.
Moving average forecast: Use trailing average as the forecast.
Always communicate uncertainty. Provide a range, not a point estimate:
"We expect 10K-12K signups next month based on the 3-month trend"
NOT "We will get exactly 11,234 signups next month"
When to escalate to a data scientist: Non-linear trends, multiple seasonalities, external factors (marketing spend, holidays), or when forecast accuracy matters for resource allocation.
Outlier and Anomaly Detection
Statistical Methods
Z-score method (for normally distributed data):
z_scores = (df['value'] - df['value'].mean()) / df['value'].std()
outliers = df[abs(z_scores) > 3] # More than 3 standard deviationsIQR method (robust to non-normal distributions):
Q1 = df['value'].quantile(0.25)
Q3 = df['value'].quantile(0.75)
IQR = Q3 - Q1
lower_bound = Q1 - 1.5 * IQR
upper_bound = Q3 + 1.5 * IQR
outliers = df[(df['value'] < lower_bound) | (df['value'] > upper_bound)]Percentile method (simplest):
outliers = df[(df['value'] < df['value'].quantile(0.01)) |
(df['value'] > df['value'].quantile(0.99))]Handling Outliers
Do NOT automatically remove outliers. Instead:
Investigate: Is this a data error, a genuine extreme value, or a different population?
Data errors: Fix or remove (e.g., negative ages, timestamps in year 1970)
Genuine extremes: Keep them but consider using robust statistics (median instead of mean)
Different population: Segment them out for separate analysis (e.g., enterprise vs. SMB customers)
Report what you did: "We excluded 47 records (0.3%) with transaction amounts >$50K, which represent bulk enterprise orders analyzed separately."
Time Series Anomaly Detection
For detecting unusual values in a time series:
Compute expected value (moving average or same-period-last-year)
Compute deviation from expected
Flag deviations beyond a threshold (typically 2-3 standard deviations of the residuals)
Distinguish between point anomalies (single unusual value) and change points (sustained shift)
Hypothesis Testing Basics
When to Use
Use hypothesis testing when you need to determine whether an observed difference is likely real or could be due to random chance. Common scenarios:
A/B test results: Is variant B actually better than A?
Before/after comparison: Did the product change actually move the metric?
Segment comparison: Do enterprise customers really have higher retention?
The Framework
Null hypothesis (H0): There is no difference (the default assumption)
Alternative hypothesis (H1): There is a difference
Choose significance level (alpha): Typically 0.05 (5% chance of false positive)
Compute test statistic and p-value
Interpret: If p < alpha, reject H0 (evidence of a real difference)
Common Tests
| Scenario | Test | When to Use |
|---|---|---|
| Compare two group means | t-test (independent) | Normal data, two groups |
| Compare two group proportions | z-test for proportions | Conversion rates, binary outcomes |
| Compare paired measurements | Paired t-test | Before/after on same entities |
| Compare 3+ group means | ANOVA | Multiple segments or variants |
| Non-normal data, two groups | Mann-Whitney U test | Skewed metrics, ordinal data |
| Association between categories | Chi-squared test | Two categorical variables |
Practical Significance vs. Statistical Significance
Statistical significance means the difference is unlikely due to chance.
Practical significance means the difference is large enough to matter for business decisions.
A difference can be statistically significant but practically meaningless (common with large samples). Always report:
Effect size: How big is the difference? (e.g., "Variant B improved conversion by 0.3 percentage points")
Confidence interval: What's the range of plausible true effects?
Business impact: What does this translate to in revenue, users, or other business terms?
Sample Size Considerations
Small samples produce unreliable results, even with significant p-values
Rule of thumb for proportions: Need at least 30 events per group for basic reliability
For detecting small effects (e.g., 1% conversion rate change), you may need thousands of observations per group
If your sample is small, say so: "With only 200 observations per group, we have limited power to detect effects smaller than X%"
When to Be Cautious About Statistical Claims
Correlation Is Not Causation
When you find a correlation, explicitly consider:
Reverse causation: Maybe B causes A, not A causes B
Confounding variables: Maybe C causes both A and B
Coincidence: With enough variables, spurious correlations are inevitable
What you can say: "Users who use feature X have 30% higher retention" What you cannot say without more evidence: "Feature X causes 30% higher retention"
Multiple Comparisons Problem
When you test many hypotheses, some will be "significant" by chance:
Testing 20 metrics at p=0.05 means ~1 will be falsely significant
If you looked at many segments before finding one that's different, note that
Adjust for multiple comparisons with Bonferroni correction (divide alpha by number of tests) or report how many tests were run
Simpson's Paradox
A trend in aggregated data can reverse when data is segmented:
Always check whether the conclusion holds across key segments
Example: Overall conversion goes up, but conversion goes down in every segment -- because the mix shifted toward a higher-converting segment
Survivorship Bias
You can only analyze entities that "survived" to be in your dataset:
Analyzing active users ignores those who churned
Analyzing successful companies ignores those that failed
Always ask: "Who is missing from this dataset, and would their inclusion change the conclusion?"
Ecological Fallacy
Aggregate trends may not apply to individuals:
"Countries with higher X have higher Y" does NOT mean "individuals with higher X have higher Y"
Be careful about applying group-level findings to individual cases
Anchoring on Specific Numbers
Be wary of false precision:
"Churn will be 4.73% next quarter" implies more certainty than is warranted
Prefer ranges: "We expect churn between 4-6% based on historical patterns"
Round appropriately: "About 5%" is often more honest than "4.73%"
Files
- ATTRIBUTION.mdAdded by AutoGineer920 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md10.2 KiB
LICENSE
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Requirements and compatibility
Written for: Claude Code, Claude apps
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Claude Code frontmatter, Needs Python
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Anthropic
- Publisher
- Anthropic (Official)
- Source
- anthropics/knowledge-work-plugins · data/skills/statistical-analysis · commit e050c2e
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from data/LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Anthropic or Anthropic.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download statistical-analysis.zip