← All procedures
statistics.pairedPermutation
The paired permutation test (a random sign flip of each difference). It needs no normal distribution and uses the size of each difference, which the sign test does not. A pair with a difference of 0 adds nothing.
CLI- Package
- @procedures/statistics · README
- Path
["statistics","pairedPermutation"]- CLI
mark statistics pairedPermutation --candidate <number[]> --baseline <number[]>- As data
{"$proc":["statistics","pairedPermutation"],"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","pairedPermutation"], { candidate: [], baseline: [] });
console.log(JSON.stringify(result));From the command line
$ mark statistics pairedPermutation --candidate <number[]> --baseline <number[]>
As data, in a program
{
"$proc": ["statistics", "pairedPermutation"],
"input": { "candidate": [], "baseline": [] }
}Input
Output
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"candidate": {
"type": "array",
"items": {
"type": "number"
}
},
"baseline": {
"type": "array",
"items": {
"type": "number"
}
},
"options": {
"type": "object",
"properties": {
"runs": {
"type": "number",
"description": "The number of random sign flips. The default is 10 000."
},
"seed": {
"description": "The default is 1.",
"type": [
"string",
"number"
]
},
"statistic": {
"type": "object",
"properties": {
"$proc": {
"minItems": 1,
"type": "array",
"items": {
"type": "string"
}
},
"input": {},
"$when": {
"type": "string",
"const": "$never"
}
},
"required": [
"$proc"
],
"additionalProperties": {},
"x-procedures-program": {
"params": [
"differences"
],
"inputs": [
{
"type": "array",
"items": {
"type": "number"
}
}
],
"output": {
"type": "number"
}
},
"description": "The statistic of the differences. The default is the mean."
}
},
"additionalProperties": {}
}
},
"required": [
"candidate",
"baseline"
],
"additionalProperties": false
},
"output": {
"type": "object",
"properties": {
"observed": {
"type": "number",
"description": "The statistic of the observed differences `candidate[i] - baseline[i]`."
},
"p": {
"type": "number",
"description": "The two-sided p: (1 + the flips with a statistic as far from 0 or farther) / (1 + runs)."
},
"runs": {
"type": "number"
}
},
"required": [
"observed",
"p",
"runs"
],
"additionalProperties": {}
}
}