{
  "$defs": {
    "GroupComparison": {
      "additionalProperties": true,
      "properties": {
        "differs": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Differs"
        },
        "groups": {
          "items": {
            "$ref": "#/$defs/GroupStats"
          },
          "maxItems": 1000,
          "title": "Groups",
          "type": "array"
        },
        "p_value": {
          "anyOf": [
            {
              "maximum": 1,
              "minimum": 0,
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "P Value"
        },
        "test": {
          "anyOf": [
            {
              "enum": [
                "anova",
                "kruskal"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Test"
        },
        "var": {
          "maxLength": 256,
          "title": "Var",
          "type": "string"
        }
      },
      "required": [
        "var"
      ],
      "title": "GroupComparison",
      "type": "object"
    },
    "GroupStats": {
      "additionalProperties": true,
      "properties": {
        "group": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            }
          ],
          "title": "Group"
        },
        "mean": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Mean"
        },
        "median": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Median"
        },
        "n": {
          "minimum": 0,
          "title": "N",
          "type": "integer"
        },
        "sd": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Sd"
        },
        "share_of_total": {
          "anyOf": [
            {
              "maximum": 1,
              "minimum": 0,
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Share Of Total"
        }
      },
      "required": [
        "group",
        "n"
      ],
      "title": "GroupStats",
      "type": "object"
    }
  },
  "$id": "https://schemas.mapi.dev/v1/explore-groups.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": true,
  "description": "``groups``: each variable compared across the levels of ``by`` (markets, stores).",
  "properties": {
    "by": {
      "maxLength": 128,
      "title": "By",
      "type": "string"
    },
    "caption_plain": {
      "anyOf": [
        {
          "maxLength": 1000,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Caption Plain"
    },
    "format": {
      "const": "mapi.data-explorer.groups/v1",
      "default": "mapi.data-explorer.groups/v1",
      "title": "Format",
      "type": "string"
    },
    "items": {
      "items": {
        "$ref": "#/$defs/GroupComparison"
      },
      "maxItems": 256,
      "title": "Items",
      "type": "array"
    },
    "node": {
      "anyOf": [
        {
          "pattern": "^/(?:[A-Za-z_][A-Za-z0-9_.\\-]{0,63}(?:/[A-Za-z_][A-Za-z0-9_.\\-]{0,63}){0,7})?$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "M4: the node of a tree dataset the view describes (absent for a flat dataset)",
      "title": "Node"
    },
    "warnings_plain": {
      "items": {
        "type": "string"
      },
      "maxItems": 50,
      "title": "Warnings Plain",
      "type": "array"
    }
  },
  "required": [
    "by"
  ],
  "title": "GroupComparisonView",
  "type": "object",
  "x-mapi-contract-version": "0.2"
}
