{"id":50520996,"url":"https://github.com/kimmingul/samplesize-copilot","last_synced_at":"2026-06-03T04:01:50.903Z","repository":{"id":360135883,"uuid":"1248805579","full_name":"kimmingul/samplesize-copilot","owner":"kimmingul","description":"Sample-size \u0026 power calculator — Python package + Claude Code plugin","archived":false,"fork":false,"pushed_at":"2026-05-25T13:34:11.000Z","size":613,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-25T15:24:01.497Z","etag":null,"topics":["biostatistics","claude-code","claude-code-plugin","clinical-trials","hypothesis-testing","power-analysis","power-calculation","python","sample-size","scipy","statistics","study-design"],"latest_commit_sha":null,"homepage":"https://kimmingul.github.io/samplesize-copilot/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kimmingul.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-25T04:19:15.000Z","updated_at":"2026-05-25T13:32:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kimmingul/samplesize-copilot","commit_stats":null,"previous_names":["kimmingul/samplesize","kimmingul/samplesize-copilot"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/kimmingul/samplesize-copilot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimmingul%2Fsamplesize-copilot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimmingul%2Fsamplesize-copilot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimmingul%2Fsamplesize-copilot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimmingul%2Fsamplesize-copilot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kimmingul","download_url":"https://codeload.github.com/kimmingul/samplesize-copilot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimmingul%2Fsamplesize-copilot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33847265,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["biostatistics","claude-code","claude-code-plugin","clinical-trials","hypothesis-testing","power-analysis","power-calculation","python","sample-size","scipy","statistics","study-design"],"created_at":"2026-06-03T04:01:49.473Z","updated_at":"2026-06-03T04:01:50.899Z","avatar_url":"https://github.com/kimmingul.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# samplesize-copilot — Sample-size and power calculations for clinical and applied research\n\n[![CI](https://github.com/kimmingul/samplesize-copilot/actions/workflows/ci.yml/badge.svg)](https://github.com/kimmingul/samplesize-copilot/actions/workflows/ci.yml)\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)\n[![Python](https://img.shields.io/badge/python-3.11%2B-blue)](pyproject.toml)\n[![Methods](https://img.shields.io/badge/methods-234-brightgreen)](docs/METHOD_COVERAGE.md)\n[![Tests](https://img.shields.io/badge/tests-819%20passing-brightgreen)](tests/validation/test_fixture_consistency.py)\n\nA Python package + Claude Code plugin implementing 234 sample-size and power-calculation\nmethods validated against worked examples from established statistical references.\n\n## Status\n\n**v0.1 — 234 methods implemented and validated, 819 worked-example fixture tests passing.**\nDoctor passes 9/9 integrity checks across registry, callables, plugin manifest, and\nreporting templates. Roadmap in `docs/ROADMAP.md`; live coverage matrix in\n`docs/METHOD_COVERAGE.md`.\n\n## Layout\n\n```\nsamplesize-copilot/\n├── samplesize/             # Python package — pure-Python calculators\n│   ├── core/               # distributions, effect sizes, adjustments\n│   ├── tests/              # per-method calculator modules\n│   ├── reporting/          # plots, tables, protocol text, audit, R/SAS export\n│   │   └── templates/      # i18n templates (protocol.en.yaml, protocol.ko.yaml, ...)\n│   ├── registry/           # methods.json — categorical metadata only\n│   ├── cli.py              # `python -m samplesize ...`\n│   └── doctor.py           # `samplesize doctor` integrity checks\n├── plugin/                 # Claude Code plugin\n│   ├── .claude-plugin/plugin.json\n│   ├── skills/             # design / calculate / report / validate\n│   ├── commands/           # /ss-design, /ss-calc, /ss-power, /ss-curve, /ss-report\n│   └── agents/             # methodologist, calculator, validator\n├── reference/              # Local-only knowledge base (gitignored, user-supplied)\n│   └── ...                 # Validation reference material — not bundled in repo\n├── tests/                  # pytest suites\n│   ├── validation/         # worked-example regression tests\n│   └── unit/               # registry / doctor / signature parity\n└── docs/                   # ARCHITECTURE, ROADMAP, METHOD_COVERAGE, COOKBOOK, TROUBLESHOOTING\n```\n\n## Installation\n\n```sh\npip install -e \".[dev]\"\n```\n\n## Quick start\n\n```sh\nsamplesize list                                          # available methods\nsamplesize show two_sample_t_equal_var                   # full metadata + kwargs\nsamplesize calc two_sample_t_equal_var \\\n  --json-args '{\"mean1\":10,\"mean2\":0,\"sd\":20,\"alpha\":0.05,\"power\":0.80,\"sides\":2}'\n# → n1=64, n2=64, achieved_power=0.8015; audit JSON saved\n\n# follow-ups on the audit just printed\nAUDIT=$(ls -t .samplesize/audit/*.json | head -1)\nsamplesize report \"$AUDIT\" --kind power-curve --out curve.png\nsamplesize report \"$AUDIT\" --kind protocol --lang en\nsamplesize report \"$AUDIT\" --kind sensitivity --vary \"sd=15,20,25,30\"\nsamplesize report \"$AUDIT\" --kind r-code        # pwr::pwr.t.test(...) equivalent\nsamplesize report \"$AUDIT\" --kind sas-code      # PROC POWER equivalent\n\n# sanity gate\nsamplesize doctor\n```\n\n**More recipes.** `docs/COOKBOOK.md` has 15 worked study scenarios\n(RCT, NI, equivalence, survival, Cox, McNemar, χ², ANOVA, correlation).\nHit an error? `docs/TROUBLESHOOTING.md`.\n\n## Using inside Claude Code (plugin)\n\nTwo ways to make the slash commands and skills available:\n\n**Ephemeral — load for one session**:\n```sh\nclaude --plugin-dir /path/to/samplesize-copilot/plugin\n```\n\n**Persistent — register the marketplace and install**:\n```sh\nclaude plugin marketplace add kimmingul/samplesize-copilot   # from GitHub\n# …or from a local clone (repo root): claude plugin marketplace add /path/to/samplesize-copilot\nclaude plugin install samplesize-copilot@samplesize-copilot  # requires CC ≥ 2.2\n```\n\nOnce loaded, these commands work inside Claude Code:\n\n- `/samplesize-copilot:ss-design \u003cstudy description\u003e` — pick the right test\n- `/samplesize-copilot:ss-calc \u003cmethod\u003e ...` — run a calculation\n- `/samplesize-copilot:ss-power ...` — solve for power at fixed N\n- `/samplesize-copilot:ss-curve` — emit a power-curve PNG for the latest result\n- `/samplesize-copilot:ss-report` — generate ICH E9 protocol / grant text\n- `/samplesize-copilot:ss-validate \u003cmethod?\u003e` — run worked-example validation tests\n\n## Coverage\n\n234 methods across:\n\n- Means (one-sample, two-sample, paired, non-inferiority, equivalence, superiority-by-margin)\n- Proportions (one, two, McNemar, NI/equivalence variants)\n- Correlation (Pearson exact and Fisher-z)\n- ANOVA / GLM (one-way F, chi-square)\n- Survival (logrank Freedman, Cox regression Hsieh-Lavori)\n- Group-sequential (O'Brien-Fleming, Pocock alpha-spending)\n- Cluster-randomized (two means, two proportions, Donner-Klar)\n- Cross-over (2×2 design)\n- Phase II (Simon two-stage)\n- ROC / diagnostic\n- And more — see `docs/METHOD_COVERAGE.md`\n\n## Validation\n\n819 fixture tests passing. Methods are validated against worked examples from\nestablished statistical software references. Reference content itself is\nuser-supplied (see `reference/` — not bundled in this repository).\n\nFixtures live under `tests/validation/fixtures/\u003cmethod_id\u003e.yaml`.\n\n```sh\npytest tests/validation/\n```\n\n## License\n\nApache License 2.0 — see `LICENSE`.\n\n## Acknowledgments\n\nMethod implementations draw on the primary statistical literature, including:\n\n- Cohen, J. (1988). *Statistical Power Analysis for the Behavioral Sciences* (2nd ed.)\n- Donner, A. \u0026 Klar, N. (1996). Statistical considerations in the design and analysis of community intervention trials.\n- Hsieh, F. Y. \u0026 Lavori, P. W. (2000). Sample-size calculations for the Cox proportional hazards regression model with nonbinary covariates.\n- Schoenfeld, D. (1981). The asymptotic properties of nonparametric tests for comparing survival distributions.\n- Bonett, D. G. \u0026 Wright, T. A. (2000). Sample size requirements for estimating Pearson, Kendall and Spearman correlations.\n- Hanley, J. A. \u0026 McNeil, B. J. (1982). The meaning and use of the area under a receiver operating characteristic (ROC) curve.\n- Simon, R. (1989). Optimal two-stage designs for phase II clinical trials.\n- Wang, S. K. \u0026 Tsiatis, A. A. (1987). Approximately optimal one-parameter boundaries for group sequential trials.\n- Flack, V. F. et al. (1988). Sample size determinations for the two rater kappa statistic.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimmingul%2Fsamplesize-copilot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkimmingul%2Fsamplesize-copilot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimmingul%2Fsamplesize-copilot/lists"}