Catalog/stat-tukey-hsd

Statistics

Tukey HSD post-hoc API

Runs Tukey-style pairwise post-hoc comparisons after a one-way ANOVA, returning each pair's mean difference, studentized-range q-statistic, standard error and an approximate p-value flagging which groups differ. Answers 'Which group means differ after a significant ANOVA?', 'What are the pairwise Tukey HSD comparisons?'.

Price$0.08per request
MethodPOST
Route/v1/stats/tukey-hsd
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
statisticstukeyhsdpost-hocanovapairwisemultiple-comparisonsinference
API URLhttps://x402.hexl.dev/v1/stats/tukey-hsd
Integration docs
Example request
{
  "groups": [
    [
      1,
      2,
      3,
      4
    ],
    [
      5,
      6,
      7,
      8
    ],
    [
      9,
      10,
      11,
      12
    ]
  ]
}
Example response
{
  "k": 3,
  "totalN": 12,
  "dfWithin": 9,
  "msWithin": 1.666667,
  "alpha": 0.05,
  "means": [
    2.5,
    6.5,
    10.5
  ],
  "comparisons": [
    {
      "groups": [
        0,
        1
      ],
      "meanDifference": -4,
      "qStatistic": 6.196773,
      "standardError": 0.645497,
      "pValueApprox": 0.001767,
      "significant": true
    },
    {
      "groups": [
        0,
        2
      ],
      "meanDifference": -8,
      "qStatistic": 12.393547,
      "standardError": 0.645497,
      "pValueApprox": 0.000011,
      "significant": true
    },
    {
      "groups": [
        1,
        2
      ],
      "meanDifference": -4,
      "qStatistic": 6.196773,
      "standardError": 0.645497,
      "pValueApprox": 0.001767,
      "significant": true
    }
  ],
  "numSignificantPairs": 3,
  "note": "qStatistic is the studentized-range statistic; pValueApprox uses the q→t approximation (q≈√2·t for a pair). For exact Tukey critical values consult a studentized-range table.",
  "rating": "3/3 pairs differ",
  "interpretation": "Tukey HSD over 3 groups: 3 of 3 pairwise comparisons significant at alpha=0.05."
}
Input schema
{
  "type": "object",
  "required": [
    "groups"
  ],
  "properties": {
    "groups": {
      "type": "array",
      "items": {
        "type": "array",
        "items": {
          "type": "number"
        }
      },
      "examples": [
        [
          [
            1,
            2,
            3,
            4
          ],
          [
            5,
            6,
            7,
            8
          ],
          [
            9,
            10,
            11,
            12
          ]
        ]
      ]
    },
    "alpha": {
      "type": "number",
      "examples": [
        0.05
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}