API ReferenceapianalyticsPOST /patterns/correlate

POST /patterns/correlate

Service: analytics · operationId: (none)

Required scopes

(no scope declared — review service config)

Request body

{
  "type": "object",
  "properties": {
    "x": {
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "y": {
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "method": {
      "type": "string",
      "enum": [
        "pearson",
        "spearman"
      ],
      "default": "pearson"
    },
    "alpha": {
      "type": "number",
      "default": 0.05
    }
  },
  "required": [
    "x",
    "y"
  ]
}

Responses

200 Correlation analysis completed

{
  "type": "object",
  "properties": {
    "method": {
      "type": "string",
      "enum": [
        "pearson",
        "spearman"
      ]
    },
    "statistic": {
      "type": "number"
    },
    "p_value": {
      "type": "number"
    },
    "sample_size": {
      "type": "integer"
    },
    "confidence_interval": {
      "type": "object",
      "properties": {
        "low": {
          "type": "number"
        },
        "high": {
          "type": "number"
        }
      },
      "required": [
        "low",
        "high"
      ]
    },
    "significant": {
      "type": "boolean"
    }
  },
  "required": [
    "method",
    "statistic",
    "p_value",
    "sample_size",
    "confidence_interval",
    "significant"
  ]
}

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/correlate \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'