API Reference
Run Analysis
Runs an analysis that tests multiple hypotheses and evaluates their results by an optional decision rule.
POST
/
v2
/
stats:runAnalysis
Run Analysis
curl --request POST \
--url https://stats.eu.confidence.dev/v2/stats:runAnalysis \
--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": [
{}
]
}
]
}
],
"settings": {
"disableSegmentAlphaAdjustment": true
}
},
"data": {
"hypotheses": [
{
"id": "<string>",
"segments": [
{
"dimensions": [
{}
],
"groups": [
{
"group": "<string>",
"data": {
"chi2": {},
"zTest": {},
"gstZTest": {},
"ratio": {},
"tunncDesign": {},
"gstRatio": {},
"asympCs": {},
"asympCsRatio": {}
}
}
],
"labels": [
{}
]
}
]
}
]
}
}
'import requests
url = "https://stats.eu.confidence.dev/v2/stats:runAnalysis"
payload = {
"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": [{}]
}
]
}
],
"settings": { "disableSegmentAlphaAdjustment": True }
},
"data": { "hypotheses": [
{
"id": "<string>",
"segments": [
{
"dimensions": [{}],
"groups": [
{
"group": "<string>",
"data": {
"chi2": {},
"zTest": {},
"gstZTest": {},
"ratio": {},
"tunncDesign": {},
"gstRatio": {},
"asympCs": {},
"asympCsRatio": {}
}
}
],
"labels": [{}]
}
]
}
] }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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: [{}]
}
]
}
],
settings: {disableSegmentAlphaAdjustment: true}
},
data: {
hypotheses: [
{
id: '<string>',
segments: [
{
dimensions: [{}],
groups: [
{
group: '<string>',
data: {
chi2: {},
zTest: {},
gstZTest: {},
ratio: {},
tunncDesign: {},
gstRatio: {},
asympCs: {},
asympCsRatio: {}
}
}
],
labels: [{}]
}
]
}
]
}
})
};
fetch('https://stats.eu.confidence.dev/v2/stats:runAnalysis', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://stats.eu.confidence.dev/v2/stats:runAnalysis",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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' => [
[
]
]
]
]
]
],
'settings' => [
'disableSegmentAlphaAdjustment' => true
]
],
'data' => [
'hypotheses' => [
[
'id' => '<string>',
'segments' => [
[
'dimensions' => [
[
]
],
'groups' => [
[
'group' => '<string>',
'data' => [
'chi2' => [
],
'zTest' => [
],
'gstZTest' => [
],
'ratio' => [
],
'tunncDesign' => [
],
'gstRatio' => [
],
'asympCs' => [
],
'asympCsRatio' => [
]
]
]
],
'labels' => [
[
]
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://stats.eu.confidence.dev/v2/stats:runAnalysis"
payload := strings.NewReader("{\n \"plan\": {\n \"alpha\": 123,\n \"power\": 123,\n \"groups\": [\n {\n \"id\": \"<string>\",\n \"weight\": 123\n }\n ],\n \"comparisons\": {\n \"allVsAll\": {}\n },\n \"hypotheses\": [\n {\n \"id\": \"<string>\",\n \"type\": {},\n \"segments\": [\n {\n \"params\": {\n \"zTest\": {},\n \"ratio\": {},\n \"tunncDesign\": {\n \"optimalSampleSize\": 123,\n \"weight\": [\n {}\n ]\n },\n \"asympCs\": {\n \"optimalSampleSize\": 123\n },\n \"asympCsRatio\": {\n \"optimalSampleSize\": 123\n }\n },\n \"dimensions\": [\n {}\n ]\n }\n ]\n }\n ],\n \"settings\": {\n \"disableSegmentAlphaAdjustment\": true\n }\n },\n \"data\": {\n \"hypotheses\": [\n {\n \"id\": \"<string>\",\n \"segments\": [\n {\n \"dimensions\": [\n {}\n ],\n \"groups\": [\n {\n \"group\": \"<string>\",\n \"data\": {\n \"chi2\": {},\n \"zTest\": {},\n \"gstZTest\": {},\n \"ratio\": {},\n \"tunncDesign\": {},\n \"gstRatio\": {},\n \"asympCs\": {},\n \"asympCsRatio\": {}\n }\n }\n ],\n \"labels\": [\n {}\n ]\n }\n ]\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://stats.eu.confidence.dev/v2/stats:runAnalysis")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"plan\": {\n \"alpha\": 123,\n \"power\": 123,\n \"groups\": [\n {\n \"id\": \"<string>\",\n \"weight\": 123\n }\n ],\n \"comparisons\": {\n \"allVsAll\": {}\n },\n \"hypotheses\": [\n {\n \"id\": \"<string>\",\n \"type\": {},\n \"segments\": [\n {\n \"params\": {\n \"zTest\": {},\n \"ratio\": {},\n \"tunncDesign\": {\n \"optimalSampleSize\": 123,\n \"weight\": [\n {}\n ]\n },\n \"asympCs\": {\n \"optimalSampleSize\": 123\n },\n \"asympCsRatio\": {\n \"optimalSampleSize\": 123\n }\n },\n \"dimensions\": [\n {}\n ]\n }\n ]\n }\n ],\n \"settings\": {\n \"disableSegmentAlphaAdjustment\": true\n }\n },\n \"data\": {\n \"hypotheses\": [\n {\n \"id\": \"<string>\",\n \"segments\": [\n {\n \"dimensions\": [\n {}\n ],\n \"groups\": [\n {\n \"group\": \"<string>\",\n \"data\": {\n \"chi2\": {},\n \"zTest\": {},\n \"gstZTest\": {},\n \"ratio\": {},\n \"tunncDesign\": {},\n \"gstRatio\": {},\n \"asympCs\": {},\n \"asympCsRatio\": {}\n }\n }\n ],\n \"labels\": [\n {}\n ]\n }\n ]\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://stats.eu.confidence.dev/v2/stats:runAnalysis")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"plan\": {\n \"alpha\": 123,\n \"power\": 123,\n \"groups\": [\n {\n \"id\": \"<string>\",\n \"weight\": 123\n }\n ],\n \"comparisons\": {\n \"allVsAll\": {}\n },\n \"hypotheses\": [\n {\n \"id\": \"<string>\",\n \"type\": {},\n \"segments\": [\n {\n \"params\": {\n \"zTest\": {},\n \"ratio\": {},\n \"tunncDesign\": {\n \"optimalSampleSize\": 123,\n \"weight\": [\n {}\n ]\n },\n \"asympCs\": {\n \"optimalSampleSize\": 123\n },\n \"asympCsRatio\": {\n \"optimalSampleSize\": 123\n }\n },\n \"dimensions\": [\n {}\n ]\n }\n ]\n }\n ],\n \"settings\": {\n \"disableSegmentAlphaAdjustment\": true\n }\n },\n \"data\": {\n \"hypotheses\": [\n {\n \"id\": \"<string>\",\n \"segments\": [\n {\n \"dimensions\": [\n {}\n ],\n \"groups\": [\n {\n \"group\": \"<string>\",\n \"data\": {\n \"chi2\": {},\n \"zTest\": {},\n \"gstZTest\": {},\n \"ratio\": {},\n \"tunncDesign\": {},\n \"gstRatio\": {},\n \"asympCs\": {},\n \"asympCsRatio\": {}\n }\n }\n ],\n \"labels\": [\n {}\n ]\n }\n ]\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"hypotheses": [
{
"id": "<string>",
"segments": [
{
"dimensions": [
{}
],
"comparisons": [
{
"groups": {
"single": "<string>",
"pair": {
"baseline": "<string>",
"compared": "<string>"
},
"multiple": {
"groups": [
"<string>"
]
}
},
"result": {
"chi2": {
"frequency": [
{
"group": "<string>",
"value": 123,
"expected": 123
}
],
"chi2Statistic": 123,
"pValue": 123
},
"zTest": {
"baselineMeanAbs": 123,
"comparedMeanAbs": 123,
"baselineMeanRel": 123,
"comparedMeanRel": 123,
"differenceAbs": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
},
"differenceRel": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
},
"zStatistic": 123,
"pValue": 123,
"varianceReductionRate": 123,
"unadjustedBaselineMeanAbs": 123,
"unadjustedComparedMeanAbs": 123,
"baselineSampleSize": 123,
"comparedSampleSize": 123
},
"gstZTest": {
"baselineMeanAbs": [
123
],
"comparedMeanAbs": [
123
],
"baselineMeanRel": [
123
],
"comparedMeanRel": [
123
],
"differenceAbs": [
{
"timeLabel": "<string>",
"estimate": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
}
}
],
"differenceRel": [
{
"timeLabel": "<string>",
"estimate": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
}
}
],
"zStatistic": [
123
],
"varianceReductionRate": [
123
],
"unadjustedBaselineMeanAbs": [
123
],
"unadjustedComparedMeanAbs": [
123
],
"baselineSampleSize": [
123
],
"comparedSampleSize": [
123
]
},
"ratio": {
"baselineRatioAbs": 123,
"comparedRatioAbs": 123,
"baselineRatioRel": 123,
"comparedRatioRel": 123,
"ratioDifferenceAbs": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
},
"ratioDifferenceRel": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
},
"zStatistic": 123,
"pValue": 123,
"varianceReductionRate": 123,
"unadjustedBaselineRatioAbs": 123,
"unadjustedComparedRatioAbs": 123,
"unadjustedBaselineNumerator": 123,
"unadjustedComparedNumerator": 123,
"unadjustedBaselineDenominator": 123,
"unadjustedComparedDenominator": 123,
"baselineSampleSize": 123,
"comparedSampleSize": 123
},
"tunncDesign": {
"baselineMeanAbs": [
123
],
"comparedMeanAbs": [
123
],
"baselineMeanRel": [
123
],
"comparedMeanRel": [
123
],
"differenceAbs": [
{
"timeLabel": "<string>",
"estimate": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
}
}
],
"differenceRel": [
{
"timeLabel": "<string>",
"estimate": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
}
}
],
"varianceReductionRate": [
123
]
},
"gstRatio": {
"baselineRatioAbs": [
123
],
"comparedRatioAbs": [
123
],
"baselineRatioRel": [
123
],
"comparedRatioRel": [
123
],
"ratioDifferenceAbs": [
{
"timeLabel": "<string>",
"estimate": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
}
}
],
"ratioDifferenceRel": [
{
"timeLabel": "<string>",
"estimate": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
}
}
],
"zStatistic": [
123
],
"varianceReductionRate": [
123
],
"unadjustedBaselineRatioAbs": [
123
],
"unadjustedComparedRatioAbs": [
123
],
"unadjustedBaselineNumerator": [
123
],
"unadjustedComparedNumerator": [
123
],
"unadjustedBaselineDenominator": [
123
],
"unadjustedComparedDenominator": [
123
],
"baselineSampleSize": [
123
],
"comparedSampleSize": [
123
]
},
"asympCs": {
"baselineMeanAbs": [
123
],
"comparedMeanAbs": [
123
],
"baselineMeanRel": [
123
],
"comparedMeanRel": [
123
],
"differenceAbs": [
{
"timeLabel": "<string>",
"estimate": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
}
}
],
"differenceRel": [
{
"timeLabel": "<string>",
"estimate": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
}
}
],
"varianceReductionRate": [
123
],
"unadjustedBaselineMeanAbs": [
123
],
"unadjustedComparedMeanAbs": [
123
],
"baselineSampleSize": [
123
],
"comparedSampleSize": [
123
]
},
"asympCsRatio": {
"baselineRatioAbs": [
123
],
"comparedRatioAbs": [
123
],
"baselineRatioRel": [
123
],
"comparedRatioRel": [
123
],
"ratioDifferenceAbs": [
{
"timeLabel": "<string>",
"estimate": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
}
}
],
"ratioDifferenceRel": [
{
"timeLabel": "<string>",
"estimate": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
}
}
],
"zStatistic": [
123
],
"varianceReductionRate": [
123
],
"unadjustedBaselineRatioAbs": [
123
],
"unadjustedComparedRatioAbs": [
123
],
"unadjustedBaselineNumerator": [
123
],
"unadjustedComparedNumerator": [
123
],
"unadjustedBaselineDenominator": [
123
],
"unadjustedComparedDenominator": [
123
],
"baselineSampleSize": [
123
],
"comparedSampleSize": [
123
]
}
},
"currentSampleSize": 123,
"requiredSampleSize": 123,
"isSignificant": {
"value": true
},
"comparisonId": "<string>",
"groupStats": [
{
"id": "<string>",
"sampleSize": 123
}
]
}
],
"labels": [
{}
]
}
],
"adjustedAlpha": 123,
"adjustedBeta": 123
}
],
"recommendations": [
{
"groups": {
"single": "<string>",
"pair": {
"baseline": "<string>",
"compared": "<string>"
},
"multiple": {
"groups": [
"<string>"
]
}
}
}
],
"annotations": [
{
"context": [
{
"value": "<string>"
}
],
"info": "<string>",
"warning": "<string>",
"error": {
"details": "<string>"
}
}
],
"statsCacheEntry": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
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.
Show child attributes
Show child attributes
AnalysisData: The data for each hypothesis.
Show child attributes
Show child attributes
Response
200 - application/json
OK
The analysis results for each hypothesis.
Show child attributes
Show child attributes
Overall recommendations for each comparison according to specified decision rule.
Show child attributes
Show child attributes
List of issues discovered during the analysis.
Show child attributes
Show child attributes
Cache entry used, empty if not cached.
Was this page helpful?
⌘I
Run Analysis
curl --request POST \
--url https://stats.eu.confidence.dev/v2/stats:runAnalysis \
--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": [
{}
]
}
]
}
],
"settings": {
"disableSegmentAlphaAdjustment": true
}
},
"data": {
"hypotheses": [
{
"id": "<string>",
"segments": [
{
"dimensions": [
{}
],
"groups": [
{
"group": "<string>",
"data": {
"chi2": {},
"zTest": {},
"gstZTest": {},
"ratio": {},
"tunncDesign": {},
"gstRatio": {},
"asympCs": {},
"asympCsRatio": {}
}
}
],
"labels": [
{}
]
}
]
}
]
}
}
'import requests
url = "https://stats.eu.confidence.dev/v2/stats:runAnalysis"
payload = {
"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": [{}]
}
]
}
],
"settings": { "disableSegmentAlphaAdjustment": True }
},
"data": { "hypotheses": [
{
"id": "<string>",
"segments": [
{
"dimensions": [{}],
"groups": [
{
"group": "<string>",
"data": {
"chi2": {},
"zTest": {},
"gstZTest": {},
"ratio": {},
"tunncDesign": {},
"gstRatio": {},
"asympCs": {},
"asympCsRatio": {}
}
}
],
"labels": [{}]
}
]
}
] }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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: [{}]
}
]
}
],
settings: {disableSegmentAlphaAdjustment: true}
},
data: {
hypotheses: [
{
id: '<string>',
segments: [
{
dimensions: [{}],
groups: [
{
group: '<string>',
data: {
chi2: {},
zTest: {},
gstZTest: {},
ratio: {},
tunncDesign: {},
gstRatio: {},
asympCs: {},
asympCsRatio: {}
}
}
],
labels: [{}]
}
]
}
]
}
})
};
fetch('https://stats.eu.confidence.dev/v2/stats:runAnalysis', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://stats.eu.confidence.dev/v2/stats:runAnalysis",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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' => [
[
]
]
]
]
]
],
'settings' => [
'disableSegmentAlphaAdjustment' => true
]
],
'data' => [
'hypotheses' => [
[
'id' => '<string>',
'segments' => [
[
'dimensions' => [
[
]
],
'groups' => [
[
'group' => '<string>',
'data' => [
'chi2' => [
],
'zTest' => [
],
'gstZTest' => [
],
'ratio' => [
],
'tunncDesign' => [
],
'gstRatio' => [
],
'asympCs' => [
],
'asympCsRatio' => [
]
]
]
],
'labels' => [
[
]
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://stats.eu.confidence.dev/v2/stats:runAnalysis"
payload := strings.NewReader("{\n \"plan\": {\n \"alpha\": 123,\n \"power\": 123,\n \"groups\": [\n {\n \"id\": \"<string>\",\n \"weight\": 123\n }\n ],\n \"comparisons\": {\n \"allVsAll\": {}\n },\n \"hypotheses\": [\n {\n \"id\": \"<string>\",\n \"type\": {},\n \"segments\": [\n {\n \"params\": {\n \"zTest\": {},\n \"ratio\": {},\n \"tunncDesign\": {\n \"optimalSampleSize\": 123,\n \"weight\": [\n {}\n ]\n },\n \"asympCs\": {\n \"optimalSampleSize\": 123\n },\n \"asympCsRatio\": {\n \"optimalSampleSize\": 123\n }\n },\n \"dimensions\": [\n {}\n ]\n }\n ]\n }\n ],\n \"settings\": {\n \"disableSegmentAlphaAdjustment\": true\n }\n },\n \"data\": {\n \"hypotheses\": [\n {\n \"id\": \"<string>\",\n \"segments\": [\n {\n \"dimensions\": [\n {}\n ],\n \"groups\": [\n {\n \"group\": \"<string>\",\n \"data\": {\n \"chi2\": {},\n \"zTest\": {},\n \"gstZTest\": {},\n \"ratio\": {},\n \"tunncDesign\": {},\n \"gstRatio\": {},\n \"asympCs\": {},\n \"asympCsRatio\": {}\n }\n }\n ],\n \"labels\": [\n {}\n ]\n }\n ]\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://stats.eu.confidence.dev/v2/stats:runAnalysis")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"plan\": {\n \"alpha\": 123,\n \"power\": 123,\n \"groups\": [\n {\n \"id\": \"<string>\",\n \"weight\": 123\n }\n ],\n \"comparisons\": {\n \"allVsAll\": {}\n },\n \"hypotheses\": [\n {\n \"id\": \"<string>\",\n \"type\": {},\n \"segments\": [\n {\n \"params\": {\n \"zTest\": {},\n \"ratio\": {},\n \"tunncDesign\": {\n \"optimalSampleSize\": 123,\n \"weight\": [\n {}\n ]\n },\n \"asympCs\": {\n \"optimalSampleSize\": 123\n },\n \"asympCsRatio\": {\n \"optimalSampleSize\": 123\n }\n },\n \"dimensions\": [\n {}\n ]\n }\n ]\n }\n ],\n \"settings\": {\n \"disableSegmentAlphaAdjustment\": true\n }\n },\n \"data\": {\n \"hypotheses\": [\n {\n \"id\": \"<string>\",\n \"segments\": [\n {\n \"dimensions\": [\n {}\n ],\n \"groups\": [\n {\n \"group\": \"<string>\",\n \"data\": {\n \"chi2\": {},\n \"zTest\": {},\n \"gstZTest\": {},\n \"ratio\": {},\n \"tunncDesign\": {},\n \"gstRatio\": {},\n \"asympCs\": {},\n \"asympCsRatio\": {}\n }\n }\n ],\n \"labels\": [\n {}\n ]\n }\n ]\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://stats.eu.confidence.dev/v2/stats:runAnalysis")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"plan\": {\n \"alpha\": 123,\n \"power\": 123,\n \"groups\": [\n {\n \"id\": \"<string>\",\n \"weight\": 123\n }\n ],\n \"comparisons\": {\n \"allVsAll\": {}\n },\n \"hypotheses\": [\n {\n \"id\": \"<string>\",\n \"type\": {},\n \"segments\": [\n {\n \"params\": {\n \"zTest\": {},\n \"ratio\": {},\n \"tunncDesign\": {\n \"optimalSampleSize\": 123,\n \"weight\": [\n {}\n ]\n },\n \"asympCs\": {\n \"optimalSampleSize\": 123\n },\n \"asympCsRatio\": {\n \"optimalSampleSize\": 123\n }\n },\n \"dimensions\": [\n {}\n ]\n }\n ]\n }\n ],\n \"settings\": {\n \"disableSegmentAlphaAdjustment\": true\n }\n },\n \"data\": {\n \"hypotheses\": [\n {\n \"id\": \"<string>\",\n \"segments\": [\n {\n \"dimensions\": [\n {}\n ],\n \"groups\": [\n {\n \"group\": \"<string>\",\n \"data\": {\n \"chi2\": {},\n \"zTest\": {},\n \"gstZTest\": {},\n \"ratio\": {},\n \"tunncDesign\": {},\n \"gstRatio\": {},\n \"asympCs\": {},\n \"asympCsRatio\": {}\n }\n }\n ],\n \"labels\": [\n {}\n ]\n }\n ]\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"hypotheses": [
{
"id": "<string>",
"segments": [
{
"dimensions": [
{}
],
"comparisons": [
{
"groups": {
"single": "<string>",
"pair": {
"baseline": "<string>",
"compared": "<string>"
},
"multiple": {
"groups": [
"<string>"
]
}
},
"result": {
"chi2": {
"frequency": [
{
"group": "<string>",
"value": 123,
"expected": 123
}
],
"chi2Statistic": 123,
"pValue": 123
},
"zTest": {
"baselineMeanAbs": 123,
"comparedMeanAbs": 123,
"baselineMeanRel": 123,
"comparedMeanRel": 123,
"differenceAbs": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
},
"differenceRel": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
},
"zStatistic": 123,
"pValue": 123,
"varianceReductionRate": 123,
"unadjustedBaselineMeanAbs": 123,
"unadjustedComparedMeanAbs": 123,
"baselineSampleSize": 123,
"comparedSampleSize": 123
},
"gstZTest": {
"baselineMeanAbs": [
123
],
"comparedMeanAbs": [
123
],
"baselineMeanRel": [
123
],
"comparedMeanRel": [
123
],
"differenceAbs": [
{
"timeLabel": "<string>",
"estimate": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
}
}
],
"differenceRel": [
{
"timeLabel": "<string>",
"estimate": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
}
}
],
"zStatistic": [
123
],
"varianceReductionRate": [
123
],
"unadjustedBaselineMeanAbs": [
123
],
"unadjustedComparedMeanAbs": [
123
],
"baselineSampleSize": [
123
],
"comparedSampleSize": [
123
]
},
"ratio": {
"baselineRatioAbs": 123,
"comparedRatioAbs": 123,
"baselineRatioRel": 123,
"comparedRatioRel": 123,
"ratioDifferenceAbs": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
},
"ratioDifferenceRel": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
},
"zStatistic": 123,
"pValue": 123,
"varianceReductionRate": 123,
"unadjustedBaselineRatioAbs": 123,
"unadjustedComparedRatioAbs": 123,
"unadjustedBaselineNumerator": 123,
"unadjustedComparedNumerator": 123,
"unadjustedBaselineDenominator": 123,
"unadjustedComparedDenominator": 123,
"baselineSampleSize": 123,
"comparedSampleSize": 123
},
"tunncDesign": {
"baselineMeanAbs": [
123
],
"comparedMeanAbs": [
123
],
"baselineMeanRel": [
123
],
"comparedMeanRel": [
123
],
"differenceAbs": [
{
"timeLabel": "<string>",
"estimate": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
}
}
],
"differenceRel": [
{
"timeLabel": "<string>",
"estimate": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
}
}
],
"varianceReductionRate": [
123
]
},
"gstRatio": {
"baselineRatioAbs": [
123
],
"comparedRatioAbs": [
123
],
"baselineRatioRel": [
123
],
"comparedRatioRel": [
123
],
"ratioDifferenceAbs": [
{
"timeLabel": "<string>",
"estimate": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
}
}
],
"ratioDifferenceRel": [
{
"timeLabel": "<string>",
"estimate": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
}
}
],
"zStatistic": [
123
],
"varianceReductionRate": [
123
],
"unadjustedBaselineRatioAbs": [
123
],
"unadjustedComparedRatioAbs": [
123
],
"unadjustedBaselineNumerator": [
123
],
"unadjustedComparedNumerator": [
123
],
"unadjustedBaselineDenominator": [
123
],
"unadjustedComparedDenominator": [
123
],
"baselineSampleSize": [
123
],
"comparedSampleSize": [
123
]
},
"asympCs": {
"baselineMeanAbs": [
123
],
"comparedMeanAbs": [
123
],
"baselineMeanRel": [
123
],
"comparedMeanRel": [
123
],
"differenceAbs": [
{
"timeLabel": "<string>",
"estimate": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
}
}
],
"differenceRel": [
{
"timeLabel": "<string>",
"estimate": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
}
}
],
"varianceReductionRate": [
123
],
"unadjustedBaselineMeanAbs": [
123
],
"unadjustedComparedMeanAbs": [
123
],
"baselineSampleSize": [
123
],
"comparedSampleSize": [
123
]
},
"asympCsRatio": {
"baselineRatioAbs": [
123
],
"comparedRatioAbs": [
123
],
"baselineRatioRel": [
123
],
"comparedRatioRel": [
123
],
"ratioDifferenceAbs": [
{
"timeLabel": "<string>",
"estimate": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
}
}
],
"ratioDifferenceRel": [
{
"timeLabel": "<string>",
"estimate": {
"estimate": 123,
"stdErr": 123,
"lower": 123,
"upper": 123,
"powered": 123,
"isSignificant": {
"value": true
}
}
}
],
"zStatistic": [
123
],
"varianceReductionRate": [
123
],
"unadjustedBaselineRatioAbs": [
123
],
"unadjustedComparedRatioAbs": [
123
],
"unadjustedBaselineNumerator": [
123
],
"unadjustedComparedNumerator": [
123
],
"unadjustedBaselineDenominator": [
123
],
"unadjustedComparedDenominator": [
123
],
"baselineSampleSize": [
123
],
"comparedSampleSize": [
123
]
}
},
"currentSampleSize": 123,
"requiredSampleSize": 123,
"isSignificant": {
"value": true
},
"comparisonId": "<string>",
"groupStats": [
{
"id": "<string>",
"sampleSize": 123
}
]
}
],
"labels": [
{}
]
}
],
"adjustedAlpha": 123,
"adjustedBeta": 123
}
],
"recommendations": [
{
"groups": {
"single": "<string>",
"pair": {
"baseline": "<string>",
"compared": "<string>"
},
"multiple": {
"groups": [
"<string>"
]
}
}
}
],
"annotations": [
{
"context": [
{
"value": "<string>"
}
],
"info": "<string>",
"warning": "<string>",
"error": {
"details": "<string>"
}
}
],
"statsCacheEntry": "<string>"
}
