
Causal Claim Referee
Referees a causal claim against an observational table (JSON rows, CSV text, or a published contingency table with counts) and leads with a verdict, confidence, whether the claim holds, the crude and adjusted effects with bootstrap intervals, and a concrete next step. Underneath: crude and stratified effects, Mantel-Haenszel pooling, Simpson's-paradox detection, d-separation and backdoor/front-door checks with minimal adjustment sets, g-formula standardization with positivity checks, exact or seeded Monte Carlo permutation tests, and a PC-algorithm check of the DAG against the data. Verdict by code rules; with a caller-supplied DAG no model is called and the result is reproducible. Conclusions hold only under the DAG and no-unmeasured-confounding assumptions, which are listed in the output; this is statistical analysis, not a substitute for a randomized trial.
What you get
Tells a buyer whether a claimed cause-and-effect survives confounding, Simpson's reversals and unidentifiability, with reproducible numbers and a stated next step instead of an LLM opinion.
Call it
Send the JSON body below to https://agents.writerslogic.com/api/v1/prove-causality. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.
curl -i -X POST https://agents.writerslogic.com/api/v1/prove-causality \
-H 'content-type: application/json' \
-d '{"data":[{"treatment":"A","stone_size":"small","success":1,"n":81},{"treatment":"A","stone_size":"small","success":0,"n":6},{"treatment":"A","stone_size":"large","success":1,"n":192},{"treatment":"A","stone_size":"large","success":0,"n":71},{"treatment":"B","stone_size":"small","success":1,"n":234},{"treatment":"B","stone_size":"small","success":0,"n":36},{"treatment":"B","stone_size":"large","success":1,"n":55},{"treatment":"B","stone_size":"large","success":0,"n":25}],"countColumn":"n","treatment":"treatment","outcome":"success","covariates":["stone_size"],"treatedValue":"B","claim":"Treatment B causes a higher recovery rate than treatment A.","claimDirection":"positive","dag":{"edges":[{"from":"stone_size","to":"treatment"},{"from":"stone_size","to":"success"},{"from":"treatment","to":"success"}]}}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
data | array<object>; max 20000 items | no | Observational table as an array of row objects (at most 20000 rows). Cells are string, number, boolean or null; rows missing a used variable are dropped. Provide this or csv. |
csv | string; length 10..3000000 | no | Alternative to data: CSV text with a header line (comma, semicolon or tab separated; quoted fields allowed; at most 20000 data rows). Numeric cells become numbers. |
countColumn | string; length 1..100 | no | Name of a column holding how many times each row repeats, so a published contingency table can be sent as a few aggregate rows (counts must be non-negative integers; the expanded table is capped at the row limit). |
treatment | string; length 1..100 | yes | Column with exactly two distinct values. |
outcome | string; length 1..100 | yes | Binary column (risk difference, risk ratio, odds ratio) or numeric column (mean difference). |
covariates | array<string; length 1..100>; max 12 items | yes | Candidate adjustment variables (at most 12). Numeric ones with more than `bins` distinct values are cut at deterministic quantile edges; others must have at most 20 levels. |
claim | string; length 3..2000 | yes | The causal claim being refereed, in plain language. |
dag | object | no | Your causal DAG (formal input: no LLM is called to build the graph or, by default, the report). Omit to have one proposed by two independent model samples, which is then an assumption. |
treatedValue | one of | no | Treatment value that counts as treated; required unless the values are numeric or boolean (then the larger is treated). |
successValue | one of | no | Outcome value that counts as success for a binary outcome; same default rule. |
outcomeType | string; one of "binary", "continuous" | no | Force the outcome type; inferred from the number of distinct values otherwise. |
claimDirection | string; one of "positive", "negative", "nonzero" | no | Direction of the claimed effect of treated vs control; default nonzero. |
bins | integer; 2..10 | no | Quantile bins for numeric covariates, default 4. |
alpha | number; 0.001..0.2 | no | Significance level for the permutation test and the (1-alpha) bootstrap interval, default 0.05. |
seed | integer; 0..4294967295 | no | Seed for bootstrap and Monte Carlo; default derived from the input hash. |
bootstrapReps | integer; 100..2000 | no | |
permutationSamples | integer; 1000..200000 | no | Used only when the exact enumeration would exceed 1000000 label assignments. |
llmReport | boolean | no | Ask a model to write the executive report in prose (numbers verified in code, template fallback). Default false: the report is a deterministic template over the computed results. |
descriptions | object | no | Optional one-line description per variable, used only to propose the DAG. |
Example request body
{
"data": [
{
"treatment": "A",
"stone_size": "small",
"success": 1,
"n": 81
},
{
"treatment": "A",
"stone_size": "small",
"success": 0,
"n": 6
},
{
"treatment": "A",
"stone_size": "large",
"success": 1,
"n": 192
},
{
"treatment": "A",
"stone_size": "large",
"success": 0,
"n": 71
},
{
"treatment": "B",
"stone_size": "small",
"success": 1,
"n": 234
},
{
"treatment": "B",
"stone_size": "small",
"success": 0,
"n": 36
},
{
"treatment": "B",
"stone_size": "large",
"success": 1,
"n": 55
},
{
"treatment": "B",
"stone_size": "large",
"success": 0,
"n": 25
}
],
"countColumn": "n",
"treatment": "treatment",
"outcome": "success",
"covariates": [
"stone_size"
],
"treatedValue": "B",
"claim": "Treatment B causes a higher recovery rate than treatment A.",
"claimDirection": "positive",
"dag": {
"edges": [
{
"from": "stone_size",
"to": "treatment"
},
{
"from": "stone_size",
"to": "success"
},
{
"from": "treatment",
"to": "success"
}
]
}
}
Result
The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.
| Field | Type | Required | Description |
|---|---|---|---|
headline | object | no | Verdict-first digest computed in code: verdict, confidence, claimSupported (true, false or null when undecidable), crude and adjusted effect with bootstrap intervals, dagSource, a one-sentence summary and a concrete nextStep. |
deterministic | boolean | no | True only for the formal-IR path (caller DAG): no model output can influence the verdict. False when the DAG came from a model or from the outage fallback. |
status | string; one of "OK", "BUDGET_EXCEEDED" | no | |
verdict | string; one of "SUPPORTED_UNDER_ASSUMPTIONS", "CONFOUNDED", "SIMPSONS_REVERSAL", "NOT_IDENTIFIABLE", "INSUFFICIENT_DATA", "NOT_SUPPORTED" | no | |
verdictRule | string | no | |
confidence | string; one of "low", "medium", "high" | no | |
reasons | array<string> | no | |
claim | string | no | |
claimEvaluation | object | no | |
data | object | no | |
dag | object | no | The graph used, its source (caller, llm_proposed, default_all_confounders) and whether it is an assumption. |
identification | object | no | Minimal backdoor adjustment sets, front-door sets, and variables not to adjust for (mediators, colliders, post-treatment). |
effects | object | no | Crude and adjusted risk difference / risk ratio / odds ratio or mean difference with seeded bootstrap intervals. |
tests | object | no | Exact or Monte Carlo permutation p-values (within strata for the adjusted test), Fisher exact, Mantel-Haenszel test. |
stratification | object | no | |
simpson | object | no | |
dagCheck | object | no | PC-algorithm skeleton and orientations from the data, and the conflicts with the assumed DAG. |
caveats | array<string> | no | |
assumptions | array<string> | no | |
report | object | no | Executive report; source is llm only if every number in it appears in the computed results. |
translation | one of | no | |
audit | object | no |
Pay and connect
Available through: x402 (USDC on Base), MCP, RapidAPI, Apify.
Machine-readable
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent