← Back to all development cases
Development case · blind model judgment pending independent human review; not a formal Benchmark conclusion.
AutocompleteNo-Evidence version preferred47 / 162 · e740964f0f398341

Tutorial: Introduction to computational causal inference using reproducible Stata, R and Python code

Statistics · 2012.09920v2

FLOWING EVIDENCE BENCHMARK

How do we tell whether Evidence helps?

At the same writing position, with the same model and task, how does supplying retrieved paper passages change the first output? We compare matched versions and retain ties, unusable outputs and incomplete reviews.

SAME DRAFT · EVIDENCE ON OR OFF

01 · FIXED WRITING POSITION

MANUSCRIPT

Same writing position ▌

Matched autocomplete at the same draft position

02 · TWO MATCHED INPUTS

SHARED BY BOTH

Manuscript context, model, task and prompt

A · With Evidence

Retrieved paper passages supplied

B · Without Evidence

No retrieved passages supplied

LLM

Same model and version

A → first output

B → first output

Blind judge agent

First outputs are anonymized as X and Y

Continuation review: accuracy, fit to the writing task and usability
Returns: X preferred / tie / Y preferred / both unusable

Order check: X / Y → Y / X

HOW DOES BLIND JUDGING WORK?

① Anonymize both outputs
The judge sees the same draft and both first outputs without knowing which received Evidence.

② Compare and swap order
The judge applies task-specific criteria in X/Y and then Y/X order.

③ Review disagreements
A third pass resolves disagreements. Incomplete reviews remain in the denominator.

How are autocomplete positions stratified?

Before seeing generation outcomes, we check whether a retrieved passage contains a specific proposition that directly supports the next writing move. Those positions appear in the left opportunity group; the rest are ordinary positions on the right. We select a balanced sample from admitted papers in each field. The 50/50 split is experimental, not a measure of how often either type occurs in writing.

AUTOCOMPLETE · 110

Biology, statistics and astrophysics

55 positions on each side; statistics uses the ten-paper rerun.

AUTOCOMPLETE · 52

Psychology and climate science

26 positions on each side; psychology includes nine papers and climate science four.

How are the table percentages calculated?

Across five fields there are 81 source-opportunity positions. The original blind review preferred Evidence in 51; a task check moved one empty Evidence continuation to both unusable, leaving 50 in public counts. In the ordinary group, another pair of empty outputs moved from no winner to both unusable. Original verdicts remain visible on case pages.

50Evidence version preferred
÷
81All positions in this group
=
62%Evidence preference in this group

Source contribution is a separate review: 16 of 21 Evidence wins entered into source review directly used retrieved papers; another 29 wins await review.

These are development-stage model judgments pending independent human review. They are not formal Benchmark conclusions and do not, on their own, establish causality.

Manuscript writing position

Text excerpt · not a PDF page

Research manuscript · excerpt

Tutorial: Introduction to computational causal inference using reproducible Stata, R and Python code

1 Introduction

…w the computational implementation of different causal inference estimators from a historical perspective where different estimators were developed to overcome the limitations of the previous one. Furthermore, we also briefly introduce the potential outcomes framework, illustrate the use of different methods using an illustration from the health care setting, and most importantly, we provide reproducible and commented code in Stata, R and Python for researchers to apply in their own observational study. The code can be accessed at https://github.com/migariane/TutorialCausalInferenceEstimators

… behavioral sciences are causal in nature. For example, what is the mortality risk difference amongst patients offered a surgical procedure versus those who did not receive it in a given population? [ 1 ] Causal inference methods may be used to answer this scientific question where a clinical trial is unfeasible or unethical (e.g. a surgical procedure). [ 2 ] Causal inference methods are based on the counterfactual framework introduced by Neyman in the randomized experiment setting, then extended to time-fixed and time-varying observational studies by Rubin and Robins, respectively. ( 3 , 4 )

↓ Next paragraph was generated here

The highlighted text is near the writing position. This is a layout of the evaluation input, not a PDF screenshot.

A matched comparison at the same writing positionJudgment: No-Evidence version preferred

Both arms use the same model, task and manuscript context. Only the retrieved passages differ. The first recorded output from each arm is shown below.

Evidence

Same model and position · retrieved passages supplied · first output

Not preferred in this comparison

In observational studies with time-varying treatments, marginal structural models (MSMs) were developed to estimate the joint causal effects of a time-varying treatment in the presence of time-varying confounding, relying on a sequential randomization assumption for identification.

Passages supplied to the Evidence version

A Simple Weighted Approach for Instrumental Variable Estimation of Marginal Structural Mean Models ↗

Robins [ 13 , 14 , 15 ] introduced marginal structural models (MSMs), a class of counterfactual models that encode the joint causal effects of time-varying treatment in the presence of time-varying confounding. For identification, Robins relied on a sequential randomization assumption (SRA), which r…

Read full passage excerpt

Robins [ 13 , 14 , 15 ] introduced marginal structural models (MSMs), a class of counterfactual models that encode the joint causal effects of time-varying treatment in the presence of time-varying confounding. For identification, Robins relied on a sequential randomization assumption (SRA), which rules out unmeasured confounding of the time-varying treatment. MSMs have since become the standard analytic approach to evaluate causal effects in time-varying epidemiological studies [ 7 , 10 , 3 , 4 , 17 ] . However, SRA may be hard to justify in many such settings, and unmeasured confounding bias may invalidate causal claims inferred by the approach. In the case of a point treatment, a large literature in causal inference has developed over the years on the instrumental variable method aiming to address unmeasured confounding [ 8 , 2 , 12 ] .

No Evidence

Same model and position · no retrieved passages · first output

Preferred by blind review

This tutorial is organized as follows. We first review the potential outcomes framework and the assumptions required for causal identification, then present a historical progression of estimators, from regression adjustment and propensity score methods to doubly robust and machine learning-based approaches. Each estimator is illustrated using a motivating example from the health care setting, with fully reproducible and commented code provided in Stata, R and Python.

Judgment and task check

The blinded model review preferred the no-Evidence version. Its original rationale appears below.

Read the original model judgment

In this rationale, Output A = Evidence; Output B = No Evidence.

Both outputs are grounded and coherent, but B is substantially more useful for the manuscript. The task is to continue the blank paragraph with one coherent academic paragraph. Looking at the draft structure: the first paragraph is the abstract/overview, and the second paragraph (ending with citations 3,4) introduces causal inference methods and their historical origins. The blank paragraph needs to bridge to what follows. Output B directly continues the manuscript's stated purpose from the abstract—it outlines the tutorial's organization, covering the potential outcomes framework, historical progression of estimators, and the healthcare illustration with code. This mirrors the abstract's promises ('we also briefly introduce...illustrate...provide reproducible...code') and creates natural forward momentum. Output A, while factually accurate based on the source about MSMs, introduces a specific technical topic (MSMs for time-varying treatments) that feels disjointed—it doesn't flow from the preceding paragraph's introduction of basic counterfactual framework, and it prematurely jumps to an advanced topic without the structural signposting that B provides. B requires less editing to integrate and better preserves the manuscript's stated scope and organization.

The passages are input material; their presence does not mean an output used them or that they support every claim. Draft and source passages are excerpted; no simulated scores or PDF appear here.