Skip to content

Main content

Sample Quantile Index Fraction Component Tool

Compute sample quantile index fraction component from explicit bounded inputs.

Loading tool…

Description

Calculate h=(sampleSize-1)*probability and return zero-based floor/ceiling indices and the fractional interpolation part.

A sample quantile locates a probability within sorted observations. Linear interpolation can use a fractional rank between two neighboring observations. This tool returns those zero-based indices and their interpolation fraction, leaving retrieval and interpolation of the actual observations to the caller.

Calculate h=(sampleSize-1)*probability and return zero-based floor/ceiling indices and the fractional interpolation part.

When to use this tool

Use Sample Quantile Index Fraction Component when you need this specific summary conversion, contribution, domain rule, or sensitivity term with matching statistical conventions.

How to use the tool and how it works

  1. Enter sampleSize, probability. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read lowerIndex, upperIndex, fraction. Use the output convention below.

Calculate h=(sampleSize-1)*probability and return zero-based floor/ceiling indices and the fractional interpolation part. Require sample size one through one million and probability within zero through one.1

The zero-based rank (n-1)*p corresponds to the linear interpolation convention commonly identified as quantile type 7; other quantile definitions differ.2

Input fieldMeaning and unitsAccepted input
sampleSizeNumber of observations in the sorted sample.Required. Safe integer; minimum 1; maximum 1000000.
probabilityDimensionless probability from zero through one.Required. Finite number.
Output fieldInterpretationReturned shape
lowerIndexZero-based lower interpolation index.Required. Safe integer.
upperIndexZero-based upper interpolation index.Required. Safe integer.
fractionInterpolation weight for the upper observation; the lower weight is one minus this value.Required. Finite number.
json
{
  "input": {
    "sampleSize": 4,
    "probability": 0.5
  },
  "output": {
    "lowerIndex": 1,
    "upperIndex": 2,
    "fraction": 0.5
  }
}

Limitations and assumptions

  • This is the index term for one linear quantile convention, not a quantile value. The observations, sorting, missing-value handling, and alternative quantile definitions are separate.
  • The field tables state structural bounds; the mechanics also specify cross-field constraints. Malformed inputs and unsupported domains cause errors. A successful false flag, empty branch value, or zero placeholder has the meaning stated above and is distinct from an input error.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Signed zero is exported as zero.

Alternative or Complementary methods

Use a complete estimator or model when a contribution, sensitivity, or domain check is insufficient. Verify the weight semantics, centering, denominator, and sampling assumptions before combining summaries.

References

  1. Calculation and input contract: statistics/sample-quantile-index-fraction-component — tool.io

  2. R stats documentation: Sample Quantiles — R Core Team

Similar or alternative tools