{
  "title": "Sample size calculator",
  "human_url": "https://happytails.ai/en/calculators/sample-size-calculator/",
  "agent_url": "https://happytails.ai/agents/en/calculators/sample-size-calculator/",
  "language": "en",
  "markdown_url": "https://happytails.ai/en/calculators/sample-size-calculator.md",
  "content": "Sample size calculator\nPlan completed responses and invitations for a proportion or mean, with stated confidence, precision and population assumptions.\nHow can we improve this tool?\nReport a problem or share an idea.\nPlease leave out private information. Your message and the tool name go to our team via PostHog.\nHow to use Sample size calculator\nEnter the observations or summary values.\nChoose the method and check its assumptions.\nReview the result and download the calculation.\nUseful next steps\nConfidence interval calculator\nProbability calculator\nChoose the model before reading the result\nPlan completed responses and invitations for a proportion or mean, with stated confidence, precision and population assumptions.\nCheck the assumptions\nNormal-approximation precision planning, not a power analysis. Confidence 50–99.99%; finite populations up to one billion. Expected proportions must be strictly between 0 and 100%. A low expected event count triggers a warning. Invitations can exceed the available population and are flagged.\nKeep the calculation\nDownload the JSON for unrounded results and settings, CSV for the table, and the separate assumptions note. The calculation runs in your browser.",
  "content_format": "text/plain",
  "visibility": "public",
  "links": [
    {
      "name": "Confidence interval calculator",
      "url": "https://happytails.ai/en/calculators/confidence-interval-calculator/"
    },
    {
      "name": "Probability calculator",
      "url": "https://happytails.ai/en/calculators/probability-calculator/"
    }
  ],
  "tool": {
    "id": "sample-size-calculator",
    "category": "calculators",
    "built": true,
    "requirements": "Normal-approximation precision planning, not a power analysis. Confidence 50–99.99%; finite populations up to one billion. Expected proportions must be strictly between 0 and 100%. A low expected event count triggers a warning. Invitations can exceed the available population and are flagged.",
    "implementation": {
      "fields": [
        {
          "key": "method",
          "label": "Plan an estimate of",
          "value": "Proportion",
          "type": "select",
          "values": [
            "Proportion",
            "Mean (known planning SD)"
          ]
        },
        {
          "key": "confidence",
          "label": "Confidence level (%)",
          "value": 95,
          "type": "number",
          "min": 50,
          "max": 99.99,
          "step": "any"
        },
        {
          "key": "margin",
          "label": "Margin of error",
          "value": 5,
          "type": "number",
          "min": 1e-08,
          "max": 1000000000000,
          "step": "any",
          "help": "For a proportion, use percentage points: 5 means ±5 points. For a mean, use the measurement units."
        },
        {
          "key": "proportion",
          "label": "Expected proportion (%)",
          "value": 50,
          "type": "number",
          "min": 0.001,
          "max": 99.999,
          "step": "any",
          "help": "Use 50% when unsure. Very rare outcomes may make normal-approximation planning unreliable.",
          "showWhen": {
            "method": [
              "Proportion"
            ]
          }
        },
        {
          "key": "sd",
          "label": "Planning standard deviation",
          "value": 10,
          "type": "number",
          "min": 1e-12,
          "max": 1000000000000,
          "step": "any",
          "showWhen": {
            "method": [
              "Mean (known planning SD)"
            ]
          }
        },
        {
          "key": "population",
          "label": "Finite population (optional)",
          "value": "",
          "type": "number",
          "min": 2,
          "max": 1000000000,
          "step": 1,
          "required": false
        },
        {
          "key": "designEffect",
          "label": "Design effect",
          "value": 1,
          "type": "number",
          "min": 0.01,
          "max": 1000,
          "step": "any"
        },
        {
          "key": "responseRate",
          "label": "Expected response rate (%)",
          "value": 100,
          "type": "number",
          "min": 0.01,
          "max": 100,
          "step": "any"
        }
      ],
      "note": "Estimate required completed responses for precision, not hypothesis-test power. Population correction assumes random sampling without replacement. Response-rate planning does not guarantee enough responses.",
      "input": false,
      "live": true,
      "presentation": "metrics",
      "background": false,
      "inputMaxLength": 1000000,
      "inputErrorCode": "STAT_SIZE",
      "experience": {
        "automatic": true,
        "single": false,
        "inputMaxLength": 1000000,
        "inputMode": "text",
        "label": "Your text",
        "placeholder": "Type or paste your input…",
        "help": "Change the input or settings to update your result. Results update as you type. Up to 1,000,000 characters.",
        "action": null
      },
      "mode": "automatic",
      "interactive": false
    },
    "execution": "Browser interface",
    "api": null,
    "browser_agent": {
      "supported": true,
      "name": "run_current_tool",
      "discovery": "WebMCP on the human page in a supporting browser",
      "verification": "See audit/API-AUDIT.md; availability is not verification"
    }
  },
  "markdown": "# Sample size calculator\n\n- Human page: https://happytails.ai/en/calculators/sample-size-calculator/\n- Markdown: https://happytails.ai/en/calculators/sample-size-calculator.md\n- Structured JSON: https://happytails.ai/agents/en/calculators/sample-size-calculator/index.json\n- Visibility: public\n\n## Tool capabilities\n\n| Property | Value |\n| --- | --- |\n| Tool ID | `sample-size-calculator` |\n| Category | calculators |\n| Implementation | Registered implementation. Registration alone is not a production-quality guarantee. |\n| Browser execution | Automatic updates after valid input or file selection. |\n| Browser processing | Browser; see tool notes for network behavior. |\n| HTTP API | Not callable through HTTP. |\n| Browser-agent interface | run_current_tool |\n\n### Implementation notes\n\nEstimate required completed responses for precision, not hypothesis-test power. Population correction assumes random sampling without replacement. Response-rate planning does not guarantee enough responses.\n\n### Inputs and settings\n\nNo free-text input is required. Use the file inputs and/or settings below.\n\n| Setting | Meaning | Control type | Default | Constraints |\n| --- | --- | --- | --- | --- |\n| `method` | Plan an estimate of | select | \"Proportion\" | Allowed: Proportion, Mean (known planning SD) |\n| `confidence` | Confidence level (%) | number | 95 | min=50 max=99.99 step=any |\n| `margin` | Margin of error | number | 5 | min=1e-08 max=1000000000000 step=any |\n| `proportion` | Expected proportion (%) | number | 50 | min=0.001 max=99.999 step=any |\n| `sd` | Planning standard deviation | number | 10 | min=1e-12 max=1000000000000 step=any |\n| `population` | Finite population (optional) | number | \"\" | min=2 max=1000000000 step=1 |\n| `designEffect` | Design effect | number | 1 | min=0.01 max=1000 step=any |\n| `responseRate` | Expected response rate (%) | number | 100 | min=0.01 max=100 step=any |\n\n### Browser-agent workflow\n\n1. Open the human page in a browser that supports WebMCP.\n2. Discover the interface exposed by that page; use its actual schema.\n3. Select files on the page first when the tool requires files.\n4. Call `run_current_tool` with valid input and settings.\n5. Inspect the returned result or error and the displayed output. Retrieve files from the displayed download links.\n\nCalls do not automatically copy or download results. Browser permissions still apply. Interface availability alone is not proof of successful execution.\n\n### Planning specification\n\nNormal-approximation precision planning, not a power analysis. Confidence 50–99.99%; finite populations up to one billion. Expected proportions must be strictly between 0 and 100%. A low expected event count triggers a warning. Invitations can exceed the available population and are flagged.\n\nThis describes intended requirements. Use the implementation notes, interface schema and observed output to determine current support.\n\n### Complete machine-readable capability record\n\n```json\n{\n  \"id\": \"sample-size-calculator\",\n  \"category\": \"calculators\",\n  \"built\": true,\n  \"requirements\": \"Normal-approximation precision planning, not a power analysis. Confidence 50–99.99%; finite populations up to one billion. Expected proportions must be strictly between 0 and 100%. A low expected event count triggers a warning. Invitations can exceed the available population and are flagged.\",\n  \"implementation\": {\n    \"fields\": [\n      {\n        \"key\": \"method\",\n        \"label\": \"Plan an estimate of\",\n        \"value\": \"Proportion\",\n        \"type\": \"select\",\n        \"values\": [\n          \"Proportion\",\n          \"Mean (known planning SD)\"\n        ]\n      },\n      {\n        \"key\": \"confidence\",\n        \"label\": \"Confidence level (%)\",\n        \"value\": 95,\n        \"type\": \"number\",\n        \"min\": 50,\n        \"max\": 99.99,\n        \"step\": \"any\"\n      },\n      {\n        \"key\": \"margin\",\n        \"label\": \"Margin of error\",\n        \"value\": 5,\n        \"type\": \"number\",\n        \"min\": 1e-08,\n        \"max\": 1000000000000,\n        \"step\": \"any\",\n        \"help\": \"For a proportion, use percentage points: 5 means ±5 points. For a mean, use the measurement units.\"\n      },\n      {\n        \"key\": \"proportion\",\n        \"label\": \"Expected proportion (%)\",\n        \"value\": 50,\n        \"type\": \"number\",\n        \"min\": 0.001,\n        \"max\": 99.999,\n        \"step\": \"any\",\n        \"help\": \"Use 50% when unsure. Very rare outcomes may make normal-approximation planning unreliable.\",\n        \"showWhen\": {\n          \"method\": [\n            \"Proportion\"\n          ]\n        }\n      },\n      {\n        \"key\": \"sd\",\n        \"label\": \"Planning standard deviation\",\n        \"value\": 10,\n        \"type\": \"number\",\n        \"min\": 1e-12,\n        \"max\": 1000000000000,\n        \"step\": \"any\",\n        \"showWhen\": {\n          \"method\": [\n            \"Mean (known planning SD)\"\n          ]\n        }\n      },\n      {\n        \"key\": \"population\",\n        \"label\": \"Finite population (optional)\",\n        \"value\": \"\",\n        \"type\": \"number\",\n        \"min\": 2,\n        \"max\": 1000000000,\n        \"step\": 1,\n        \"required\": false\n      },\n      {\n        \"key\": \"designEffect\",\n        \"label\": \"Design effect\",\n        \"value\": 1,\n        \"type\": \"number\",\n        \"min\": 0.01,\n        \"max\": 1000,\n        \"step\": \"any\"\n      },\n      {\n        \"key\": \"responseRate\",\n        \"label\": \"Expected response rate (%)\",\n        \"value\": 100,\n        \"type\": \"number\",\n        \"min\": 0.01,\n        \"max\": 100,\n        \"step\": \"any\"\n      }\n    ],\n    \"note\": \"Estimate required completed responses for precision, not hypothesis-test power. Population correction assumes random sampling without replacement. Response-rate planning does not guarantee enough responses.\",\n    \"input\": false,\n    \"live\": true,\n    \"presentation\": \"metrics\",\n    \"background\": false,\n    \"inputMaxLength\": 1000000,\n    \"inputErrorCode\": \"STAT_SIZE\",\n    \"experience\": {\n      \"automatic\": true,\n      \"single\": false,\n      \"inputMaxLength\": 1000000,\n      \"inputMode\": \"text\",\n      \"label\": \"Your text\",\n      \"placeholder\": \"Type or paste your input…\",\n      \"help\": \"Change the input or settings to update your result. Results update as you type. Up to 1,000,000 characters.\",\n      \"action\": null\n    },\n    \"mode\": \"automatic\",\n    \"interactive\": false\n  },\n  \"execution\": \"Browser interface\",\n  \"api\": null,\n  \"browser_agent\": {\n    \"supported\": true,\n    \"name\": \"run_current_tool\",\n    \"discovery\": \"WebMCP on the human page in a supporting browser\",\n    \"verification\": \"See audit/API-AUDIT.md; availability is not verification\"\n  }\n}\n```\n\n## Page guide\n\nPlan completed responses and invitations for a proportion or mean, with stated confidence, precision and population assumptions.\n\nHow can we improve this tool?\n\nReport a problem or share an idea.\n\nPlease leave out private information. Your message and the tool name go to our team via PostHog.\n\n### How to use Sample size calculator\n\n1. Enter the observations or summary values.\n2. Choose the method and check its assumptions.\n3. Review the result and download the calculation.\n\n## Useful next steps\n\n- [Confidence interval calculator](https://happytails.ai/en/calculators/confidence-interval-calculator/) ([Markdown](https://happytails.ai/en/calculators/confidence-interval-calculator.md))\n\n- [Probability calculator](https://happytails.ai/en/calculators/probability-calculator/) ([Markdown](https://happytails.ai/en/calculators/probability-calculator.md))\n\n## Choose the model before reading the result\n\nPlan completed responses and invitations for a proportion or mean, with stated confidence, precision and population assumptions.\n\n### Check the assumptions\n\nNormal-approximation precision planning, not a power analysis. Confidence 50–99.99%; finite populations up to one billion. Expected proportions must be strictly between 0 and 100%. A low expected event count triggers a warning. Invitations can exceed the available population and are flagged.\n\n### Keep the calculation\n\nDownload the JSON for unrounded results and settings, CSV for the table, and the separate assumptions note. The calculation runs in your browser.\n"
}