Skip to content

Main content

Group Median Centered Values

Center each observation by its explicit group’s sample median, retaining group-center evidence and original order; no between-group inference.

Loading tool…

Description

Center each observation by its explicit group’s sample median, retaining group-center evidence and original order; no between-group inference.

A descriptive statistic depends on what is counted, how observations are weighted, and which reference or denominator is used. Removing observations differs from replacing them at cutoffs, and a ratio of totals differs from a mean of individual ratios. Keep those conventions and measurement units explicit when comparing results.

Center each observation by its explicit group’s sample median, retaining group-center evidence and original order; no between-group inference.

When to use this tool

Use this tool to center each observation by its explicit group’s sample median, retaining group-center evidence and original order; no between-group inference.

How to use the tool and how it works

  1. Enter values, groups using the field definitions below.
  2. Run the operation. Correct input errors before interpreting an output.
  3. Read result.centered, result.centers. Use the ordering, boundary rules and absence conditions described below.

Group aligned values by exact labels, compute each group’s median, and subtract that median from its values. Return centered values in input order and first-seen group centers.1

Input fieldMeaning and unitsAccepted input
valuesFinite observations in the measurement units used by reference or cutoffs.Dense list of at most 128 finite numbers; integer/shape constraints above also apply.
groupsExact group-label strings aligned with values.Dense list of at most 128 strings, each at most 8,192 UTF-16 code units.
Output fieldInterpretation
resultObject containing the named fields below.
result.centeredInput-order values after subtracting their own group’s mean or median.
result.centersFirst-seen group labels with their computed center values.
json
{
  "input": {
    "values": [
      1,
      3,
      10
    ],
    "groups": [
      "a",
      "a",
      "b"
    ]
  },
  "output": {
    "result": {
      "centered": [
        -1,
        1,
        0
      ],
      "centers": [
        {
          "group": "a",
          "value": 2
        },
        {
          "group": "b",
          "value": 10
        }
      ]
    }
  }
}

Limitations and assumptions

  • Group labels are exact and no scaling or between-group statistical test is applied.
  • Use consistent units within each measured list and its reference/cutoffs. Ratios carry numerator units divided by denominator units unless those units cancel. Ordinary floating-point arithmetic is used; input validation does not establish statistical suitability.
  • Every declared top-level input field is required and unexpected fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
  • Numeric outputs must be finite and no larger in absolute magnitude than the safe-integer limit; operations returning exact large integers use decimal text. Positions are zero-based and spans end exclusively unless the operation explicitly states a different convention.

Alternative or Complementary methods

Check the descriptive convention and denominator before comparing results. Use a separate inferential model when you need uncertainty, significance, causal interpretation or population estimates.

References

  1. Tool behavior and example: Group Median Centered Values — tool.io

Similar or alternative tools

  • Group Mean Centered Values

    Center each observation by its explicit group’s sample mean, retaining group-center evidence and original order; no between-group inference.

  • Median Absolute Deviation from Reference

    Compute median absolute deviation about an explicitly supplied reference, not automatically the sample median and not normal-consistency scaled.