{
  "x402Version": 2,
  "id": 72459,
  "slug": "saylorinnovations-api-stats-chi-square",
  "resource": "https://saylorinnovations.com/api/stats/chi-square",
  "description": "Chi-square test of independence on a contingency table - statistic, df, p-value, Cramer V, expected counts, Yates correction and assumption warnings",
  "type": "http",
  "serviceName": "Saylor Innovations Data Desk",
  "mimeType": "application/json",
  "resourceType": "API",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0xA2A8dF0f7CaaBEa4e120a2568118f141569fc8aa",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "10000",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    },
    {
      "scheme": "exact",
      "network": "eip155:137",
      "payTo": "0xA2A8dF0f7CaaBEa4e120a2568118f141569fc8aa",
      "asset": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
      "amount": "10000",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    },
    {
      "scheme": "exact",
      "network": "eip155:42161",
      "payTo": "0xA2A8dF0f7CaaBEa4e120a2568118f141569fc8aa",
      "asset": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
      "amount": "10000",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    },
    {
      "scheme": "exact",
      "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "payTo": "7LSjfrJf8fNsB8VA9u7N3WEn25smQLpob3SvyUvXacy7",
      "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "amount": "10000",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    },
    {
      "scheme": "exact",
      "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "payTo": "7LSjfrJf8fNsB8VA9u7N3WEn25smQLpob3SvyUvXacy7",
      "asset": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
      "amount": "10000",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    },
    {
      "scheme": "exact",
      "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "payTo": "7LSjfrJf8fNsB8VA9u7N3WEn25smQLpob3SvyUvXacy7",
      "asset": "So11111111111111111111111111111111111111112",
      "amount": "95830",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    }
  ],
  "outputSchema": {
    "type": "object",
    "properties": {
      "chi_square": {
        "type": "number",
        "description": "Chi square"
      },
      "df": {
        "type": "number",
        "description": "Degrees of freedom"
      },
      "p_value": {
        "type": "number",
        "description": "P value"
      },
      "significant_at_5_percent": {
        "type": "boolean",
        "description": "Significant at 5, as a percentage"
      },
      "cramers_v": {
        "type": "number",
        "description": "Cramers v"
      },
      "association": {
        "type": "string",
        "description": "Strength of association from Cramer's V"
      },
      "expected_counts": {
        "type": "array",
        "description": "Expected counts"
      },
      "min_expected_count": {
        "type": "number",
        "description": "Number of min expected"
      },
      "assumption_warning": {
        "type": [
          "string",
          "null"
        ],
        "description": "Assumption warning"
      },
      "source": {
        "type": "string",
        "description": "Data source the values come from"
      },
      "total": {
        "type": [
          "number",
          "null"
        ],
        "description": "Total number of matching items"
      },
      "row_totals": {
        "type": [
          "array",
          "null"
        ],
        "description": "Row totals"
      },
      "column_totals": {
        "type": [
          "array",
          "null"
        ],
        "description": "Column totals"
      },
      "yates_corrected": {
        "description": "Yates corrected"
      }
    },
    "required": [
      "chi_square",
      "df",
      "p_value"
    ]
  },
  "extensions": {
    "bazaar": {
      "info": {
        "input": {
          "type": "http",
          "method": "GET",
          "queryParams": {
            "table": "[[30,10],[20,40]]"
          }
        },
        "output": {
          "type": "json",
          "example": {
            "chi_square": 16.666667,
            "df": 1,
            "p_value": 0.0000445571,
            "significant_at_5_percent": true,
            "cramers_v": 0.408248,
            "association": "moderate",
            "total": 100,
            "row_totals": [
              40,
              60
            ],
            "column_totals": [
              50,
              50
            ],
            "expected_counts": [
              [
                20,
                20
              ],
              [
                30,
                30
              ]
            ],
            "min_expected_count": 20,
            "assumption_warning": null,
            "yates_corrected": {
              "chi_square": 15.041667,
              "p_value": 0.000105164
            },
            "source": "Pearson chi-square test of independence with the regularized incomplete gamma function"
          }
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "input": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "http"
              },
              "method": {
                "type": "string",
                "enum": [
                  "GET"
                ]
              },
              "queryParams": {
                "type": "object",
                "properties": {
                  "table": {
                    "type": "string",
                    "description": "JSON grid of observed counts, 2x2 to 10x10, e.g. [[30,10],[20,40]]"
                  }
                },
                "required": [
                  "table"
                ]
              }
            },
            "required": [
              "type",
              "method"
            ],
            "additionalProperties": false
          },
          "output": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "json"
              },
              "example": {
                "type": "object",
                "properties": {
                  "chi_square": {
                    "type": "number",
                    "description": "Chi square"
                  },
                  "df": {
                    "type": "number",
                    "description": "Degrees of freedom"
                  },
                  "p_value": {
                    "type": "number",
                    "description": "P value"
                  },
                  "significant_at_5_percent": {
                    "type": "boolean",
                    "description": "Significant at 5, as a percentage"
                  },
                  "cramers_v": {
                    "type": "number",
                    "description": "Cramers v"
                  },
                  "association": {
                    "type": "string",
                    "description": "Strength of association from Cramer's V"
                  },
                  "expected_counts": {
                    "type": "array",
                    "description": "Expected counts"
                  },
                  "min_expected_count": {
                    "type": "number",
                    "description": "Number of min expected"
                  },
                  "assumption_warning": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Assumption warning"
                  },
                  "source": {
                    "type": "string",
                    "description": "Data source the values come from"
                  },
                  "total": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Total number of matching items"
                  },
                  "row_totals": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "description": "Row totals"
                  },
                  "column_totals": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "description": "Column totals"
                  },
                  "yates_corrected": {
                    "description": "Yates corrected"
                  }
                },
                "required": [
                  "chi_square",
                  "df",
                  "p_value"
                ]
              }
            },
            "required": [
              "type"
            ]
          }
        },
        "required": [
          "input"
        ]
      }
    }
  },
  "tags": [
    "chi square test",
    "are two categorical variables",
    "cramers v association strength",
    "chi square p value calculator",
    "test conversion by segment"
  ],
  "sourceHost": "saylorinnovations.com",
  "lastUpdated": "2026-10-26T22:14:01.948Z",
  "quality": {},
  "metadata": {
    "serviceName": "Saylor Innovations Data Desk",
    "method": "GET",
    "mimeType": "application/json",
    "inputSchema": {
      "type": "object",
      "properties": {
        "table": {
          "type": "string",
          "description": "JSON grid of observed counts, 2x2 to 10x10, e.g. [[30,10],[20,40]]"
        }
      },
      "required": [
        "table"
      ]
    },
    "exampleResponse": {
      "chi_square": 16.666667,
      "df": 1,
      "p_value": 0.0000445571,
      "significant_at_5_percent": true,
      "cramers_v": 0.408248,
      "association": "moderate",
      "total": 100,
      "row_totals": [
        40,
        60
      ],
      "column_totals": [
        50,
        50
      ],
      "expected_counts": [
        [
          20,
          20
        ],
        [
          30,
          30
        ]
      ],
      "min_expected_count": 20,
      "assumption_warning": null,
      "yates_corrected": {
        "chi_square": 15.041667,
        "p_value": 0.000105164
      },
      "source": "Pearson chi-square test of independence with the regularized incomplete gamma function"
    },
    "parameterLocation": "query",
    "extensions": {
      "bazaar": {
        "info": {
          "input": {
            "type": "http",
            "method": "GET",
            "queryParams": {
              "table": "[[30,10],[20,40]]"
            }
          },
          "output": {
            "type": "json",
            "example": {
              "chi_square": 16.666667,
              "df": 1,
              "p_value": 0.0000445571,
              "significant_at_5_percent": true,
              "cramers_v": 0.408248,
              "association": "moderate",
              "total": 100,
              "row_totals": [
                40,
                60
              ],
              "column_totals": [
                50,
                50
              ],
              "expected_counts": [
                [
                  20,
                  20
                ],
                [
                  30,
                  30
                ]
              ],
              "min_expected_count": 20,
              "assumption_warning": null,
              "yates_corrected": {
                "chi_square": 15.041667,
                "p_value": 0.000105164
              },
              "source": "Pearson chi-square test of independence with the regularized incomplete gamma function"
            }
          }
        },
        "schema": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "type": "object",
          "properties": {
            "input": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "http"
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "GET"
                  ]
                },
                "queryParams": {
                  "type": "object",
                  "properties": {
                    "table": {
                      "type": "string",
                      "description": "JSON grid of observed counts, 2x2 to 10x10, e.g. [[30,10],[20,40]]"
                    }
                  },
                  "required": [
                    "table"
                  ]
                }
              },
              "required": [
                "type",
                "method"
              ],
              "additionalProperties": false
            },
            "output": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "json"
                },
                "example": {
                  "type": "object",
                  "properties": {
                    "chi_square": {
                      "type": "number",
                      "description": "Chi square"
                    },
                    "df": {
                      "type": "number",
                      "description": "Degrees of freedom"
                    },
                    "p_value": {
                      "type": "number",
                      "description": "P value"
                    },
                    "significant_at_5_percent": {
                      "type": "boolean",
                      "description": "Significant at 5, as a percentage"
                    },
                    "cramers_v": {
                      "type": "number",
                      "description": "Cramers v"
                    },
                    "association": {
                      "type": "string",
                      "description": "Strength of association from Cramer's V"
                    },
                    "expected_counts": {
                      "type": "array",
                      "description": "Expected counts"
                    },
                    "min_expected_count": {
                      "type": "number",
                      "description": "Number of min expected"
                    },
                    "assumption_warning": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Assumption warning"
                    },
                    "source": {
                      "type": "string",
                      "description": "Data source the values come from"
                    },
                    "total": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Total number of matching items"
                    },
                    "row_totals": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "description": "Row totals"
                    },
                    "column_totals": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "description": "Column totals"
                    },
                    "yates_corrected": {
                      "description": "Yates corrected"
                    }
                  },
                  "required": [
                    "chi_square",
                    "df",
                    "p_value"
                  ]
                }
              },
              "required": [
                "type"
              ]
            }
          },
          "required": [
            "input"
          ]
        }
      }
    },
    "examples": [
      {
        "label": "Unpaid discovery call",
        "method": "GET",
        "url": "https://saylorinnovations.com/api/stats/chi-square?table=%5B%5B30,10%5D,%5B20,40%5D%5D",
        "expectedStatus": 402
      }
    ],
    "cacheTtlSeconds": 0,
    "capabilities": [],
    "noAccountRequired": true,
    "noApiKeyRequired": true,
    "sideEffects": "Paid calls settle the advertised payment; see the provider contract for execution behavior.",
    "payment": {
      "protocol": "x402",
      "settlement": "direct-to-provider"
    },
    "provider": {
      "name": "Saylor Innovations",
      "host": "saylorinnovations.com",
      "manifestUrl": "https://saylorinnovations.com/.well-known/x402.json"
    }
  },
  "liveness": {
    "reliability": null
  },
  "verified": true,
  "featured": false,
  "provider": {
    "host": "saylorinnovations.com",
    "manifest_name": "Saylor Innovations Knowledge Base",
    "source": "submitted",
    "source_manifest_url": "https://saylorinnovations.com/.well-known/x402.json",
    "submitted_at": "2026-10-26T05:52:02.113Z"
  },
  "exampleResponse": {
    "chi_square": 0,
    "df": 0,
    "p_value": 0,
    "significant_at_5_percent": true,
    "cramers_v": 0,
    "association": "string",
    "expected_counts": [
      "value"
    ],
    "min_expected_count": 0,
    "assumption_warning": "string",
    "source": "string",
    "total": 0,
    "row_totals": [
      "value"
    ],
    "column_totals": [
      "value"
    ],
    "yates_corrected": null
  }
}