Skip to content

Main content

Choice Switch Position Index Tool

Calculate choice switch position index from explicit caller-supplied inputs.

Loading tool…

Description

Return the first adjacent choice-label switch.

Behavioral-economics tasks compare supplied payoffs, reference points, budgets and observed choices. A gap, dominance flag or response fraction illustrates a declared convention without identifying a psychological bias, predicting real choices or selecting a suitable financial action.

Return the first adjacent choice-label switch.

When to use this tool

Use Choice Switch Position Index when checking the stated experimental payoff, budget, reference or choice convention.

How to use the tool and how it works

  1. Enter choices. 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 firstSwitchIndex, switched. Inspect switched before interpreting the associated values.

Return the first adjacent choice-label switch. firstSwitchIndex is the zero-based index whose choice differs from its predecessor, or -1; switched reports whether found.1

Input fieldMeaning and unitsAccepted input
choicesChoicesRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
Output fieldInterpretationReturned shape
firstSwitchIndexZero-based position after the first adjacent change, or -1 if none.Required. Safe integer.
switchedSwitchedRequired. Boolean.
json
{
  "input": {
    "choices": [
      "A",
      "A",
      "B",
      "A"
    ]
  },
  "output": {
    "firstSwitchIndex": 2,
    "switched": true
  }
}

Limitations and assumptions

  • Only the first switch is returned; later reversals, meaningful order and preference consistency are not evaluated.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Use a well-defined study design and complete data to estimate behavior; assess real financial rights, consequences and uncertainty independently.

References

  1. Calculation and input contract: behavioral-economics/choice-switch-position-index — tool.io

Similar or alternative tools