Skip to main content
POST
/
v2
/
stats:runPowerAnalysis
Run PowerAnalysis
curl --request POST \
  --url https://stats.eu.confidence.dev/v2/stats:runPowerAnalysis \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "plan": {
    "alpha": 123,
    "power": 123,
    "groups": [
      {
        "id": "<string>",
        "weight": 123
      }
    ],
    "comparisons": {
      "allVsAll": {}
    },
    "hypotheses": [
      {
        "id": "<string>",
        "type": {},
        "segments": [
          {
            "params": {
              "zTest": {},
              "ratio": {},
              "tunncDesign": {
                "optimalSampleSize": 123,
                "weight": [
                  {}
                ]
              },
              "asympCs": {
                "optimalSampleSize": 123
              },
              "asympCsRatio": {
                "optimalSampleSize": 123
              }
            },
            "dimensions": [
              {}
            ]
          }
        ],
        "dataType": "DATA_TYPE_UNSPECIFIED"
      }
    ],
    "settings": {
      "disableSegmentAlphaAdjustment": true
    }
  }
}
'
{
  "hypotheses": [
    {
      "id": "<string>",
      "requiredSampleSize": 123,
      "segments": [
        {
          "dimensions": [
            {}
          ],
          "requiredSampleSize": 123,
          "ciWidthAbs": 123,
          "ciWidthRel": 123,
          "baselineMean": 123,
          "baselineVariance": 123,
          "varianceReductionRate": 123
        }
      ],
      "adjustedAlpha": 123,
      "adjustedBeta": 123
    }
  ],
  "requiredSampleSize": 123,
  "annotations": [
    {
      "context": [
        {
          "key": "CONTEXT_UNSPECIFIED",
          "value": "<string>"
        }
      ],
      "info": "<string>",
      "warning": "<string>",
      "error": {
        "details": "<string>",
        "category": "ERROR_CATEGORY_UNSPECIFIED"
      }
    }
  ],
  "statsCacheEntry": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
plan
AnalysisPlan · object
required

AnalysisPlan: The description of which hypotheses that are going to be tested, which group comparisons that are included, and how the result should be evaluated.

data
PowerAnalysisData · object

PowerAnalysisData: Additional data for the power analysis, only required to be set if hypotheses are relative or if ci_width should be computed.

Response

200 - application/json

OK

hypotheses
object[]

The sample size for each hypothesis.

requiredSampleSize
integer

The sample size needed to get the desired power for all hypotheses.

annotations
object[]

List of issues discovered during the power analysis.

statsCacheEntry
string

Cache entry used, empty if not cached.