← All procedures

statistics.signTest

The sign test of paired results: `better` inputs where the candidate wins and `worse` where it loses. The ties do not count. One-sided (the default), it is the p of `better` wins or more if the two are equal. Two-sided, it is two times the tail of the larger count, at most 1. The one-sided p is equal to `signTestP` of packing.

CLI
Package
@procedures/statistics · README
Path
["statistics","signTest"]
CLI
mark statistics signTest --better <number> --worse <number>
As data
{"$proc":["statistics","signTest"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/statistics/register"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["statistics","signTest"], { better: 1, worse: 1 });
console.log(JSON.stringify(result));

From the command line

$ mark statistics signTest --better <number> --worse <number>

As data, in a program

{
  "$proc": ["statistics", "signTest"],
  "input": { "better": 1, "worse": 1 }
}

Input

FieldTypeRequiredDefaultDescription
betternumberyes
worsenumberyes
sidesnumber | numberno

Output

The schema does not list fields (number).

JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "better": {
        "type": "number"
      },
      "worse": {
        "type": "number"
      },
      "sides": {
        "anyOf": [
          {
            "type": "number",
            "const": 1
          },
          {
            "type": "number",
            "const": 2
          }
        ]
      }
    },
    "required": [
      "better",
      "worse"
    ],
    "additionalProperties": false
  },
  "output": {
    "type": "number"
  }
}