# Sample Size Desk > How many do you need, and how do you assign them: describe a planned comparison, choose the test, the effect size, alpha and power, and the browser computes the sample size, the power curve, the minimum detectable effect and the enrolment after dropout and clustering, and generates a seeded randomisation schedule, for free; then the model drafts the sample-size justification your protocol needs, or the design and randomisation section, from those numbers alone. For study planning and education; not a substitute for a statistician or ethics committee (IRB/REC) review. Live at https://sample-size-desk.skillsafe.ai/ · API tutorial at https://sample-size-desk.skillsafe.ai/api.html · Tokens at https://sample-size-desk.skillsafe.ai/tokens.html ## What it does One work object: a study description plus a test specification. Tests: two independent means (t), paired and one-sample t, two independent proportions and one proportion (arcsine, Cohen's h), one-way ANOVA (Cohen's f), Pearson correlation (Fisher z with the small-sample term, as pwr.r.test), chi-square (Cohen's w), regression increment (F test, Cohen's f2). Solve for n, for the minimum detectable effect at a fixed n, or for the power of a fixed n. Adjustments: unequal allocation, Bonferroni alpha over m tests, design effect 1 + (m - 1) ICC, dropout inflation of enrolment. The free engine (no account, no model): the noncentral t (AS 243), noncentral F and noncentral chi-square as Poisson mixtures, the regularised incomplete beta and gamma, Acklam's inverse normal with a Halley step. Two-sided power counts both rejection tails; sample sizes are the smallest integers that reach the target. Output: n per group and total, total after the design effect, enrolment after dropout, achieved power, a sensitivity table across 0.6x to 1.6x the effect, a power curve across n, and a second textbook method as a cross-check (the z shortcut for t tests; the pooled-variance formula for two proportions). Seeded randomisation: simple, permuted blocks with sizes drawn at random from the allowed multiples, stratified permuted blocks with a stream per stratum, cluster; counts per arm, largest imbalance during enrolment, longest run, a randomised run order in batches; CSV export. Two metered lanes (gpt-terra, one system prompt with a task router): - `justify` - the sample-size justification for a grant, IRB protocol or pre-registration: a verdict (defensible, defensible_with_changes, not_defensible), the protocol statement built only from the computed figures, a rating of the effect-size basis (SESOI, pilot, convention, unstated), six adjustments each judged applied / missing / not needed, a reading of the sensitivity table and the cross-check, nine named pitfalls each judged, and a check of the user's own draft paragraph. - `layout` - the design and randomisation section: the design named and argued, the unit of randomisation, what is measured and the level of a true replicate with a pseudoreplication verdict, each nuisance factor and how the schedule handles it, a reading of the generated schedule, the protocol text with the seed, and controls and blinding. Handoffs: "Lay out the design with this n" carries the justification's enrolment into the layout lane; "Now justify the sample size" goes the other way. Every number the model writes is read back against the engine and disagreements are shown. ## The contract Run body: `{ "task": "justify" | "layout", "study": string, "effect_basis": "sesoi" | "pilot" | "convention" | "unstated", "effect_source": string, "draft": string, "unit": string (layout), "measured": string (layout), "nuisance": string (layout), "facts": string }` where `facts` is the JSON the browser engine computed (`Power.plan`, plus `layout` from `Design.layout` in the layout lane). The reply is one JSON object with `lane`, `title`, `headline`, `verdict`, `summary`, `notes_on_input`, `risks`, `next_steps`, `draft_check` and the lane body (`statement`, `effect_basis`, `adjustments`, `sensitivity_reading`, `pitfalls` for justify; `design`, `unit`, `nuisance`, `schedule_reading`, `protocol_text`, `controls_and_blinding` for layout). ## Sources Derived from two agent skills in k-dense-ai/scientific-agent-skills (MIT; licence text at https://sample-size-desk.skillsafe.ai/LICENSE-K-DENSE-SCIENTIFIC-AGENT-SKILLS.txt): @k-dense-ai/statistical-power (https://skillsafe.ai/skill/@k-dense-ai/statistical-power/) and @k-dense-ai/experimental-design (https://skillsafe.ai/skill/@k-dense-ai/experimental-design/). Methods: Cohen (1988), Lenth (1989) AS 243, Lakens (2022), Fisher (1935), Montgomery (2019), Hurlbert (1984). The engine was verified against R 4.4.2 stats (power.t.test, power.prop.test, power.anova.test, pt/pf/pchisq with ncp) and pwr 1.3 on 1,277 checks to 1e-9, with three controls that must and do fail: the z shortcut against the exact t, the arcsine against the pooled-variance formula, one rejection tail against two. The randomisation engine was verified against an independent Python check of block-boundary balance, within-block uniformity over 600 seeds, stratum independence, cluster permutation and determinism, with simple randomisation as the control that must fail block balance. A planning and teaching aid, not a substitute for a statistician or ethics review on a clinical trial or any regulated study; not affiliated with K-Dense or the skill's authors.