Catalog/psy-item-analysis

Statistics

Item difficulty & discrimination API

Runs classical item analysis on a 0/1 correct/incorrect matrix: per-item difficulty (p-value), upper-lower group discrimination index, point-biserial correlation, and a quality flag. Answers 'Which test items are too easy/hard or non-discriminating?', 'What is each item's discrimination and point-biserial?'.

Price$0.06per request
MethodPOST
Route/v1/stats/item-analysis
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
psychometricsitem-analysisitem-difficultydiscrimination-indexpoint-biserialtest-theoryexamctt
API URLhttps://x402.hexl.dev/v1/stats/item-analysis
Integration docs
Example request
{
  "matrix": [
    [
      1,
      1,
      1,
      0
    ],
    [
      1,
      1,
      0,
      0
    ],
    [
      1,
      0,
      1,
      1
    ],
    [
      0,
      1,
      1,
      1
    ],
    [
      1,
      1,
      1,
      1
    ],
    [
      0,
      0,
      1,
      0
    ],
    [
      1,
      1,
      0,
      1
    ],
    [
      0,
      0,
      0,
      0
    ]
  ]
}
Example response
{
  "items": [
    {
      "item": 1,
      "difficulty": 0.625,
      "discriminationIndex": 1,
      "pointBiserial": 0.6623,
      "flag": "ok"
    },
    {
      "item": 2,
      "difficulty": 0.625,
      "discriminationIndex": 1,
      "pointBiserial": 0.6623,
      "flag": "ok"
    },
    {
      "item": 3,
      "difficulty": 0.625,
      "discriminationIndex": 0.5,
      "pointBiserial": 0.4503,
      "flag": "ok"
    },
    {
      "item": 4,
      "difficulty": 0.5,
      "discriminationIndex": 0.5,
      "pointBiserial": 0.7182,
      "flag": "ok"
    }
  ],
  "nItems": 4,
  "nRespondents": 8,
  "groupSize": 2,
  "meanTotalScore": 2.375,
  "interpretation": "item difficulty (p), upper-lower discrimination (D, groups of 2), and point-biserial r"
}
Input schema
{
  "type": "object",
  "required": [
    "matrix"
  ],
  "properties": {
    "matrix": {
      "type": "array",
      "items": {
        "type": "array",
        "items": {
          "type": "number"
        }
      },
      "description": "respondents x items 0/1 matrix",
      "examples": [
        [
          [
            1,
            1,
            1,
            0
          ],
          [
            1,
            1,
            0,
            0
          ]
        ]
      ]
    },
    "groupFraction": {
      "type": "number",
      "default": 0.27,
      "description": "top/bottom fraction for discrimination"
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}