Statistical Analysis Advisor
Intelligent statistical test recommendation engine that guides users through selecting the right statistical methods for their data and research design.
Quick Check
python -m py_compile scripts/main.py
python scripts/main.py
When to Use
- Choosing between parametric and non-parametric tests
- Selecting the right test for 2-group vs multi-group comparisons
- Checking statistical assumptions before analysis
- Power analysis and sample size planning
Usage
from scripts.main import StatisticalAdvisor
advisor = StatisticalAdvisor()
recommendation = advisor.recommend_test(
data_type="continuous",
groups=2,
independent=True,
distribution="normal"
)
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 |
Capabilities
- Test Selection — T-test, ANOVA, Chi-square, Mann-Whitney, Kruskal-Wallis, Fisher's exact, and more
- Assumption Checking — Normality (Shapiro-Wilk, K-S), homogeneity of variance (Levene's, Bartlett's), independence
- Power Analysis — Effect size (Cohen's d, eta-squared, Cramér's V), sample size calculations, post-hoc power
Workflow
- Confirm objective, required inputs, and constraints before proceeding.
- Validate request matches documented scope; stop early if unsupported assumptions are needed.
- Run
scripts/main.py with available inputs, or use the documented reasoning path.
- Return structured result separating assumptions, deliverables, risks, and unresolved items.
- On execution failure or incomplete inputs, switch to fallback path and state exactly what blocked completion.
Fallback Template
If scripts/main.py cannot run (missing inputs, environment error), respond with:
FALLBACK REPORT
───────────────────────────────────────
Objective : <stated goal>
Blocked by : <exact missing input or error>
Partial result : <what can still be assessed manually>
Next step : <minimum action to unblock>
───────────────────────────────────────
Limitations
- Provides recommendations only — does not perform actual data analysis
- Cannot access raw data directly
- Complex multivariate designs may require specialized biostatistician consultation
- Bayesian alternatives not covered comprehensively
Warning: Statistical recommendations have significant implications for research validity. All recommendations must be verified by a qualified statistician before use in published research.
Output Requirements
Every response must make these explicit when relevant:
- Objective or requested deliverable
- Inputs used and assumptions introduced
- Workflow or decision path
- Core result, recommendation, or artifact
- Constraints, risks, caveats, or validation needs
- Unresolved items and next-step checks
Error Handling
- If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.
- If the task goes outside documented scope, stop instead of guessing or silently widening the assignment.
- If
scripts/main.py fails, report the failure point, summarize what can still be completed safely, and provide the manual fallback above.
- Do not fabricate files, citations, data, search results, or execution outcomes.
Input Validation
This skill accepts: descriptions of research designs, data types, group structures, and sample sizes for statistical test selection and power analysis.
If the request does not involve statistical method selection — for example, asking to run a full statistical analysis on raw data, perform machine learning modeling, or interpret clinical trial results — do not proceed. Instead respond:
"statistical-analysis-advisor is designed to recommend appropriate statistical methods based on your research design. Your request appears to be outside this scope. Please describe your data type, number of groups, and research question, or use a more appropriate tool for your task."
Response Template
Use this fixed structure for non-trivial requests:
- Objective
- Inputs Received
- Assumptions
- Workflow
- Deliverable
- Risks and Limits
- Next Checks
For simple requests, compress the structure but keep assumptions and limits explicit when they affect correctness.
References
- Statistical Tests Guide
- Assumption Tests
- Power Analysis Guide
Prerequisites
pip install -r requirements.txt
1---2name: statistical-analysis-advisor-23description: Recommend appropriate statistical tests (T-test, ANOVA, Mann-Whitney, etc.) based on data type, distribution, sample size, and research design.4license: MIT5---6# Statistical Analysis Advisor
7
8Intelligent statistical test recommendation engine that guides users through selecting the right statistical methods for their data and research design.
9
10## Quick Check
11
12```bash
13python -m py_compile scripts/main.py
14python scripts/main.py
15```
16
17## When to Use
18
19- Choosing between parametric and non-parametric tests
20- Selecting the right test for 2-group vs multi-group comparisons
21- Checking statistical assumptions before analysis
22- Power analysis and sample size planning
23
24## Usage
25
26```python
27from scripts.main import StatisticalAdvisor
28
29advisor = StatisticalAdvisor()
30
31recommendation = advisor.recommend_test(
32 data_type="continuous",
33 groups=2,
34 independent=True,
35 distribution="normal"
36)
37```
38
39## Input Parameters
40
41| Parameter | Type | Description |
42|-----------|------|-------------|
43| `data_type` | str | "continuous", "categorical", "ordinal" |
44| `groups` | int | Number of groups/comparison levels |
45| `independent` | bool | Independent or paired/related samples |
46| `distribution` | str | "normal", "non-normal", "unknown" |
47| `sample_size` | int | Current or planned sample size |
48
49## Capabilities
50
511. **Test Selection** — T-test, ANOVA, Chi-square, Mann-Whitney, Kruskal-Wallis, Fisher's exact, and more
522. **Assumption Checking** — Normality (Shapiro-Wilk, K-S), homogeneity of variance (Levene's, Bartlett's), independence
533. **Power Analysis** — Effect size (Cohen's d, eta-squared, Cramér's V), sample size calculations, post-hoc power
54
55## Workflow
56
571. Confirm objective, required inputs, and constraints before proceeding.
582. Validate request matches documented scope; stop early if unsupported assumptions are needed.
593. Run `scripts/main.py` with available inputs, or use the documented reasoning path.
604. Return structured result separating assumptions, deliverables, risks, and unresolved items.
615. On execution failure or incomplete inputs, switch to fallback path and state exactly what blocked completion.
62
63## Fallback Template
64
65If `scripts/main.py` cannot run (missing inputs, environment error), respond with:
66
67```
68FALLBACK REPORT
69───────────────────────────────────────
70Objective : <stated goal>
71Blocked by : <exact missing input or error>
72Partial result : <what can still be assessed manually>
73Next step : <minimum action to unblock>
74───────────────────────────────────────
75```
76
77## Limitations
78
79- Provides recommendations only — does not perform actual data analysis
80- Cannot access raw data directly
81- Complex multivariate designs may require specialized biostatistician consultation
82- Bayesian alternatives not covered comprehensively
83
84**Warning:** Statistical recommendations have significant implications for research validity. All recommendations must be verified by a qualified statistician before use in published research.
85
86## Output Requirements
87
88Every response must make these explicit when relevant:
89
90- Objective or requested deliverable
91- Inputs used and assumptions introduced
92- Workflow or decision path
93- Core result, recommendation, or artifact
94- Constraints, risks, caveats, or validation needs
95- Unresolved items and next-step checks
96
97## Error Handling
98
99- If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.
100- If the task goes outside documented scope, stop instead of guessing or silently widening the assignment.
101- If `scripts/main.py` fails, report the failure point, summarize what can still be completed safely, and provide the manual fallback above.
102- Do not fabricate files, citations, data, search results, or execution outcomes.
103
104## Input Validation
105
106This skill accepts: descriptions of research designs, data types, group structures, and sample sizes for statistical test selection and power analysis.
107
108If the request does not involve statistical method selection — for example, asking to run a full statistical analysis on raw data, perform machine learning modeling, or interpret clinical trial results — do not proceed. Instead respond:
109
110> "statistical-analysis-advisor is designed to recommend appropriate statistical methods based on your research design. Your request appears to be outside this scope. Please describe your data type, number of groups, and research question, or use a more appropriate tool for your task."
111
112## Response Template
113
114Use this fixed structure for non-trivial requests:
115
1161. Objective
1172. Inputs Received
1183. Assumptions
1194. Workflow
1205. Deliverable
1216. Risks and Limits
1227. Next Checks
123
124For simple requests, compress the structure but keep assumptions and limits explicit when they affect correctness.
125
126## References
127
128- [Statistical Tests Guide](references/statistical_tests_guide.md)
129- [Assumption Tests](references/assumption_tests.md)
130- [Power Analysis Guide](references/power_analysis_guide.md)
131
132## Prerequisites
133
134```bash
135pip install -r requirements.txt
136```