Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Calculate Interquartile Range

statistics.interquartile_range

ProductionBounded custom (Class B)Deterministicstrictfastv1.0.0
No network

Overview

You send a numeric vector and we return the first quartile, the third quartile, and Q3 minus Q1 under the same interpolation as statistics.quantile. LINEAR_R7 is the default. This is the spread statistic, not an outlier rule, box-plot whiskers, or a robust scale (use statistics.median_absolute_deviation for MAD).

Calling quantile twice for 0.25 and 0.75 invites a method mismatch. One skill computes both under the same convention and subtracts them.

Reliability

q1 and q3 equal statistics.quantile at 0.25 and 0.75 with the same method. A constant series yields interquartileRange 0.0. SERIES_INVALID — trigger: every observation was null under OMIT, or a null arrived under REJECT; retryable: no; next: send at least one finite number. ITEM_LIMIT_EXCEEDED — trigger: more than 100000 observations; retryable: no; next: split the series.

Context footprint

One vector in, three spread figures out. A successful call costs 1 execution credit.

When to use it

When you need Q1, Q3 and their difference under one named quantile method.

When you need an arbitrary probability list, outlier labels, or MAD scale.

Scope

Note
Returns Q1, Q3 and Q3 minus Q1 under one declared quantile convention.

Non-goals

  • Does not flag outliers or draw box-plot whiskers
  • Does not apply a robust scale factor (that is statistics.median_absolute_deviation)

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

analysismath

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input2 MB

How we handle your data

Sensitive input, safe output
What this means

This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.

Squillify guarantees
  • Runs inside Squillify
  • This skill runs inside Squillify.
  • Payloads are not sent to an external service by this skill.
  • Squillify does not permanently store submitted payloads.
  • Telemetry records metadata only, not submitted content.
  • Submitted payloads are not used for training.
  • Submitted payloads are not reviewed by humans.
  • This skill does not target sensitive data.
  • The response does not contain submitted content.
Your responsibility

Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
valuesarrayYesRequired 1 to 100000 finite numbers. One extra slot exists in the schema so the typed ITEM_LIMIT_EXCEEDED failure is reachable at 100001.
methodstringNoInterpolation method; omit it for LINEAR_R7.
nullPolicystringNoREJECT fails on any JSON null; OMIT drops nulls and reports omittedCount. Omit this field and we REJECT.

Output schema

FieldTypeRequiredDescription
q1numberYesFirst quartile at probability 0.25 under the declared interpolation method.
q3numberYesThird quartile at probability 0.75 under the declared interpolation method.
interquartileRangenumberYesQ3 minus Q1 after negative-zero canonicalization, never a second independent pass.
methodstringYesApplied interpolation method.
countintegerYesFinite observations used.
omittedCountintegerYesHow many JSON null observations were dropped under OMIT; zero under REJECT.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"statistics.interquartile_range","input":{"values":[1,2,3,4,5,6,7,8,9,10]}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("statistics.interquartile_range", {"values":[1,2,3,4,5,6,7,8,9,10]});

Errors

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.
SERIES_INVALID400NoThe request payload failed this skill's input validation.
ITEM_LIMIT_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not flag outliers or draw box-plot whiskers
  • Does not apply a robust scale factor (that is statistics.median_absolute_deviation)
  • An arbitrary probability list (use statistics.quantile)
  • Median absolute deviation around the sample median

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "statistics.interquartile_range",
  "input": {
    "values": [
      1,
      2,
      3,
      4,
      5,
      6,
      7,
      8,
      9,
      10
    ]
  }
}

Examples

Type-7 IQR of the integers one through ten

Inputjson
{
  "values": [
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10
  ]
}
Expected outputjson
{
  "interquartileRange": 4.5,
  "count": 10,
  "omittedCount": 0,
  "q1": 3.25,
  "method": "LINEAR_R7",
  "q3": 7.75
}
Tip
h25 = 2.25 and h75 = 6.75 on the 0-based order statistics

Constant series has a zero interquartile range

Inputjson
{
  "values": [
    5,
    5,
    5,
    5
  ]
}
Expected outputjson
{
  "interquartileRange": 0,
  "count": 4,
  "omittedCount": 0,
  "q1": 5,
  "method": "LINEAR_R7",
  "q3": 5
}
Tip
Every order statistic is 5, so Q3 minus Q1 is 0
  • A single spread figure that matches statistics.quantile at 0.25 and 0.75
  • Checking that a constant series has interquartile range zero

Avoid for

  • An arbitrary probability list (use statistics.quantile)
  • Median absolute deviation around the sample median

Composable with

Safety & privacy

  • Runs without calling any external service.
  • Your payloads are never stored permanently.
  • Telemetry captures metadata only — never your payload contents.
  • We never train models on your payloads.
  • No human reviews your payloads.

Tags

analysismathstatistics