[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71677EBCM8EPCE9BZCK8505":3,"skill-same:01M71677EBCM8EPCE9BZCK8505":101},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":53,"commitSha":54,"skillDirectory":55,"forksCount":14,"repositoryHtmlUrl":56,"repositoryHomepageUrl":6,"ownerHtmlUrl":57,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":58,"install":59,"resources":72},"01M71677EBCM8EPCE9BZCK8505","statistical-analysis",null,"Guided statistical analysis with test selection and reporting. Use when you need help choosing appropriate tests for your data, assumption checking, power analysis, and APA-formatted results. Best for academic research reporting, test selection guidance. For implementing specific models programmatically use statsmodels.","fadrienne\u002FMyGitHub","fadrienne","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F197874571?v=4","01M6X64V8VWCRSMFZ4EPS2BWXG","Francesca Adrienne","01M6X64VD5MW4F9PHDWQKS7ZAF",0,"MIT","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fstatistical-analysis\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"statistical analysis","analysis","help","models","statsmodels","results","research","test","with","use","tests","for","data","reporting","you","when","selection","implementing","academic research","power","2026-11-10 10:12:30",false,"---\nname: statistical-analysis\ndescription: Guided statistical analysis with test selection and reporting. Use when you need help choosing appropriate tests for your data, assumption checking, power analysis, and APA-formatted results. Best for academic research reporting, test selection guidance. For implementing specific models programmatically use statsmodels.\nlicense: MIT license\nmetadata: {\"version\": \"1.0\", \"skill-author\": \"K-Dense Inc.\"}\n---\n\n# Statistical Analysis\n\n## Overview\n\nStatistical analysis is a systematic process for testing hypotheses and quantifying relationships. Conduct hypothesis tests (t-test, ANOVA, chi-square), regression, correlation, and Bayesian analyses with assumption checks and APA reporting. Apply this skill for academic research.\n\n## When to Use This Skill\n\nThis skill should be used when:\n- Conducting statistical hypothesis tests (t-tests, ANOVA, chi-square)\n- Performing regression or correlation analyses\n- Running Bayesian statistical analyses\n- Checking statistical assumptions and diagnostics\n- Calculating effect sizes and conducting power analyses\n- Reporting statistical results in APA format\n- Analyzing experimental or observational data for research\n\n---\n\n## Installation\n\nUse **uv** to install the libraries used in this skill. Pin versions in production; unpinned installs are fine for exploration.\n\n```bash\n# Core frequentist stack (Python 3.10+; 3.12+ recommended for latest SciPy\u002FArviZ)\nuv pip install \"pingouin>=0.6\" \"scipy>=1.11\" \"statsmodels>=0.14.6\" pandas matplotlib seaborn\n\n# Bayesian modeling (PyMC 5 + ArviZ; ArviZ 0.23+ requires Python 3.12+)\nuv pip install \"pymc>=5.0\" \"arviz>=0.17\"\n```\n\n**Compatibility notes (2025–2026):**\n\n- **Pingouin 0.5+** renamed output columns (`p_val`, `cohen_d`, `CI95`, `p_unc`) — examples below use the current names.\n- **statsmodels + SciPy**: use `statsmodels>=0.14.6` with `scipy>=1.11` to avoid `_lazywhere` import errors on SciPy 1.16+.\n- **Pingouin Bayes Factors**: one-sided BF for t-tests was removed in 0.5+; use dedicated packages (e.g. JASP, BayesFactor via R) or PyMC for hypothesis testing.\n\nFor model-specific APIs (OLS, GLM, ARIMA), see the **statsmodels** skill. For PyMC workflows, see the **pymc** skill.\n\n---\n\n## Core Capabilities\n\n### 1. Test Selection and Planning\n- Choose appropriate statistical tests based on research questions and data characteristics\n- Conduct a priori power analyses to determine required sample sizes\n- Plan analysis strategies including multiple comparison corrections\n\n### 2. Assumption Checking\n- Automatically verify all relevant assumptions before running tests\n- Provide diagnostic visualizations (Q-Q plots, residual plots, box plots)\n- Recommend remedial actions when assumptions are violated\n\n### 3. Statistical Testing\n- Hypothesis testing: t-tests, ANOVA, chi-square, non-parametric alternatives\n- Regression: linear, multiple, logistic, with diagnostics\n- Correlations: Pearson, Spearman, with confidence intervals\n- Bayesian alternatives: Bayesian t-tests, ANOVA, regression with Bayes Factors\n\n### 4. Effect Sizes and Interpretation\n- Calculate and interpret appropriate effect sizes for all analyses\n- Provide confidence intervals for effect estimates\n- Distinguish statistical from practical significance\n\n### 5. Professional Reporting\n- Generate APA-style statistical reports\n- Create publication-ready figures and tables\n- Provide complete interpretation with all required statistics\n\n---\n\n## Workflow Decision Tree\n\nUse this decision tree to determine your analysis path:\n\n```\nSTART\n│\n├─ Need to SELECT a statistical test?\n│  └─ YES → See \"Test Selection Guide\"\n│  └─ NO → Continue\n│\n├─ Ready to check ASSUMPTIONS?\n│  └─ YES → See \"Assumption Checking\"\n│  └─ NO → Continue\n│\n├─ Ready to run ANALYSIS?\n│  └─ YES → See \"Running Statistical Tests\"\n│  └─ NO → Continue\n│\n└─ Need to REPORT results?\n   └─ YES → See \"Reporting Results\"\n```\n\n---\n\n## Test Selection Guide\n\n### Quick Reference: Choosing the Right Test\n\nUse `references\u002Ftest_selection_guide.md` for comprehensive guidance. Quick reference:\n\n**Comparing Two Groups:**\n- Independent, continuous, normal → Independent t-test\n- Independent, continuous, non-normal → Mann-Whitney U test\n- Paired, continuous, normal → Paired t-test\n- Paired, continuous, non-normal → Wilcoxon signed-rank test\n- Binary outcome → Chi-square or Fisher's exact test\n\n**Comparing 3+ Groups:**\n- Independent, continuous, normal → One-way ANOVA\n- Independent, continuous, non-normal → Kruskal-Wallis test\n- Paired, continuous, normal → Repeated measures ANOVA\n- Paired, continuous, non-normal → Friedman test\n\n**Relationships:**\n- Two continuous variables → Pearson (normal) or Spearman correlation (non-normal)\n- Continuous outcome with predictor(s) → Linear regression\n- Binary outcome with predictor(s) → Logistic regression\n\n**Bayesian Alternatives:**\nAll tests have Bayesian versions that provide:\n- Direct probability statements about hypotheses\n- Bayes Factors quantifying evidence\n- Ability to support null hypothesis\n- See `references\u002Fbayesian_statistics.md`\n\n---\n\n## Assumption Checking\n\n### Systematic Assumption Verification\n\n**ALWAYS check assumptions before interpreting test results.**\n\nUse the bundled `scripts\u002Fassumption_checks.py` module for automated checking. Run Python from the skill directory (`skills\u002Fstatistical-analysis\u002F`) or add `scripts\u002F` to `sys.path`:\n\n```python\nfrom assumption_checks import comprehensive_assumption_check\n\n# Comprehensive check with visualizations\nresults = comprehensive_assumption_check(\n    data=df,\n    value_col='score',\n    group_col='group',  # Optional: for group comparisons\n    alpha=0.05\n)\n```\n\nThis performs:\n1. **Outlier detection** (IQR and z-score methods)\n2. **Normality testing** (Shapiro-Wilk test + Q-Q plots)\n3. **Homogeneity of variance** (Levene's test + box plots)\n4. **Interpretation and recommendations**\n\n### Individual Assumption Checks\n\nFor targeted checks, use individual functions:\n\n```python\nfrom assumption_checks import (\n    check_normality,\n    check_normality_per_group,\n    check_homogeneity_of_variance,\n    check_linearity,\n    detect_outliers\n)\n\n# Example: Check normality with visualization\nresult = check_normality(\n    data=df['score'],\n    name='Test Score',\n    alpha=0.05,\n    plot=True\n)\nprint(result['interpretation'])\nprint(result['recommendation'])\n```\n\n### What to Do When Assumptions Are Violated\n\n**Normality violated:**\n- Mild violation + n > 30 per group → Proceed with parametric test (robust)\n- Moderate violation → Use non-parametric alternative\n- Severe violation → Transform data or use non-parametric test\n\n**Homogeneity of variance violated:**\n- For t-test → Use Welch's t-test\n- For ANOVA → Use Welch's ANOVA or Brown-Forsythe ANOVA\n- For regression → Use robust standard errors or weighted least squares\n\n**Linearity violated (regression):**\n- Add polynomial terms\n- Transform variables\n- Use non-linear models or GAM\n\nSee `references\u002Fassumptions_and_diagnostics.md` for comprehensive guidance.\n\n---\n\n## Running Statistical Tests\n\n### Python Libraries\n\nPrimary libraries for statistical analysis:\n- **scipy.stats**: Core statistical tests\n- **statsmodels**: Advanced regression and diagnostics\n- **pingouin**: User-friendly statistical testing with effect sizes\n- **pymc**: Bayesian statistical modeling\n- **arviz**: Bayesian visualization and diagnostics\n\n### Example Analyses\n\n#### T-Test with Complete Reporting\n\n```python\nimport pingouin as pg\nimport numpy as np\n\n# Run independent t-test\nresult = pg.ttest(group_a, group_b, correction='auto')\n\n# Extract results (Pingouin 0.5+ column names)\nt_stat = result['T'].values[0]\ndf = result['dof'].values[0]\np_value = result['p_val'].values[0]\ncohens_d = result['cohen_d'].values[0]\nci = result['CI95'].values[0]\nci_lower, ci_upper = ci[0], ci[1]\n\n# Report\nprint(f\"t({df:.0f}) = {t_stat:.2f}, p = {p_value:.3f}\")\nprint(f\"Cohen's d = {cohens_d:.2f}, 95% CI [{ci_lower:.2f}, {ci_upper:.2f}]\")\n```\n\n#### ANOVA with Post-Hoc Tests\n\n```python\nimport pingouin as pg\n\n# One-way ANOVA\naov = pg.anova(dv='score', between='group', data=df, detailed=True)\nprint(aov)\n\n# If significant, conduct post-hoc tests\nif aov['p_unc'].values[0] \u003C 0.05:\n    posthoc = pg.pairwise_tukey(dv='score', between='group', data=df)\n    print(posthoc)\n\n# Effect size\neta_squared = aov['np2'].values[0]  # Partial eta-squared\nprint(f\"Partial η² = {eta_squared:.3f}\")\n```\n\n#### Linear Regression with Diagnostics\n\n```python\nimport statsmodels.api as sm\nfrom statsmodels.stats.outliers_influence import variance_inflation_factor\n\n# Fit model\nX = sm.add_constant(X_predictors)  # Add intercept\nmodel = sm.OLS(y, X).fit()\n\n# Summary\nprint(model.summary())\n\n# Check multicollinearity (VIF)\nvif_data = pd.DataFrame()\nvif_data[\"Variable\"] = X.columns\nvif_data[\"VIF\"] = [variance_inflation_factor(X.values, i) for i in range(X.shape[1])]\nprint(vif_data)\n\n# Check assumptions\nresiduals = model.resid\nfitted = model.fittedvalues\n\n# Residual plots\nimport matplotlib.pyplot as plt\nfig, axes = plt.subplots(2, 2, figsize=(12, 10))\n\n# Residuals vs fitted\naxes[0, 0].scatter(fitted, residuals, alpha=0.6)\naxes[0, 0].axhline(y=0, color='r', linestyle='--')\naxes[0, 0].set_xlabel('Fitted values')\naxes[0, 0].set_ylabel('Residuals')\naxes[0, 0].set_title('Residuals vs Fitted')\n\n# Q-Q plot\nfrom scipy import stats\nstats.probplot(residuals, dist=\"norm\", plot=axes[0, 1])\naxes[0, 1].set_title('Normal Q-Q')\n\n# Scale-Location\naxes[1, 0].scatter(fitted, np.sqrt(np.abs(residuals \u002F residuals.std())), alpha=0.6)\naxes[1, 0].set_xlabel('Fitted values')\naxes[1, 0].set_ylabel('√|Standardized residuals|')\naxes[1, 0].set_title('Scale-Location')\n\n# Residuals histogram\naxes[1, 1].hist(residuals, bins=20, edgecolor='black', alpha=0.7)\naxes[1, 1].set_xlabel('Residuals')\naxes[1, 1].set_ylabel('Frequency')\naxes[1, 1].set_title('Histogram of Residuals')\n\nplt.tight_layout()\nplt.show()\n```\n\n#### Bayesian T-Test\n\n```python\nimport pymc as pm\nimport arviz as az\nimport numpy as np\n\nwith pm.Model() as model:\n    # Priors\n    mu1 = pm.Normal('mu_group1', mu=0, sigma=10)\n    mu2 = pm.Normal('mu_group2', mu=0, sigma=10)\n    sigma = pm.HalfNormal('sigma', sigma=10)\n\n    # Likelihood\n    y1 = pm.Normal('y1', mu=mu1, sigma=sigma, observed=group_a)\n    y2 = pm.Normal('y2', mu=mu2, sigma=sigma, observed=group_b)\n\n    # Derived quantity\n    diff = pm.Deterministic('difference', mu1 - mu2)\n\n    # Sample\n    trace = pm.sample(2000, tune=1000, return_inferencedata=True)\n\n# Summarize\nprint(az.summary(trace, var_names=['difference']))\n\n# Probability that group1 > group2\nprob_greater = np.mean(trace.posterior['difference'].values > 0)\nprint(f\"P(μ₁ > μ₂ | data) = {prob_greater:.3f}\")\n\n# Plot posterior\naz.plot_posterior(trace, var_names=['difference'], ref_val=0)\n```\n\n---\n\n## Effect Sizes\n\n### Always Calculate Effect Sizes\n\n**Effect sizes quantify magnitude, while p-values only indicate existence of an effect.**\n\nSee `references\u002Feffect_sizes_and_power.md` for comprehensive guidance.\n\n### Quick Reference: Common Effect Sizes\n\n| Test | Effect Size | Small | Medium | Large |\n|------|-------------|-------|--------|-------|\n| T-test | Cohen's d | 0.20 | 0.50 | 0.80 |\n| ANOVA | η²_p | 0.01 | 0.06 | 0.14 |\n| Correlation | r | 0.10 | 0.30 | 0.50 |\n| Regression | R² | 0.02 | 0.13 | 0.26 |\n| Chi-square | Cramér's V | 0.07 | 0.21 | 0.35 |\n\n**Important**: Benchmarks are guidelines. Context matters!\n\n### Calculating Effect Sizes\n\nMost effect sizes are automatically calculated by pingouin:\n\n```python\n# T-test returns Cohen's d\nresult = pg.ttest(x, y)\nd = result['cohen_d'].values[0]\n\n# ANOVA returns partial eta-squared\naov = pg.anova(dv='score', between='group', data=df)\neta_p2 = aov['np2'].values[0]\n\n# Correlation: r is already an effect size\ncorr = pg.corr(x, y)\nr = corr['r'].values[0]\n```\n\n### Confidence Intervals for Effect Sizes\n\nAlways report CIs to show precision:\n\n```python\nfrom pingouin import compute_effsize_from_t\n\n# For t-test\nd, ci = compute_effsize_from_t(\n    t_statistic,\n    nx=len(group1),\n    ny=len(group2),\n    eftype='cohen'\n)\nprint(f\"d = {d:.2f}, 95% CI [{ci[0]:.2f}, {ci[1]:.2f}]\")\n```\n\n---\n\n## Power Analysis\n\n### A Priori Power Analysis (Study Planning)\n\nDetermine required sample size before data collection:\n\n```python\nfrom statsmodels.stats.power import (\n    tt_ind_solve_power,\n    FTestAnovaPower\n)\n\n# T-test: What n is needed to detect d = 0.5?\nn_required = tt_ind_solve_power(\n    effect_size=0.5,\n    alpha=0.05,\n    power=0.80,\n    ratio=1.0,\n    alternative='two-sided'\n)\nprint(f\"Required n per group: {n_required:.0f}\")\n\n# ANOVA: What n is needed to detect f = 0.25?\nanova_power = FTestAnovaPower()\nn_per_group = anova_power.solve_power(\n    effect_size=0.25,\n    ngroups=3,\n    alpha=0.05,\n    power=0.80\n)\nprint(f\"Required n per group: {n_per_group:.0f}\")\n```\n\n### Sensitivity Analysis (Post-Study)\n\nDetermine what effect size you could detect:\n\n```python\n# With n=50 per group, what effect could we detect?\ndetectable_d = tt_ind_solve_power(\n    effect_size=None,  # Solve for this\n    nobs1=50,\n    alpha=0.05,\n    power=0.80,\n    ratio=1.0,\n    alternative='two-sided'\n)\nprint(f\"Study could detect d ≥ {detectable_d:.2f}\")\n```\n\n**Note**: Post-hoc power analysis (calculating power after study) is generally not recommended. Use sensitivity analysis instead.\n\nSee `references\u002Feffect_sizes_and_power.md` for detailed guidance.\n\n---\n\n## Reporting Results\n\n### APA Style Statistical Reporting\n\nFollow guidelines in `references\u002Freporting_standards.md`.\n\n### Essential Reporting Elements\n\n1. **Descriptive statistics**: M, SD, n for all groups\u002Fvariables\n2. **Test statistics**: Test name, statistic, df, exact p-value\n3. **Effect sizes**: With confidence intervals\n4. **Assumption checks**: Which tests were done, results, actions taken\n5. **All planned analyses**: Including non-significant findings\n\n### Example Report Templates\n\n#### Independent T-Test\n\n```\nGroup A (n = 48, M = 75.2, SD = 8.5) scored significantly higher than\nGroup B (n = 52, M = 68.3, SD = 9.2), t(98) = 3.82, p \u003C .001, d = 0.77,\n95% CI [0.36, 1.18], two-tailed. Assumptions of normality (Shapiro-Wilk:\nGroup A W = 0.97, p = .18; Group B W = 0.96, p = .12) and homogeneity\nof variance (Levene's F(1, 98) = 1.23, p = .27) were satisfied.\n```\n\n#### One-Way ANOVA\n\n```\nA one-way ANOVA revealed a significant main effect of treatment condition\non test scores, F(2, 147) = 8.45, p \u003C .001, η²_p = .10. Post hoc\ncomparisons using Tukey's HSD indicated that Condition A (M = 78.2,\nSD = 7.3) scored significantly higher than Condition B (M = 71.5,\nSD = 8.1, p = .002, d = 0.87) and Condition C (M = 70.1, SD = 7.9,\np \u003C .001, d = 1.07). Conditions B and C did not differ significantly\n(p = .52, d = 0.18).\n```\n\n#### Multiple Regression\n\n```\nMultiple linear regression was conducted to predict exam scores from\nstudy hours, prior GPA, and attendance. The overall model was significant,\nF(3, 146) = 45.2, p \u003C .001, R² = .48, adjusted R² = .47. Study hours\n(B = 1.80, SE = 0.31, β = .35, t = 5.78, p \u003C .001, 95% CI [1.18, 2.42])\nand prior GPA (B = 8.52, SE = 1.95, β = .28, t = 4.37, p \u003C .001,\n95% CI [4.66, 12.38]) were significant predictors, while attendance was\nnot (B = 0.15, SE = 0.12, β = .08, t = 1.25, p = .21, 95% CI [-0.09, 0.39]).\nMulticollinearity was not a concern (all VIF \u003C 1.5).\n```\n\n#### Bayesian Analysis\n\n```\nA Bayesian independent samples t-test was conducted using weakly\ninformative priors (Normal(0, 1) for mean difference). The posterior\ndistribution indicated that Group A scored higher than Group B\n(M_diff = 6.8, 95% credible interval [3.2, 10.4]). The Bayes Factor\nBF₁₀ = 45.3 provided very strong evidence for a difference between\ngroups, with a 99.8% posterior probability that Group A's mean exceeded\nGroup B's mean. Convergence diagnostics were satisfactory (all R̂ \u003C 1.01,\nESS > 1000).\n```\n\n---\n\n## Bayesian Statistics\n\n### When to Use Bayesian Methods\n\nConsider Bayesian approaches when:\n- You have prior information to incorporate\n- You want direct probability statements about hypotheses\n- Sample size is small or planning sequential data collection\n- You need to quantify evidence for the null hypothesis\n- The model is complex (hierarchical, missing data)\n\nSee `references\u002Fbayesian_statistics.md` for comprehensive guidance on:\n- Bayes' theorem and interpretation\n- Prior specification (informative, weakly informative, non-informative)\n- Bayesian hypothesis testing with Bayes Factors\n- Credible intervals vs. confidence intervals\n- Bayesian t-tests, ANOVA, regression, and hierarchical models\n- Model convergence checking and posterior predictive checks\n\n### Key Advantages\n\n1. **Intuitive interpretation**: \"Given the data, there is a 95% probability the parameter is in this interval\"\n2. **Evidence for null**: Can quantify support for no effect\n3. **Flexible**: No p-hacking concerns; can analyze data as it arrives\n4. **Uncertainty quantification**: Full posterior distribution\n\n---\n\n## Resources\n\nThis skill includes comprehensive reference materials:\n\n### References Directory\n\n- **test_selection_guide.md**: Decision tree for choosing appropriate statistical tests\n- **assumptions_and_diagnostics.md**: Detailed guidance on checking and handling assumption violations\n- **effect_sizes_and_power.md**: Calculating, interpreting, and reporting effect sizes; conducting power analyses\n- **bayesian_statistics.md**: Complete guide to Bayesian analysis methods\n- **reporting_standards.md**: APA-style reporting guidelines with examples\n\n### Scripts Directory\n\n- **assumption_checks.py**: Automated assumption checking with visualizations\n  - `comprehensive_assumption_check()`: Complete workflow\n  - `check_normality()`: Normality testing with Q-Q plots\n  - `check_homogeneity_of_variance()`: Levene's test with box plots\n  - `check_linearity()`: Regression linearity checks\n  - `detect_outliers()`: IQR and z-score outlier detection\n\n---\n\n## Best Practices\n\n1. **Pre-register analyses** when possible to distinguish confirmatory from exploratory\n2. **Always check assumptions** before interpreting results\n3. **Report effect sizes** with confidence intervals\n4. **Report all planned analyses** including non-significant results\n5. **Distinguish statistical from practical significance**\n6. **Visualize data** before and after analysis\n7. **Check diagnostics** for regression\u002FANOVA (residual plots, VIF, etc.)\n8. **Conduct sensitivity analyses** to assess robustness\n9. **Share data and code** for reproducibility\n10. **Be transparent** about violations, transformations, and decisions\n\n---\n\n## Common Pitfalls to Avoid\n\n1. **P-hacking**: Don't test multiple ways until something is significant\n2. **HARKing**: Don't present exploratory findings as confirmatory\n3. **Ignoring assumptions**: Check them and report violations\n4. **Confusing significance with importance**: p \u003C .05 ≠ meaningful effect\n5. **Not reporting effect sizes**: Essential for interpretation\n6. **Cherry-picking results**: Report all planned analyses\n7. **Misinterpreting p-values**: They're NOT probability that hypothesis is true\n8. **Multiple comparisons**: Correct for family-wise error when appropriate\n9. **Ignoring missing data**: Understand mechanism (MCAR, MAR, MNAR)\n10. **Overinterpreting non-significant results**: Absence of evidence ≠ evidence of absence\n\n---\n\n## Getting Started Checklist\n\nWhen beginning a statistical analysis:\n\n- [ ] Define research question and hypotheses\n- [ ] Determine appropriate statistical test (use test_selection_guide.md)\n- [ ] Conduct power analysis to determine sample size\n- [ ] Load and inspect data\n- [ ] Check for missing data and outliers\n- [ ] Verify assumptions using assumption_checks.py\n- [ ] Run primary analysis\n- [ ] Calculate effect sizes with confidence intervals\n- [ ] Conduct post-hoc tests if needed (with corrections)\n- [ ] Create visualizations\n- [ ] Write results following reporting_standards.md\n- [ ] Conduct sensitivity analyses\n- [ ] Share data and code\n\n---\n\n## Support and Further Reading\n\nFor questions about:\n- **Test selection**: See references\u002Ftest_selection_guide.md\n- **Assumptions**: See references\u002Fassumptions_and_diagnostics.md\n- **Effect sizes**: See references\u002Feffect_sizes_and_power.md\n- **Bayesian methods**: See references\u002Fbayesian_statistics.md\n- **Reporting**: See references\u002Freporting_standards.md\n\n**Key textbooks**:\n- Cohen, J. (1988). *Statistical Power Analysis for the Behavioral Sciences*\n- Field, A. (2013). *Discovering Statistics Using IBM SPSS Statistics*\n- Gelman, A., & Hill, J. (2006). *Data Analysis Using Regression and Multilevel\u002FHierarchical Models*\n- Kruschke, J. K. (2014). *Doing Bayesian Data Analysis*\n\n**Online resources**:\n- APA Style Guide: https:\u002F\u002Fapastyle.apa.org\u002F\n- Statistical Consulting: Cross Validated (stats.stackexchange.com)\n\n","# Statistical Analysis\n\n## Overview\n\nStatistical analysis is a systematic process for testing hypotheses and quantifying relationships. Conduct hypothesis tests (t-test, ANOVA, chi-square), regression, correlation, and Bayesian analyses with assumption checks and APA reporting. Apply this skill for academic research.\n\n## When to Use This Skill\n\nThis skill should be used when:\n- Conducting statistical hypothesis tests (t-tests, ANOVA, chi-square)\n- Performing regression or correlation analyses\n- Running Bayesian statistical analyses\n- Checking statistical assumptions and diagnostics\n- Calculating effect sizes and conducting power analyses\n- Reporting statistical results in APA format\n- Analyzing experimental or observational data for research\n\n---\n\n## Installation\n\nUse **uv** to install the libraries used in this skill. Pin versions in production; unpinned installs are fine for exploration.\n\n```bash\n# Core frequentist stack (Python 3.10+; 3.12+ recommended for latest SciPy\u002FArviZ)\nuv pip install \"pingouin>=0.6\" \"scipy>=1.11\" \"statsmodels>=0.14.6\" pandas matplotlib seaborn\n\n# Bayesian modeling (PyMC 5 + ArviZ; ArviZ 0.23+ requires Python 3.12+)\nuv pip install \"pymc>=5.0\" \"arviz>=0.17\"\n```\n\n**Compatibility notes (2025–2026):**\n\n- **Pingouin 0.5+** renamed output columns (`p_val`, `cohen_d`, `CI95`, `p_unc`) — examples below use the current names.\n- **statsmodels + SciPy**: use `statsmodels>=0.14.6` with `scipy>=1.11` to avoid `_lazywhere` import errors on SciPy 1.16+.\n- **Pingouin Bayes Factors**: one-sided BF for t-tests was removed in 0.5+; use dedicated packages (e.g. JASP, BayesFactor via R) or PyMC for hypothesis testing.\n\nFor model-specific APIs (OLS, GLM, ARIMA), see the **statsmodels** skill. For PyMC workflows, see the **pymc** skill.\n\n---\n\n## Core Capabilities\n\n### 1. Test Selection and Planning\n- Choose appropriate statistical tests based on research questions and data characteristics\n- Conduct a priori power analyses to determine required sample sizes\n- Plan analysis strategies including multiple comparison corrections\n\n### 2. Assumption Checking\n- Automatically verify all relevant assumptions before running tests\n- Provide diagnostic visualizations (Q-Q plots, residual plots, box plots)\n- Recommend remedial actions when assumptions are violated\n\n### 3. Statistical Testing\n- Hypothesis testing: t-tests, ANOVA, chi-square, non-parametric alternatives\n- Regression: linear, multiple, logistic, with diagnostics\n- Correlations: Pearson, Spearman, with confidence intervals\n- Bayesian alternatives: Bayesian t-tests, ANOVA, regression with Bayes Factors\n\n### 4. Effect Sizes and Interpretation\n- Calculate and interpret appropriate effect sizes for all analyses\n- Provide confidence intervals for effect estimates\n- Distinguish statistical from practical significance\n\n### 5. Professional Reporting\n- Generate APA-style statistical reports\n- Create publication-ready figures and tables\n- Provide complete interpretation with all required statistics\n\n---\n\n## Workflow Decision Tree\n\nUse this decision tree to determine your analysis path:\n\n```\nSTART\n│\n├─ Need to SELECT a statistical test?\n│  └─ YES → See \"Test Selection Guide\"\n│  └─ NO → Continue\n│\n├─ Ready to check ASSUMPTIONS?\n│  └─ YES → See \"Assumption Checking\"\n│  └─ NO → Continue\n│\n├─ Ready to run ANALYSIS?\n│  └─ YES → See \"Running Statistical Tests\"\n│  └─ NO → Continue\n│\n└─ Need to REPORT results?\n   └─ YES → See \"Reporting Results\"\n```\n\n---\n\n## Test Selection Guide\n\n### Quick Reference: Choosing the Right Test\n\nUse `references\u002Ftest_selection_guide.md` for comprehensive guidance. Quick reference:\n\n**Comparing Two Groups:**\n- Independent, continuous, normal → Independent t-test\n- Independent, continuous, non-normal → Mann-Whitney U test\n- Paired, continuous, normal → Paired t-test\n- Paired, continuous, non-normal → Wilcoxon signed-rank test\n- Binary outcome → Chi-square or Fisher's exact test\n\n**Comparing 3+ Groups:**\n- Independent, continuous, normal → One-way ANOVA\n- Independent, continuous, non-normal → Kruskal-Wallis test\n- Paired, continuous, normal → Repeated measures ANOVA\n- Paired, continuous, non-normal → Friedman test\n\n**Relationships:**\n- Two continuous variables → Pearson (normal) or Spearman correlation (non-normal)\n- Continuous outcome with predictor(s) → Linear regression\n- Binary outcome with predictor(s) → Logistic regression\n\n**Bayesian Alternatives:**\nAll tests have Bayesian versions that provide:\n- Direct probability statements about hypotheses\n- Bayes Factors quantifying evidence\n- Ability to support null hypothesis\n- See `references\u002Fbayesian_statistics.md`\n\n---\n\n## Assumption Checking\n\n### Systematic Assumption Verification\n\n**ALWAYS check assumptions before interpreting test results.**\n\nUse the bundled `scripts\u002Fassumption_checks.py` module for automated checking. Run Python from the skill directory (`skills\u002Fstatistical-analysis\u002F`) or add `scripts\u002F` to `sys.path`:\n\n```python\nfrom assumption_checks import comprehensive_assumption_check\n\n# Comprehensive check with visualizations\nresults = comprehensive_assumption_check(\n    data=df,\n    value_col='score',\n    group_col='group',  # Optional: for group comparisons\n    alpha=0.05\n)\n```\n\nThis performs:\n1. **Outlier detection** (IQR and z-score methods)\n2. **Normality testing** (Shapiro-Wilk test + Q-Q plots)\n3. **Homogeneity of variance** (Levene's test + box plots)\n4. **Interpretation and recommendations**\n\n### Individual Assumption Checks\n\nFor targeted checks, use individual functions:\n\n```python\nfrom assumption_checks import (\n    check_normality,\n    check_normality_per_group,\n    check_homogeneity_of_variance,\n    check_linearity,\n    detect_outliers\n)\n\n# Example: Check normality with visualization\nresult = check_normality(\n    data=df['score'],\n    name='Test Score',\n    alpha=0.05,\n    plot=True\n)\nprint(result['interpretation'])\nprint(result['recommendation'])\n```\n\n### What to Do When Assumptions Are Violated\n\n**Normality violated:**\n- Mild violation + n > 30 per group → Proceed with parametric test (robust)\n- Moderate violation → Use non-parametric alternative\n- Severe violation → Transform data or use non-parametric test\n\n**Homogeneity of variance violated:**\n- For t-test → Use Welch's t-test\n- For ANOVA → Use Welch's ANOVA or Brown-Forsythe ANOVA\n- For regression → Use robust standard errors or weighted least squares\n\n**Linearity violated (regression):**\n- Add polynomial terms\n- Transform variables\n- Use non-linear models or GAM\n\nSee `references\u002Fassumptions_and_diagnostics.md` for comprehensive guidance.\n\n---\n\n## Running Statistical Tests\n\n### Python Libraries\n\nPrimary libraries for statistical analysis:\n- **scipy.stats**: Core statistical tests\n- **statsmodels**: Advanced regression and diagnostics\n- **pingouin**: User-friendly statistical testing with effect sizes\n- **pymc**: Bayesian statistical modeling\n- **arviz**: Bayesian visualization and diagnostics\n\n### Example Analyses\n\n#### T-Test with Complete Reporting\n\n```python\nimport pingouin as pg\nimport numpy as np\n\n# Run independent t-test\nresult = pg.ttest(group_a, group_b, correction='auto')\n\n# Extract results (Pingouin 0.5+ column names)\nt_stat = result['T'].values[0]\ndf = result['dof'].values[0]\np_value = result['p_val'].values[0]\ncohens_d = result['cohen_d'].values[0]\nci = result['CI95'].values[0]\nci_lower, ci_upper = ci[0], ci[1]\n\n# Report\nprint(f\"t({df:.0f}) = {t_stat:.2f}, p = {p_value:.3f}\")\nprint(f\"Cohen's d = {cohens_d:.2f}, 95% CI [{ci_lower:.2f}, {ci_upper:.2f}]\")\n```\n\n#### ANOVA with Post-Hoc Tests\n\n```python\nimport pingouin as pg\n\n# One-way ANOVA\naov = pg.anova(dv='score', between='group', data=df, detailed=True)\nprint(aov)\n\n# If significant, conduct post-hoc tests\nif aov['p_unc'].values[0] \u003C 0.05:\n    posthoc = pg.pairwise_tukey(dv='score', between='group', data=df)\n    print(posthoc)\n\n# Effect size\neta_squared = aov['np2'].values[0]  # Partial eta-squared\nprint(f\"Partial η² = {eta_squared:.3f}\")\n```\n\n#### Linear Regression with Diagnostics\n\n```python\nimport statsmodels.api as sm\nfrom statsmodels.stats.outliers_influence import variance_inflation_factor\n\n# Fit model\nX = sm.add_constant(X_predictors)  # Add intercept\nmodel = sm.OLS(y, X).fit()\n\n# Summary\nprint(model.summary())\n\n# Check multicollinearity (VIF)\nvif_data = pd.DataFrame()\nvif_data[\"Variable\"] = X.columns\nvif_data[\"VIF\"] = [variance_inflation_factor(X.values, i) for i in range(X.shape[1])]\nprint(vif_data)\n\n# Check assumptions\nresiduals = model.resid\nfitted = model.fittedvalues\n\n# Residual plots\nimport matplotlib.pyplot as plt\nfig, axes = plt.subplots(2, 2, figsize=(12, 10))\n\n# Residuals vs fitted\naxes[0, 0].scatter(fitted, residuals, alpha=0.6)\naxes[0, 0].axhline(y=0, color='r', linestyle='--')\naxes[0, 0].set_xlabel('Fitted values')\naxes[0, 0].set_ylabel('Residuals')\naxes[0, 0].set_title('Residuals vs Fitted')\n\n# Q-Q plot\nfrom scipy import stats\nstats.probplot(residuals, dist=\"norm\", plot=axes[0, 1])\naxes[0, 1].set_title('Normal Q-Q')\n\n# Scale-Location\naxes[1, 0].scatter(fitted, np.sqrt(np.abs(residuals \u002F residuals.std())), alpha=0.6)\naxes[1, 0].set_xlabel('Fitted values')\naxes[1, 0].set_ylabel('√|Standardized residuals|')\naxes[1, 0].set_title('Scale-Location')\n\n# Residuals histogram\naxes[1, 1].hist(residuals, bins=20, edgecolor='black', alpha=0.7)\naxes[1, 1].set_xlabel('Residuals')\naxes[1, 1].set_ylabel('Frequency')\naxes[1, 1].set_title('Histogram of Residuals')\n\nplt.tight_layout()\nplt.show()\n```\n\n#### Bayesian T-Test\n\n```python\nimport pymc as pm\nimport arviz as az\nimport numpy as np\n\nwith pm.Model() as model:\n    # Priors\n    mu1 = pm.Normal('mu_group1', mu=0, sigma=10)\n    mu2 = pm.Normal('mu_group2', mu=0, sigma=10)\n    sigma = pm.HalfNormal('sigma', sigma=10)\n\n    # Likelihood\n    y1 = pm.Normal('y1', mu=mu1, sigma=sigma, observed=group_a)\n    y2 = pm.Normal('y2', mu=mu2, sigma=sigma, observed=group_b)\n\n    # Derived quantity\n    diff = pm.Deterministic('difference', mu1 - mu2)\n\n    # Sample\n    trace = pm.sample(2000, tune=1000, return_inferencedata=True)\n\n# Summarize\nprint(az.summary(trace, var_names=['difference']))\n\n# Probability that group1 > group2\nprob_greater = np.mean(trace.posterior['difference'].values > 0)\nprint(f\"P(μ₁ > μ₂ | data) = {prob_greater:.3f}\")\n\n# Plot posterior\naz.plot_posterior(trace, var_names=['difference'], ref_val=0)\n```\n\n---\n\n## Effect Sizes\n\n### Always Calculate Effect Sizes\n\n**Effect sizes quantify magnitude, while p-values only indicate existence of an effect.**\n\nSee `references\u002Feffect_sizes_and_power.md` for comprehensive guidance.\n\n### Quick Reference: Common Effect Sizes\n\n| Test | Effect Size | Small | Medium | Large |\n|------|-------------|-------|--------|-------|\n| T-test | Cohen's d | 0.20 | 0.50 | 0.80 |\n| ANOVA | η²_p | 0.01 | 0.06 | 0.14 |\n| Correlation | r | 0.10 | 0.30 | 0.50 |\n| Regression | R² | 0.02 | 0.13 | 0.26 |\n| Chi-square | Cramér's V | 0.07 | 0.21 | 0.35 |\n\n**Important**: Benchmarks are guidelines. Context matters!\n\n### Calculating Effect Sizes\n\nMost effect sizes are automatically calculated by pingouin:\n\n```python\n# T-test returns Cohen's d\nresult = pg.ttest(x, y)\nd = result['cohen_d'].values[0]\n\n# ANOVA returns partial eta-squared\naov = pg.anova(dv='score', between='group', data=df)\neta_p2 = aov['np2'].values[0]\n\n# Correlation: r is already an effect size\ncorr = pg.corr(x, y)\nr = corr['r'].values[0]\n```\n\n### Confidence Intervals for Effect Sizes\n\nAlways report CIs to show precision:\n\n```python\nfrom pingouin import compute_effsize_from_t\n\n# For t-test\nd, ci = compute_effsize_from_t(\n    t_statistic,\n    nx=len(group1),\n    ny=len(group2),\n    eftype='cohen'\n)\nprint(f\"d = {d:.2f}, 95% CI [{ci[0]:.2f}, {ci[1]:.2f}]\")\n```\n\n---\n\n## Power Analysis\n\n### A Priori Power Analysis (Study Planning)\n\nDetermine required sample size before data collection:\n\n```python\nfrom statsmodels.stats.power import (\n    tt_ind_solve_power,\n    FTestAnovaPower\n)\n\n# T-test: What n is needed to detect d = 0.5?\nn_required = tt_ind_solve_power(\n    effect_size=0.5,\n    alpha=0.05,\n    power=0.80,\n    ratio=1.0,\n    alternative='two-sided'\n)\nprint(f\"Required n per group: {n_required:.0f}\")\n\n# ANOVA: What n is needed to detect f = 0.25?\nanova_power = FTestAnovaPower()\nn_per_group = anova_power.solve_power(\n    effect_size=0.25,\n    ngroups=3,\n    alpha=0.05,\n    power=0.80\n)\nprint(f\"Required n per group: {n_per_group:.0f}\")\n```\n\n### Sensitivity Analysis (Post-Study)\n\nDetermine what effect size you could detect:\n\n```python\n# With n=50 per group, what effect could we detect?\ndetectable_d = tt_ind_solve_power(\n    effect_size=None,  # Solve for this\n    nobs1=50,\n    alpha=0.05,\n    power=0.80,\n    ratio=1.0,\n    alternative='two-sided'\n)\nprint(f\"Study could detect d ≥ {detectable_d:.2f}\")\n```\n\n**Note**: Post-hoc power analysis (calculating power after study) is generally not recommended. Use sensitivity analysis instead.\n\nSee `references\u002Feffect_sizes_and_power.md` for detailed guidance.\n\n---\n\n## Reporting Results\n\n### APA Style Statistical Reporting\n\nFollow guidelines in `references\u002Freporting_standards.md`.\n\n### Essential Reporting Elements\n\n1. **Descriptive statistics**: M, SD, n for all groups\u002Fvariables\n2. **Test statistics**: Test name, statistic, df, exact p-value\n3. **Effect sizes**: With confidence intervals\n4. **Assumption checks**: Which tests were done, results, actions taken\n5. **All planned analyses**: Including non-significant findings\n\n### Example Report Templates\n\n#### Independent T-Test\n\n```\nGroup A (n = 48, M = 75.2, SD = 8.5) scored significantly higher than\nGroup B (n = 52, M = 68.3, SD = 9.2), t(98) = 3.82, p \u003C .001, d = 0.77,\n95% CI [0.36, 1.18], two-tailed. Assumptions of normality (Shapiro-Wilk:\nGroup A W = 0.97, p = .18; Group B W = 0.96, p = .12) and homogeneity\nof variance (Levene's F(1, 98) = 1.23, p = .27) were satisfied.\n```\n\n#### One-Way ANOVA\n\n```\nA one-way ANOVA revealed a significant main effect of treatment condition\non test scores, F(2, 147) = 8.45, p \u003C .001, η²_p = .10. Post hoc\ncomparisons using Tukey's HSD indicated that Condition A (M = 78.2,\nSD = 7.3) scored significantly higher than Condition B (M = 71.5,\nSD = 8.1, p = .002, d = 0.87) and Condition C (M = 70.1, SD = 7.9,\np \u003C .001, d = 1.07). Conditions B and C did not differ significantly\n(p = .52, d = 0.18).\n```\n\n#### Multiple Regression\n\n```\nMultiple linear regression was conducted to predict exam scores from\nstudy hours, prior GPA, and attendance. The overall model was significant,\nF(3, 146) = 45.2, p \u003C .001, R² = .48, adjusted R² = .47. Study hours\n(B = 1.80, SE = 0.31, β = .35, t = 5.78, p \u003C .001, 95% CI [1.18, 2.42])\nand prior GPA (B = 8.52, SE = 1.95, β = .28, t = 4.37, p \u003C .001,\n95% CI [4.66, 12.38]) were significant predictors, while attendance was\nnot (B = 0.15, SE = 0.12, β = .08, t = 1.25, p = .21, 95% CI [-0.09, 0.39]).\nMulticollinearity was not a concern (all VIF \u003C 1.5).\n```\n\n#### Bayesian Analysis\n\n```\nA Bayesian independent samples t-test was conducted using weakly\ninformative priors (Normal(0, 1) for mean difference). The posterior\ndistribution indicated that Group A scored higher than Group B\n(M_diff = 6.8, 95% credible interval [3.2, 10.4]). The Bayes Factor\nBF₁₀ = 45.3 provided very strong evidence for a difference between\ngroups, with a 99.8% posterior probability that Group A's mean exceeded\nGroup B's mean. Convergence diagnostics were satisfactory (all R̂ \u003C 1.01,\nESS > 1000).\n```\n\n---\n\n## Bayesian Statistics\n\n### When to Use Bayesian Methods\n\nConsider Bayesian approaches when:\n- You have prior information to incorporate\n- You want direct probability statements about hypotheses\n- Sample size is small or planning sequential data collection\n- You need to quantify evidence for the null hypothesis\n- The model is complex (hierarchical, missing data)\n\nSee `references\u002Fbayesian_statistics.md` for comprehensive guidance on:\n- Bayes' theorem and interpretation\n- Prior specification (informative, weakly informative, non-informative)\n- Bayesian hypothesis testing with Bayes Factors\n- Credible intervals vs. confidence intervals\n- Bayesian t-tests, ANOVA, regression, and hierarchical models\n- Model convergence checking and posterior predictive checks\n\n### Key Advantages\n\n1. **Intuitive interpretation**: \"Given the data, there is a 95% probability the parameter is in this interval\"\n2. **Evidence for null**: Can quantify support for no effect\n3. **Flexible**: No p-hacking concerns; can analyze data as it arrives\n4. **Uncertainty quantification**: Full posterior distribution\n\n---\n\n## Resources\n\nThis skill includes comprehensive reference materials:\n\n### References Directory\n\n- **test_selection_guide.md**: Decision tree for choosing appropriate statistical tests\n- **assumptions_and_diagnostics.md**: Detailed guidance on checking and handling assumption violations\n- **effect_sizes_and_power.md**: Calculating, interpreting, and reporting effect sizes; conducting power analyses\n- **bayesian_statistics.md**: Complete guide to Bayesian analysis methods\n- **reporting_standards.md**: APA-style reporting guidelines with examples\n\n### Scripts Directory\n\n- **assumption_checks.py**: Automated assumption checking with visualizations\n  - `comprehensive_assumption_check()`: Complete workflow\n  - `check_normality()`: Normality testing with Q-Q plots\n  - `check_homogeneity_of_variance()`: Levene's test with box plots\n  - `check_linearity()`: Regression linearity checks\n  - `detect_outliers()`: IQR and z-score outlier detection\n\n---\n\n## Best Practices\n\n1. **Pre-register analyses** when possible to distinguish confirmatory from exploratory\n2. **Always check assumptions** before interpreting results\n3. **Report effect sizes** with confidence intervals\n4. **Report all planned analyses** including non-significant results\n5. **Distinguish statistical from practical significance**\n6. **Visualize data** before and after analysis\n7. **Check diagnostics** for regression\u002FANOVA (residual plots, VIF, etc.)\n8. **Conduct sensitivity analyses** to assess robustness\n9. **Share data and code** for reproducibility\n10. **Be transparent** about violations, transformations, and decisions\n\n---\n\n## Common Pitfalls to Avoid\n\n1. **P-hacking**: Don't test multiple ways until something is significant\n2. **HARKing**: Don't present exploratory findings as confirmatory\n3. **Ignoring assumptions**: Check them and report violations\n4. **Confusing significance with importance**: p \u003C .05 ≠ meaningful effect\n5. **Not reporting effect sizes**: Essential for interpretation\n6. **Cherry-picking results**: Report all planned analyses\n7. **Misinterpreting p-values**: They're NOT probability that hypothesis is true\n8. **Multiple comparisons**: Correct for family-wise error when appropriate\n9. **Ignoring missing data**: Understand mechanism (MCAR, MAR, MNAR)\n10. **Overinterpreting non-significant results**: Absence of evidence ≠ evidence of absence\n\n---\n\n## Getting Started Checklist\n\nWhen beginning a statistical analysis:\n\n- [ ] Define research question and hypotheses\n- [ ] Determine appropriate statistical test (use test_selection_guide.md)\n- [ ] Conduct power analysis to determine sample size\n- [ ] Load and inspect data\n- [ ] Check for missing data and outliers\n- [ ] Verify assumptions using assumption_checks.py\n- [ ] Run primary analysis\n- [ ] Calculate effect sizes with confidence intervals\n- [ ] Conduct post-hoc tests if needed (with corrections)\n- [ ] Create visualizations\n- [ ] Write results following reporting_standards.md\n- [ ] Conduct sensitivity analyses\n- [ ] Share data and code\n\n---\n\n## Support and Further Reading\n\nFor questions about:\n- **Test selection**: See references\u002Ftest_selection_guide.md\n- **Assumptions**: See references\u002Fassumptions_and_diagnostics.md\n- **Effect sizes**: See references\u002Feffect_sizes_and_power.md\n- **Bayesian methods**: See references\u002Fbayesian_statistics.md\n- **Reporting**: See references\u002Freporting_standards.md\n\n**Key textbooks**:\n- Cohen, J. (1988). *Statistical Power Analysis for the Behavioral Sciences*\n- Field, A. (2013). *Discovering Statistics Using IBM SPSS Statistics*\n- Gelman, A., & Hill, J. (2006). *Data Analysis Using Regression and Multilevel\u002FHierarchical Models*\n- Kruschke, J. K. (2014). *Doing Bayesian Data Analysis*\n\n**Online resources**:\n- APA Style Guide: https:\u002F\u002Fapastyle.apa.org\u002F\n- Statistical Consulting: Cross Validated (stats.stackexchange.com)\n\n",{"name":5,"license":49,"metadata":50,"description":7},"MIT license",{"version":51,"skill-author":52},"1.0","K-Dense Inc.","main","4aa39efd1cdab0b4657ecee16c92a92011a5b10f","scientific-agent-skills\u002Fskills\u002Fstatistical-analysis","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub","https:\u002F\u002Fgithub.com\u002Ffadrienne","2026-10-28 00:43:09",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add fadrienne\u002FMyGitHub --skill statistical-analysis",{"tool":65,"command":66},"bunx","bunx skills add fadrienne\u002FMyGitHub --skill statistical-analysis",{"tool":68,"command":69},"pnpm","pnpm dlx skills add fadrienne\u002FMyGitHub --skill statistical-analysis","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fstatistical-analysis\u002FSKILL.md",true,[73,79,83,87,91,95],{"path":74,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fassumptions_and_diagnostics.md","REFERENCE","参考文档",11139,"https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fstatistical-analysis\u002Freferences\u002Fassumptions_and_diagnostics.md",{"path":80,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fbayesian_statistics.md",17443,"https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fstatistical-analysis\u002Freferences\u002Fbayesian_statistics.md",{"path":84,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Feffect_sizes_and_power.md",14969,"https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fstatistical-analysis\u002Freferences\u002Feffect_sizes_and_power.md",{"path":88,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Freporting_standards.md",19521,"https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fstatistical-analysis\u002Freferences\u002Freporting_standards.md",{"path":92,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Ftest_selection_guide.md",5077,"https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fstatistical-analysis\u002Freferences\u002Ftest_selection_guide.md",{"path":96,"resourceType":97,"resourceTypeDesc":98,"sizeBytes":99,"sourceHtmlUrl":100},"scripts\u002Fassumption_checks.py","SCRIPT","脚本",15859,"https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fstatistical-analysis\u002Fscripts\u002Fassumption_checks.py",[102,129,163,190,217,244],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":111,"publishedAt":44},"01M7167B28PK20HP7R7ZED2DY0","statistical-power","Sample size calculation, power analysis, and effect size conversion for scientific studies. Use BEFORE data collection (a priori) to determine required N, or after (post-hoc) to compute achieved power. Covers parametric tests (t-test, ANOVA, chi-square, proportions, correlation, regression), simulation-based power for complex\u002Fclustered\u002Fnested designs, and power curves. Use this skill when someone asks 'how many samples do I need', 'what is my power', 'what effect size can I detect', or any variant. Pairs with \u002Fexperimental-design (choose design first, then compute power) and \u002Fstatistical-analysis (analyze data after collection).","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fstatistical-power\u002FSKILL.md",[108],{"categoryNo":109,"categoryName":110,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[43,112,113,114,115,116,117,118,39,119,120,25,121,122,123,124,125,126,127,128],"statistical power","effect","scipy","regression","choose","design","uv","Bash","collection","calculation","ANOVA","conversion","analyze","t-test","chi-square","simulation","sample",{"skillNo":130,"name":131,"nameZh":6,"description":132,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":144,"publishedAt":44},"01M71673R93XAHFH81DBNVNG7H","scientific-writing","Core skill for the deep research and writing tool. Write scientific manuscripts in full paragraphs (never bullet points). Use two-stage process with (1) section outlines with key points using research-lookup then (2) convert to flowing prose. IMRAD structure, citations (APA\u002FAMA\u002FVancouver), figures\u002Ftables, reporting guidelines (CONSORT\u002FSTROBE\u002FPRISMA), for research papers and journal submissions.","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fscientific-writing\u002FSKILL.md",[135,138,139],{"categoryNo":136,"categoryName":137,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":109,"categoryName":110,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":140,"categoryName":141,"taxonomyType":142,"taxonomyTypeDesc":143},"01JBSEEDCAT000000000000036","内容创作者","PROFESSION","适用职业",[145,146,147,148,149,150,151,152,153,154,119,155,156,157,158,159,160,161,37,162],"writing","scientific","scientific writing","Citations","deep","deep research","never","papers","journal","false","api","prisma","structure","openrouter","Outlines","core skill","read","features",{"skillNo":164,"name":165,"nameZh":6,"description":166,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":167,"categories":168,"keywords":173,"publishedAt":44},"01M7166ZPKXBF4EBPHVTJPQBB1","scientific-visualization","Meta-skill for publication-ready figures. Use when creating journal submission figures requiring multi-panel layouts, significance annotations, error bars, colorblind-safe palettes, and specific journal formatting (Nature, Science, Cell). Orchestrates matplotlib\u002Fseaborn\u002Fplotly with publication styles. For quick exploration use seaborn or plotly directly.","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fscientific-visualization\u002FSKILL.md",[169,172],{"categoryNo":170,"categoryName":171,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000013","分析与可视化",{"categoryNo":109,"categoryName":110,"taxonomyType":21,"taxonomyTypeDesc":22},[174,146,175,176,177,178,179,180,181,153,39,182,183,184,185,186,187,188,35,189],"visualization","scientific visualization","error","ready","quick","exploration","meta-skill","Meta","safe","plotly","annotations","formatting","Publication","figures","panel","submission",{"skillNo":191,"name":192,"nameZh":6,"description":193,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":194,"categories":195,"keywords":202,"publishedAt":44},"01M7166VXJWQSSC3RQZP60WBGR","research-code","Debug, profile, review, and restructure Python research and analysis code. Use when analysis scripts crash, produce wrong results, run too slowly, or need a correctness review. Covers: reading tracebacks and diagnosing root causes, hypothesis-driven debugging, reviewing code for common statistical\u002Fnumerical errors, profiling data pipelines, improving reproducibility (seeds, environments, determinism), and structuring analysis scripts for sharing. Distinct from \u002Fexploratory-data-analysis (which understands data) and \u002Fstatistical-analysis (which chooses and runs tests) — this skill focuses on the code itself.","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fresearch-code\u002FSKILL.md",[196,199],{"categoryNo":197,"categoryName":198,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",{"categoryNo":200,"categoryName":201,"taxonomyType":142,"taxonomyTypeDesc":143},"01JBSEEDCAT000000000000030","开发工程师",[203,204,30,205,206,207,208,118,209,39,119,25,210,211,212,213,214,215,161,216],"code","research code","which","memory","data-analysis","errors","debugging","common","review","data pipelines","run","scripts","line","write",{"skillNo":218,"name":219,"nameZh":6,"description":220,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":221,"licenseFileUrl":6,"sourceHtmlUrl":222,"categories":223,"keywords":230,"publishedAt":44},"01M7166CF5HSR7SVZYZFWTDX55","markdown-mermaid-writing","Comprehensive markdown and Mermaid diagram writing skill. Use when creating any scientific document, report, analysis, or visualization. Establishes text-based diagrams as the default documentation standard with full style guides (markdown + mermaid), 24 diagram type references, and 9 document templates.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fmarkdown-mermaid-writing\u002FSKILL.md",[224,227,228,229],{"categoryNo":225,"categoryName":226,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000002","文档处理",{"categoryNo":136,"categoryName":137,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":109,"categoryName":110,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":140,"categoryName":141,"taxonomyType":142,"taxonomyTypeDesc":143},[145,231,232,233,234,235,174,236,237,39,119,25,238,239,240,241,242,243,146,161],"markdown mermaid writing","mermaid","markdown","community","diagrams","project","default","team","guides","text","documentation","references","diagram",{"skillNo":245,"name":246,"nameZh":6,"description":247,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":248,"categories":249,"keywords":258,"publishedAt":44},"01M716618J5EDTN4RW41JZ4W4Z","hypothesis-generation","Structured hypothesis formulation from observations. Use when you have experimental observations or data and need to formulate testable hypotheses with predictions, propose mechanisms, and design experiments to test them. Follows scientific method framework. For open-ended ideation use scientific-brainstorming; for automated LLM-driven hypothesis testing on datasets use hypogenic.","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fhypothesis-generation\u002FSKILL.md",[250,251,254,255],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":252,"categoryName":253,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":109,"categoryName":110,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":256,"categoryName":257,"taxonomyType":142,"taxonomyTypeDesc":143},"01JBSEEDCAT000000000000032","设计师",[259,260,261,262,263,117,154,39,264,38,119,155,158,146,265,161,162,216,266,36],"hypothesis generation","generation","hypothesis","testing","open","predictions","hypothesis formulation","edit"]