Data Analysis Skill
Analyze data, create visualizations, and generate actionable insights.
When to Use
Use this skill when the user wants to:
- Analyze data from datasets
- Create data visualizations
- Perform statistical analysis
- Clean and transform data
- Generate data reports
- Find patterns and trends
Data Analysis Workflow
1. Data Understanding
- Examine data structure and content (schema, types, distributions).
- Identify relationships between variables (correlation, causation).
- Understand the context of the data collection process.
2. Data Cleaning & Preprocessing
- Handling Missing Values: Imputation (mean/median), deletion, or flagging.
- Removing Duplicates: Identifying and merging duplicate records.
- Standardizing Formats: Ensuring consistent date formats, units, and categorical values.
- Outlier Detection: Identifying anomalies that might skew analysis.
- Feature Engineering: Creating new variables from existing ones to improve model/analysis quality.
3. Data Exploration (EDA)
- Calculate summary statistics (mean, median, mode, variance, standard deviation).
- Find correlations and dependencies between features.
- Detect patterns, trends, and seasonalities in time-series data.
4. Statistical Analysis
- Descriptive Statistics: Summarizing the main characteristics of a dataset.
- Inferential Statistics: Making predictions or inferences about a population based on a sample (e.g., p-values, confidence intervals).
- Hypothesis Testing: Validating assumptions (e.s. t-tests, chi-square tests).
5. Visualization & Reporting
- Create charts and graphs that tell a story.
- Build interactive dashboards for real-time monitoring.
- Present findings with clear, actionable insights.
Tools & Libraries
Python (The Data Science Standard)
- Pandas: Powerful data manipulation and analysis.
- NumPy: Fundamental package for scientific computing.
- Matplotlib / Seaborn: Static plotting and statistical visualization.
- Plotly: Interactive, web-based visualizations.
- Scikit-learn: Machine learning and predictive modeling.
JavaScript
- D3.js: Low-level, powerful data-driven document manipulation.
- Chart.js / Recharts: Easy-to-use charting libraries for web apps.
- Plotly.js: Interactive plots for the web.
R
- ggplot2: The gold standard for grammar of graphics visualization.
- dplyr / tidyr: Data manipulation and tidying.
Implementation Example (Python/Pandas)
import pandas as pd
# Load data
df = pd.read_csv('sales_data.csv')
# 1. Data Cleaning: Handle missing values and duplicates
df = df.drop_duplicates().fillna({'revenue': 0, 'customer_id': 'Unknown'})
# 2. Feature Engineering: Create a 'profit' column
df['profit'] = df['revenue'] - df['cost']
# 3. Aggregation: Monthly revenue per region
monthly_revenue = df.groupby(['region', 'month'])['revenue'].sum().reset_index()
# 4. Statistical Summary
print(df.describe())
print(f"Correlation between Price and Quantity: {df['price'].corr(df['quantity'])}")
Common Pitfalls
- Correlation vs. Causation: Assuming that because two things happen together, one caused the other.
- Selection Bias: Analyzing data that isn's representative of the whole population.
- Overfitting: Creating models that are too complex and capture noise instead of the underlying signal.
- Ignoring Outliers: Not checking if extreme values are errors or important signals.
- Visualization Misrepresentation: Using truncated axes or inappropriate chart types to mislead the viewer.
Deliverables
- Analysis report with key findings and insights.
- Data visualizations (charts, graphs, dashboards).
- Data cleaning and transformation pipelines.
- Statistical analysis results (p-values, coefficients, etc.).
- Actionable recommendations based on data.
Quality Checklist
1---2name: data-analysis3description: Analyze data, create visualizations, and generate actionable insights. Use when working with data manipulation, statistical analysis, data visualization, or data reporting.4---56# Data Analysis Skill78Analyze data, create visualizations, and generate actionable insights.910## When to Use1112Use this skill when the user wants to:13- Analyze data from datasets14- Create data visualizations15- Perform statistical analysis16- Clean and transform data17- Generate data reports18- Find patterns and trends1920## Data Analysis Workflow2122### 1. Data Understanding23- Examine data structure and content (schema, types, distributions).24- Identify relationships between variables (correlation, causation).25- Understand the context of the data collection process.2627### 2. Data Cleaning & Preprocessing28- **Handling Missing Values**: Imputation (mean/median), deletion, or flagging.29- **Removing Duplicates**: Identifying and merging duplicate records.30- **Standardizing Formats**: Ensuring consistent date formats, units, and categorical values.31- **Outlier Detection**: Identifying anomalies that might skew analysis.32- **Feature Engineering**: Creating new variables from existing ones to improve model/analysis quality.3334### 3. Data Exploration (EDA)35- Calculate summary statistics (mean, median, mode, variance, standard deviation).36- Find correlations and dependencies between features.37- Detect patterns, trends, and seasonalities in time-series data.3839### 4. Statistical Analysis40- **Descriptive Statistics**: Summarizing the main characteristics of a dataset.41- **Inferential Statistics**: Making predictions or inferences about a population based on a sample (e.g., p-values, confidence intervals).42- **Hypothesis Testing**: Validating assumptions (e.s. t-tests, chi-square tests).4344### 5. Visualization & Reporting45- Create charts and graphs that tell a story.46- Build interactive dashboards for real-time monitoring.47- Present findings with clear, actionable insights.4849## Tools & Libraries5051### Python (The Data Science Standard)52- **Pandas**: Powerful data manipulation and analysis.53- **NumPy**: Fundamental package for scientific computing.54- **Matplotlib / Seaborn**: Static plotting and statistical visualization.55- **Plotly**: Interactive, web-based visualizations.56- **Scikit-learn**: Machine learning and predictive modeling.5758### JavaScript59- **D3.js**: Low-level, powerful data-driven document manipulation.60- **Chart.js / Recharts**: Easy-to-use charting libraries for web apps.61- **Plotly.js**: Interactive plots for the web.6263### R64- **ggplot2**: The gold standard for grammar of graphics visualization.65- **dplyr / tidyr**: Data manipulation and tidying.6667## Implementation Example (Python/Pandas)6869```python70import pandas as pd7172# Load data73df = pd.read_csv('sales_data.csv')7475# 1. Data Cleaning: Handle missing values and duplicates76df = df.drop_duplicates().fillna({'revenue': 0, 'customer_id': 'Unknown'})7778# 2. Feature Engineering: Create a 'profit' column79df['profit'] = df['revenue'] - df['cost']8081# 3. Aggregation: Monthly revenue per region82monthly_revenue = df.groupby(['region', 'month'])['revenue'].sum().reset_index()8384# 4. Statistical Summary85print(df.describe())86print(f"Correlation between Price and Quantity: {df['price'].corr(df['quantity'])}")87```8889## Common Pitfalls9091- **Correlation vs. Causation**: Assuming that because two things happen together, one caused the other.92- **Selection Bias**: Analyzing data that isn's representative of the whole population.93- **Overfitting**: Creating models that are too complex and capture noise instead of the underlying signal.94- **Ignoring Outliers**: Not checking if extreme values are errors or important signals.95- **Visualization Misrepresentation**: Using truncated axes or inappropriate chart types to mislead the viewer.9697## Deliverables9899- Analysis report with key findings and insights.100- Data visualizations (charts, graphs, dashboards).101- Data cleaning and transformation pipelines.102- Statistical analysis results (p-values, coefficients, etc.).103- Actionable recommendations based on data.104105## Quality Checklist106107- [ ] Data is properly cleaned and validated.108- [ ] Analysis is statistically sound and avoids common fallacies.109- [ ] Visualizations are clear, accurate, and tell a story.110- [ ] Findings are actionable and directly answer the business question.111- [ ] Code is reproducible and well-documented.