SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.18905 · 2024

Detecting critical treatment effect bias in small subgroups

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 failures of our instrument; 0 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2404.18905.json · badge: /api/ran/2404.18905.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
jaabmar/kernel-test-bias canonical (classifier label)
classifier basis: census
6 ran · 0 no recorded run
FunctionStatusWhere it lives
add_bias_scenario_1 Ran
ran, honoured the contract we drafted
jaabmar/kernel-test-bias/src/datasets/bias_models.py
code served (permissive licence) · get_code("61d7ae5359776aa3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned DataFrame. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pandas as pd
import numpy as np

# Create sample observational data
obs_data = {
    'Y': [100.0, 105.0, 110.0, 95.0, 120.0, 115.0],
    'T': [0, 1, 1, 0, 1, 1],
    'channel': [0, 1, 2, 0, 1, 2],
    'mens': [0, 1, 0, 1, 0, 1],
    'newbie': [0, 0, 1, 1, 0, 0]
}

ARGS = {
    'obs_data': obs_data,
    'bias_for_channel_0': -40,
    'bias_for_channel_1': -40,
    'bias_for_channel_2': 40,
    'bias_for_mens': 20,
    'bias_for_newbie': -10
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
add_bias_scenario_2 Ran
ran, honoured the contract we drafted
jaabmar/kernel-test-bias/src/datasets/bias_models.py
code served (permissive licence) · get_code("efa71661feab89d6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned DataFrame. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import pandas as pd

# Create sample observational data
obs_data = {
    'history': [0.1, 0.2, 0.3, 0.4, 0.5, 0.6],
    'T': [0, 1, 0, 1, 0, 1],
    'newbie': [0, 0, 1, 1, 0, 1],
    'Y': [1.5, 2.3, 3.1, 4.2, 5.0, 6.1]
}

ARGS = {
    'obs_data': obs_data,
    'seed': 50,
    'degree': 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
add_bias_subgroups Ran
ran, honoured the contract we drafted
jaabmar/kernel-test-bias/src/datasets/bias_models.py
code served (permissive licence) · get_code("27f35709e54e53e9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned DataFrame. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import pandas as pd

# Create sample observation data as a dictionary
obs_data = {
    'T': [1, 1, 0, 1, 1, 0],
    'channel': [1, 1, 0, 1, 0, 1],
    'newbie': [1, 1, 0, 1, 0, 1],
    'mens': [1, 0, 1, 1, 0, 0],
    'history': [50, 80, 30, 60, 90, 40],
    'zip_code': [2, 1, 2, 1, 2, 1],
    'Y': [100.0, 150.0, 200.0, 120.0, 180.0, 90.0]
}

ARGS = {
    'obs_data': obs_data,
    'mode': 3,
    'bias': 60
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
estimate_selection_score Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jaabmar/kernel-test-bias/src/experiment_utils.py
code served (permissive licence) · get_code("70402deedf9f5526")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (4, 2) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from sklearn.ensemble import RandomForestClassifier

# Create small synthetic data for x and s
np.random.seed(0)

# x: feature matrix (samples, features)
# Need at least 2 samples for RandomForestClassifier to work
x = np.random.randn(4, 3).astype(np.float32)

# s: binary labels for classification
s = np.array([0, 1, 0, 1])

# seed: random state
seed = 42

ARGS = {
    "x": x,
    "s": s,
    "seed": seed,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (4, 2) — shape (4, 2) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
initialize_model Ran
ran; our contract draft was wrong, not the code
jaabmar/kernel-test-bias/src/experiment_utils.py
code served (permissive licence) · get_code("ea617f3766473da5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import jax
import jax.numpy as jnp
import optax
from flax import linen as nn

class NeuralNetwork(nn.Module):
    features: list
    seed: int = 0

    @nn.compact
    def __call__(self, inputs):
        x = inputs
        for i, feat in enumerate(self.features):
            x = nn.Dense(features=feat)(x)
            if i < len(self.features) - 1:
                x = nn.relu(x)
        x = nn.Dense(features=1)(x)
        out = nn.sigmoid(x)
        return out

def initialize_model(input_size, features, lr, seed):
    if isinstance(features, int):
        features = [features]
    model = NeuralNetwork(features=features, seed=seed)
    params = model.init(jax.random.PRNGKey(seed), jnp.ones((input_size,)))
    tx = optax.adam(learning_rate=lr)
    opt_state = tx.init(params)
    return (model, params, tx, opt_state)

ARGS = {
    "input_size": 4,
    "features": [8, 6],
    "lr": 0.001,
    "seed": 42
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
flax, jax, optax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
split_dataset Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jaabmar/kernel-test-bias/src/datasets/hillstrom.py
code served (permissive licence) · get_code("f7d83fb9da13d37e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 3, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pandas as pd
import numpy as np

# Create a small sample DataFrame with the required 'g1surban' column
np.random.seed(42)
df = pd.DataFrame({
    'g1surban': [1, 2, 1, 2, 1, 2, 1, 2, 1, 2],
    'feature_a': np.random.randn(10),
    'feature_b': np.random.randn(10),
    'feature_c': np.random.randn(10),
})

ARGS = {
    'df': df,
    'support_feature': 'g1surban',
    'support_feature_values': [1, 2],
    'proportion_full_support': 0.5,
    'seed': 42,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 6 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Randomized trials are considered the gold standard for making informed decisions in medicine, yet they often lack generalizability to the patient populations in clinical practice. Observational studies, on the other hand, cover a broader patient population but are prone to various biases. Thus, before using an observational study for decision-making, it is crucial to benchmark its treatment effect estimates against those derived from a randomized trial. We propose a novel strategy to benchmark observational studies beyond the average treatment effect. First, we design a statistical test for the null hypothesis that the treatment effects estimated from the two studies, conditioned on a set of relevant features, differ up to some tolerance. We then estimate an asymptotically valid lower bound on the maximum bias strength for any subgroup in the observational study. Finally, we validate our benchmarking strategy in a real-world setting and show that it leads to conclusions that align with established medical knowledge.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2404.18905")
get_code_for_paper("2404.18905")
have("2404.18905")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2404.18905.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2404.18905.svg)](https://syntology.ai/paper/2404.18905)

Connect an agent — have() is free.