Statistical Analysis Advisor
Intelligent statistical test recommendation engine that guides users through selecting the right statistical methods for their data.
Capabilities
Statistical Test Selection
- Compares and recommends between T-test, ANOVA, Chi-square, Mann-Whitney, Kruskal-Wallis, etc.
- Considers data type, distribution, sample size, and research question
- Provides decision tree logic for test selection
Assumption Checking
- Normality tests (Shapiro-Wilk, Kolmogorov-Smirnov)
- Homogeneity of variance (Levene's test, Bartlett's test)
- Independence verification
- Outlier detection guidance
Power Analysis & Sample Size
- Effect size estimation (Cohen's d, eta-squared, Cramér's V)
- Sample size calculations for desired power
- Post-hoc power analysis
Usage
from scripts.main import StatisticalAdvisor
advisor = StatisticalAdvisor()
# Get test recommendation
recommendation = advisor.recommend_test(
data_type="continuous",
groups=2,
independent=True,
distribution="normal"
)
# Check assumptions
assumptions = advisor.check_assumptions(
data=[group1, group2],
test_type="independent_ttest"
)
# Power analysis
power = advisor.calculate_power(
effect_size=0.5,
alpha=0.05,
sample_size=30
)
Input Parameters
| Parameter |
Type |
Description |
| data_type |
str |
"continuous", "categorical", "ordinal" |
| groups |
int |
Number of groups/comparison levels |
| independent |
bool |
Independent or paired/related samples |
| distribution |
str |
"normal", "non-normal", "unknown" |
| sample_size |
int |
Current or planned sample size |
Technical Difficulty: High ⚠️
Warning: Statistical recommendations have significant implications for research validity. This skill requires human verification of all recommendations before application in published research.
References
- See
references/statistical_tests_guide.md for detailed test selection criteria
- See
references/assumption_tests.md for assumption checking procedures
- See
references/power_analysis_guide.md for power calculation methods
Limitations
- Does not perform actual data analysis (recommendations only)
- Cannot access raw data directly
- Complex multivariate designs may require specialized consultation
- Bayesian alternatives not covered comprehensively
Risk Assessment
| Risk Indicator |
Assessment |
Level |
| Code Execution |
Python/R scripts executed locally |
Medium |
| Network Access |
No external API calls |
Low |
| File System Access |
Read input files, write output files |
Medium |
| Instruction Tampering |
Standard prompt guidelines |
Low |
| Data Exposure |
Output files saved to workspace |
Low |
Security Checklist
Prerequisites
# Python dependencies
pip install -r requirements.txt
Evaluation Criteria
Success Metrics
Test Cases
- Basic Functionality: Standard input → Expected output
- Edge Case: Invalid input → Graceful error handling
- Performance: Large dataset → Acceptable processing time
Lifecycle Status
- Current Stage: Draft
- Next Review Date: 2026-03-06
- Known Issues: None
- Planned Improvements:
- Performance optimization
- Additional feature support
1---2name: statistical-analysis-advisor3description: Recommends appropriate statistical methods (T-test vs ANOVA, etc.) based on dataset characteristics, performs assumption checking, and provides power analysis guidance. Trigger when user asks about choosing statistical tests, checking statistical assumptions, or needs guidance on experimental design and sample size calculations.4license: MIT5---6
7# Statistical Analysis Advisor
8
9Intelligent statistical test recommendation engine that guides users through selecting the right statistical methods for their data.
10
11## Capabilities
12
131. **Statistical Test Selection**
14 - Compares and recommends between T-test, ANOVA, Chi-square, Mann-Whitney, Kruskal-Wallis, etc.
15 - Considers data type, distribution, sample size, and research question
16 - Provides decision tree logic for test selection
17
182. **Assumption Checking**
19 - Normality tests (Shapiro-Wilk, Kolmogorov-Smirnov)
20 - Homogeneity of variance (Levene's test, Bartlett's test)
21 - Independence verification
22 - Outlier detection guidance
23
243. **Power Analysis & Sample Size**
25 - Effect size estimation (Cohen's d, eta-squared, Cramér's V)
26 - Sample size calculations for desired power
27 - Post-hoc power analysis
28
29## Usage
30
31```python
32from scripts.main import StatisticalAdvisor
33
34advisor = StatisticalAdvisor()
35
36# Get test recommendation
37recommendation = advisor.recommend_test(
38 data_type="continuous",
39 groups=2,
40 independent=True,
41 distribution="normal"
42)
43
44# Check assumptions
45assumptions = advisor.check_assumptions(
46 data=[group1, group2],
47 test_type="independent_ttest"
48)
49
50# Power analysis
51power = advisor.calculate_power(
52 effect_size=0.5,
53 alpha=0.05,
54 sample_size=30
55)
56```
57
58## Input Parameters
59
60| Parameter | Type | Description |
61|-----------|------|-------------|
62| data_type | str | "continuous", "categorical", "ordinal" |
63| groups | int | Number of groups/comparison levels |
64| independent | bool | Independent or paired/related samples |
65| distribution | str | "normal", "non-normal", "unknown" |
66| sample_size | int | Current or planned sample size |
67
68## Technical Difficulty: High ⚠️
69
70**Warning**: Statistical recommendations have significant implications for research validity. This skill requires human verification of all recommendations before application in published research.
71
72## References
73
74- See `references/statistical_tests_guide.md` for detailed test selection criteria
75- See `references/assumption_tests.md` for assumption checking procedures
76- See `references/power_analysis_guide.md` for power calculation methods
77
78## Limitations
79
80- Does not perform actual data analysis (recommendations only)
81- Cannot access raw data directly
82- Complex multivariate designs may require specialized consultation
83- Bayesian alternatives not covered comprehensively
84
85## Risk Assessment
86
87| Risk Indicator | Assessment | Level |
88|----------------|------------|-------|
89| Code Execution | Python/R scripts executed locally | Medium |
90| Network Access | No external API calls | Low |
91| File System Access | Read input files, write output files | Medium |
92| Instruction Tampering | Standard prompt guidelines | Low |
93| Data Exposure | Output files saved to workspace | Low |
94
95## Security Checklist
96
97- [ ] No hardcoded credentials or API keys
98- [ ] No unauthorized file system access (../)
99- [ ] Output does not expose sensitive information
100- [ ] Prompt injection protections in place
101- [ ] Input file paths validated (no ../ traversal)
102- [ ] Output directory restricted to workspace
103- [ ] Script execution in sandboxed environment
104- [ ] Error messages sanitized (no stack traces exposed)
105- [ ] Dependencies audited
106## Prerequisites
107
108```bash
109# Python dependencies
110pip install -r requirements.txt
111```
112
113## Evaluation Criteria
114
115### Success Metrics
116- [ ] Successfully executes main functionality
117- [ ] Output meets quality standards
118- [ ] Handles edge cases gracefully
119- [ ] Performance is acceptable
120
121### Test Cases
1221. **Basic Functionality**: Standard input → Expected output
1232. **Edge Case**: Invalid input → Graceful error handling
1243. **Performance**: Large dataset → Acceptable processing time
125
126## Lifecycle Status
127
128- **Current Stage**: Draft
129- **Next Review Date**: 2026-03-06
130- **Known Issues**: None
131- **Planned Improvements**:
132 - Performance optimization
133 - Additional feature support