{"schemaVersion":"1.1.0","slug":"tool-sample-size-calculator","identifier":"csdata:tool-sample-size-calculator:1.0.0","title":"ConductScience Sample Size & Power Calculator: method and validation record","shortDescription":"The calculation behind ConductScience's free sample size and power calculator, with six worked examples that check it.","description":"Method and validation record for the free Sample Size & Power Calculator at conductscience.com/tools/sample-size-calculator. For two-sided tests, the tool computes the sample size needed for a target power, or the power reached with a given sample size: exactly from the noncentral t distribution for independent and paired t-tests given Cohen's d, and from the normal approximation for two proportions. Five t-test examples, including a very small effect (d = 0.1), are checked against the exact method G*Power uses (Faul et al. 2007), and one two-proportion example is worked by hand. The page's ANOVA option is an approximation and is not part of this record. The record holds the calculation source files, the worked examples, a validation report with each file's SHA-256, and what changed on the tool page when the record was written.","creators":[{"name":"ConductScience","type":"Organization"}],"publishedAt":"2026-09-28","updatedAt":"2026-09-28","version":"1.0.0","doi":"10.55157/csd.tool.samplesize.2026.001","doiProvider":"Crossref","doiRegisteredAt":"2026-09-28T13:42:23Z","doiRegisteredLocalDate":"2026-09-28","doiRegistrationTimeZone":"America/New_York","doiVerifiedAt":"2026-09-28T14:13:25Z","access":"open","license":{"name":"MIT and CC BY 4.0"},"licenseLabel":"MIT (code); CC BY 4.0 (text, worked examples and reports)","rightsStatement":"The calculation source files in engine/ are released under the MIT License. The record text, worked examples and validation report are released under CC BY 4.0. Cite the record when you use the files.","subjects":["Research software","Method validation","Statistics","Study design"],"methods":["Worked examples: each of the six cases gives its inputs, the expected outputs, the source and passage behind the expected answer, and the arithmetic. Expected answers for the t-tests were recomputed with SciPy 1.17.1 by the exact method G*Power uses; the two-proportion example is worked by hand. Cases whose ids start with edge- test inputs at the limits of the method.","Check: each case was run in Node.js 24 through the tool's calculation source files, and every output was compared with its expected value, exactly or within the tolerance the case states. All six cases pass (validation-report.json), and ConductScience's test suite runs the same cases whenever the tool changes.","Fingerprint: the validation report gives the byte count and SHA-256 of each calculation file and of the files that ran the check, and engine/ holds those files, so anyone can rerun the cases and tell whether a later version of the calculation differs from this one."],"source":{"repository":"https://github.com/ConductScienceInc/csd-tool-sample-size-calculator","tag":"v1.0.0","commit":"bda2c69a30ac6e7d514d7bcdab7c6f2d4d9f1606","releasedAt":"2026-09-28T13:12:20Z"},"basedOn":"https://conductscience.com/tools/sample-size-calculator","manifest":{"files":17,"bytes":44836,"sha256":"c56ab8eab21ee72d9d5710ebe14e74dec9f3c92f96a77afb16c29481b7f97461"},"archive":{"entries":18,"bytes":19737,"sha256":"757be23b051f1a16d2f83f3c8c4cb8314ee16c2a236162636006afe09e0900f9"},"files":[{"name":"tool-sample-size-calculator-record-1.0.0.zip","url":"/data/records/tool-sample-size-calculator/1.0.0/tool-sample-size-calculator-record-1.0.0.zip","mediaType":"application/zip","sizeBytes":19737,"sha256":"757be23b051f1a16d2f83f3c8c4cb8314ee16c2a236162636006afe09e0900f9","description":"Complete frozen release: 17 source-manifest files plus MANIFEST.json."},{"name":"cases.csv","url":"/data/records/tool-sample-size-calculator/1.0.0/cases.csv","mediaType":"text/csv","sizeBytes":2865,"sha256":"69e1d8310678ac08957d27b48fc6e01469865f551794ed669c332e24f4c46197","description":"The worked examples, one row each: what the case checks, the source of the expected answer, the expected outputs and whether the engine matched them."},{"name":"cases.json","url":"/data/records/tool-sample-size-calculator/1.0.0/cases.json","mediaType":"application/json","sizeBytes":5853,"sha256":"26a605531eb010c7f84fc6767ec6980893db5cf5497f586c97cac0b271250e36","description":"The worked examples in full: inputs, expected outputs, tolerances, source passage and the arithmetic behind each expected answer."},{"name":"validation-report.json","url":"/data/records/tool-sample-size-calculator/1.0.0/validation-report.json","mediaType":"application/json","sizeBytes":2760,"sha256":"7512fd73f4e25d751c6acd1205383b3a3227a7f9680dab43ac9f646aa9278ae3","description":"The engine's output for every case, pass or fail, with the byte count and SHA-256 of each calculation and harness file."},{"name":"data_dictionary.csv","url":"/data/records/tool-sample-size-calculator/1.0.0/data_dictionary.csv","mediaType":"text/csv","sizeBytes":472,"sha256":"96b57ee5185ffcccc5397d98673c42bbc53ff77cc7f676fe5789ef04a7648090","description":"Columns of cases.csv."},{"name":"README.md","url":"/data/records/tool-sample-size-calculator/1.0.0/README.md","mediaType":"text/markdown","sizeBytes":1853,"sha256":"2b6d7ffb8ba6f538da20fdf68f0da54185a29487c599c0df475ae7739dc66876","description":"What the tool computes, the files, and how to cite the record."},{"name":"METHODS.md","url":"/data/records/tool-sample-size-calculator/1.0.0/METHODS.md","mediaType":"text/markdown","sizeBytes":4560,"sha256":"aa3d3e7ee496c49b75914e69812f7529ff0674ed074298be2c194e028e6e518a","description":"Formulas, input rules, conventions, references and what changed on the tool page."},{"name":"MANIFEST.json","url":"/data/records/tool-sample-size-calculator/1.0.0/MANIFEST.json","mediaType":"application/json","sizeBytes":2684,"sha256":"c56ab8eab21ee72d9d5710ebe14e74dec9f3c92f96a77afb16c29481b7f97461","description":"Byte count and SHA-256 for every file in the source release."},{"name":"CITATION.cff","url":"/data/records/tool-sample-size-calculator/1.0.0/CITATION.cff","mediaType":"text/yaml","sizeBytes":420,"sha256":"5a6a6cac7953635b8086931677e06d738a62b7605c327c706b48288f32c90e7f","description":"Citation metadata."},{"name":"LICENSE","url":"/data/records/tool-sample-size-calculator/1.0.0/LICENSE","mediaType":"text/plain","sizeBytes":1361,"sha256":"d2dca2297cc985f3577b9376fbf5a72231ac88be401776098486f6d1e8a4d87a","description":"MIT License for the calculation source files; CC BY 4.0 for everything else."},{"name":"deposit-receipt.json","url":"/data/records/tool-sample-size-calculator/1.0.0/deposit-receipt.json","mediaType":"application/json","sizeBytes":3045,"sha256":"b6991d3998709a590fa57c1f544eeb3402360e2e21854f1a7852b782a99f2a25","description":"ConductScience verification and packaging receipt."}],"previewFile":"cases.csv","preview":{"columns":["id","title","source_type","expected","pass"],"rows":[["cross-check-two-sample-d05","Two independent groups, medium effect (d = 0.5), 80% power, alpha 0.05","cross-check","{\"sampleSizePerGroup\":64}","true"],["cross-check-paired-d05","Paired design, medium effect (d = 0.5), 80% power, alpha 0.05","cross-check","{\"sampleSizePerGroup\":34}","true"],["cross-check-two-sample-d20","Two independent groups, very large effect (d = 2.0), 80% power, alpha 0.05","cross-check","{\"sampleSizePerGroup\":6}","true"],["cross-check-power-two-sample-d20-n5","Achieved power with 5 per group at d = 2.0, alpha 0.05","cross-check","{\"power\":0.790542}","true"],["hand-worked-proportions","Two proportions, 50% against 30%, 80% power, alpha 0.05","hand-worked","{\"sampleSizePerGroup\":93}","true"],["edge-tiny-effect","Two independent groups, very small effect (d = 0.1), 80% power, alpha 0.05","cross-check","{\"sampleSizePerGroup\":1571}","true"]]},"dataDictionary":[{"file":"cases.csv","description":"One row per worked example.","columns":[{"name":"id","type":"string","values":"e.g. cross-check-two-sample-d05","description":"Case identifier; edge cases start with \"edge-\""},{"name":"title","type":"string","values":"","description":"What the case checks"},{"name":"source_type","type":"string","values":"cross-check, hand-worked","description":"Where the expected answer comes from: published, hand-worked, analytic or cross-check"},{"name":"citation","type":"string","values":"","description":"Source of the method or the expected answer"},{"name":"locator","type":"string","values":"","description":"Section, formula or table of the source that the case relies on"},{"name":"expected","type":"JSON object","values":"null: not computable","description":"Expected outputs as JSON; null means not computable"},{"name":"pass","type":"boolean","values":"true, false","description":"true when every expected output matched the engine within the stated tolerance"}]},{"file":"cases.json","description":"The worked examples in full: inputs, expected outputs, tolerances, source passage and the arithmetic behind each expected answer.","columns":[]},{"file":"validation-report.json","description":"The engine's output for every case, pass or fail, with the byte count and SHA-256 of each calculation and harness file.","columns":[]},{"file":"engine/pilot-tools.ts","description":"Harness source (MIT). Slugs of the ten tools with validation records; the check accepts only these.","columns":[]},{"file":"engine/sample-size/calculator.ts","description":"Calculation source (MIT). Sample size and power for t-tests (exact) and two proportions (normal approximation).","columns":[]},{"file":"engine/sample-size/noncentral-t.ts","description":"Calculation source (MIT). The noncentral t distribution used for exact t-test power.","columns":[]},{"file":"engine/sample-size/normal.ts","description":"Calculation source (MIT). Normal distribution function (Abramowitz and Stegun, formula 26.2.17).","columns":[]},{"file":"engine/sample-size/types.ts","description":"Calculation source (MIT). Types for inputs and results.","columns":[]},{"file":"engine/validation/run.ts","description":"Harness source (MIT). Runs one case: passes its inputs to the tool's adapter and compares each output with the expected value within the tolerance.","columns":[]},{"file":"engine/validation/tools/sample-size-calculator.ts","description":"Harness source (MIT). Adapter from a case's inputs to this tool's calculation, returning the outputs the cases check.","columns":[]},{"file":"engine/validation/types.ts","description":"Harness source (MIT). Types for cases, tolerances and results.","columns":[]}],"citation":"ConductScience. (2026). ConductScience Sample Size & Power Calculator: method and validation record (Version 1.0.0) [Data set]. ConductScience Data. https://doi.org/10.55157/csd.tool.samplesize.2026.001","relatedResearch":[{"title":"ConductScience Sample Size & Power Calculator (live tool)","url":"https://conductscience.com/tools/sample-size-calculator","relation":"Documents"},{"title":"Faul, Erdfelder, Lang and Buchner (2007). G*Power 3: a flexible statistical power analysis program for the social, behavioral, and biomedical sciences","url":"https://doi.org/10.3758/BF03193146","relation":"Reference source"},{"title":"Guenther (1981). Sample size formulas for normal theory t tests","url":"https://doi.org/10.1080/00031305.1981.10479363","relation":"Reference source"},{"title":"Virtanen et al. (2020). SciPy 1.0: fundamental algorithms for scientific computing in Python","url":"https://doi.org/10.1038/s41592-019-0686-2","relation":"Reference source"}]}