API ReferenceapianalyticsPOST /patterns/pairwise-correlations

POST /patterns/pairwise-correlations

Service: analytics · operationId: (none)

Required scopes

(no scope declared — review service config)

Request body

{
  "type": "object",
  "properties": {
    "series": {
      "type": "object",
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "number"
        }
      }
    },
    "method": {
      "type": "string",
      "enum": [
        "pearson",
        "spearman"
      ],
      "default": "pearson"
    },
    "correction": {
      "type": "string",
      "enum": [
        "bonferroni",
        "holm",
        "fdr_bh"
      ],
      "default": "fdr_bh"
    },
    "alpha": {
      "type": "number",
      "default": 0.05
    }
  },
  "required": [
    "series"
  ]
}

Responses

200 Pairwise correlations completed

{
  "type": "object",
  "properties": {
    "method": {
      "type": "string",
      "enum": [
        "pearson",
        "spearman"
      ]
    },
    "correction": {
      "type": "string",
      "enum": [
        "bonferroni",
        "holm",
        "fdr_bh"
      ]
    },
    "alpha": {
      "type": "number"
    },
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "left": {
            "type": "string"
          },
          "right": {
            "type": "string"
          },
          "statistic": {
            "type": "number"
          },
          "p_value": {
            "type": "number"
          },
          "adjusted_p_value": {
            "type": "number"
          },
          "sample_size": {
            "type": "integer"
          },
          "significant": {
            "type": "boolean"
          }
        },
        "required": [
          "left",
          "right",
          "statistic",
          "p_value",
          "adjusted_p_value",
          "sample_size",
          "significant"
        ]
      }
    }
  },
  "required": [
    "method",
    "correction",
    "alpha",
    "results"
  ]
}

400 Invalid request

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

Example

curl -X POST https://analytics.platform.loop.health/patterns/pairwise-correlations \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'