<figure><img src="image_1.png" /></figure>

HAL
open science

# Reweighting the RCT for generalization: finite sample error and variable selection

Bénédicte Colnet, Julie Josse, Gaël Varoquaux, Erwan Scornet

► To cite this version:

Bénédicte Colnet, Julie Josse, Gaël Varoquaux, Erwan Scornet. Reweighting the RCT for generalization: finite sample error and variable selection. 2022. hal-03822662v2

HAL Id: hal-03822662

https://hal.science/hal-03822662v2

Preprint submitted on 4 Nov 2022

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.
# Reweighting the RCT for generalization: finite sample error and variable selection

Bénédicte Colnet * Julie Josse† Gaël Varoquaux‡ Erwan Scornet §

November 4, 2022

## Abstract

Randomized Controlled Trials (RCTs) may suffer from limited scope. In particular, samples may be unrepresentative: some RCTs over- or under-sample individuals with certain characteristics compared to the target population, for which one wants conclusions on treatment effectiveness. Re-weighting trial individuals to match the target population can improve the treatment effect estimation. In this work, we establish the exact expressions of the bias and variance of such reweighting procedures - also called Inverse Propensity of Sampling Weighting (IPSW) - in presence of categorical covariates for any sample size. Such results allow us to compare the theoretical performance of different versions of IPSW estimates. Besides, our results show how the performance (bias, variance, and quadratic risk) of IPSW estimates depends on the two sample sizes (RCT and target population). A by-product of our work is the proof of consistency of IPSW estimates. Results also reveal that IPSW performances are improved when the trial probability to be treated is estimated (rather than using its oracle counterpart). In addition, we study choice of variables: how including covariates that are not necessary for identifiability of the causal effect may impact the asymptotic variance. Including covariates that are shifted between the two samples but not treatment effect modifiers increases the variance while non-shifted but treatment effect modifiers do not. We illustrate all the takeaways in a didactic example, and on a semi-synthetic simulation inspired from critical care medicine.

**Keywords:** Average treatment effect (ATE); Sampling bias; External validity; Transportability; Distributive shift; IPSW.

## 1 Introduction

**Motivation** Modern *evidence-based* medicine puts Randomized Controlled Trial (RCT) at the core of clinical evidence. Indeed, randomization enables to estimate the average treatment effect (called ATE) by avoiding confounding effects of spurious or undesirable associated factors. But more recently, concerns have been raised on the limited scope of RCTs: stringent eligibility criteria, unrealistic real-world compliance, short timeframe, limited sample size, etc. All these possible limitations threaten the external validity of RCT studies to other situations or populations (Rothwell, 2007; Gatsonis and Sally, 2017; Deaton and Cartwright, 2018). The usage of complementary non-randomized data, referred to as *observational* or from the *real world*, brings promises as additional sources of evidence, in particular combined to trials (Kallus et al., 2018; Athey et al., 2020; Liu et al., 2021). For example, assume policy makers are studying an RCT which comes with great promises about a new treatment. But when reading the report, they may discover that the RCT is composed of substantially younger people than the target population of interest. Such a situation can be uncovered from the so-called *Table 1* of this newly published trial, which summarizes the demographics of the study population. In case of treatment effect heterogeneities, e.g. if the younger individuals respond better to the treatment, the ATE estimated from the trial is over-estimated and then biased. Now, assume these policy makers have also at disposal a sample of the actual patients in the district, being a representative sample of the true distribution of age in this population (typically without information on the outcome or the treatment). Can they use this representative sample of the target population of interest to *re-weight* or to *generalize* the trial's findings? The answer is *yes*: the strategy has been formalized and popularized lately (Stuart et al., 2011; Pearl and Bareinboim, 2011; Bareinboim and Pearl, 2012a,b; Tipton, 2013; O'Muircheartaigh and Hedges, 2013; Hartman et al., 2015; Kern et al., 2016; Dahabreh et al., 2020) (reviewed in Colnet et al. (2020); Degtiar and Rose (2022)) and can come under many variants named *generalization*, *transportability*, *recoverability*, and *data-fusion*. In fact, the idea of re-weighting

<footnote>* Soda project-team, Premedical project-team, INRIA (email: benedicte.colnet@inria.fr).</footnote>

<footnote>† Premedical project team, INRIA Sophia-Antipolis, Montpellier, France.</footnote>

<footnote>‡ Soda project-team, INRIA Saclay, France.</footnote>

<footnote>§ Centre de Mathémathiques Appliquées, UMR 7641, École polytechnique, CNRS, Institut Polytechnique de Paris, Palaiseau, France.</footnote>
a trial can be traced back before the 2010's. Several epidemiology books had already presented the core idea under the name *standardization* (Rothman and Greenland, 2000; Rothman, 2011).

In this work, we focus on one estimator used to generalize RCTs: the *Inverse Propensity of Sampling Weighting* (IPSW) (Cole and Stuart, 2010; Stuart et al., 2011), also named *Inverse Odds of Sampling Weights* (IOSW) (Westreich et al., 2017; Josey et al., 2021) or *Inverse probability of participation weighting* (IPPW) (Degtiar and Rose, 2022). Despite an increasing literature on *generalization*, important practical questions remain open (Kern et al., 2016; Tipton et al., 2016; Stuart and Rhodes, 2017; Ling et al., 2022). For instance, which covariates – for e.g. age, and others – should be used to build the weights? Are some covariates increasing or lowering the overall precision? What is the impact of the size of the two samples (trial and representative sample) on the IPSW's properties?

**Outline** We start by illustrating the principles of trial re-weighting and some key results of this article on a toy example (Section 2). Section 2 ends with related works. Then Section 3 introduces the mathematical notations, assumptions, and the precise definition of the IPSW estimator. In particular, we present several versions of the IPSW estimator: whether the covariates probability of the trial or the target population are estimated from the data or assumed as an oracle. This links our results to classic work in causal inference and epidemiology. Section 4 contains all the theoretical results, such as finite sample bias, variance, bounds on the risk, consistency, and large sample variance. We also detail why another version of the IPSW, where the probability of treatment assignment in the trial is also estimated, has a lower variance. Finally, we discuss in Section 4 how additional and non-necessary covariates can either improve or damage variance, depending on their status: whether they are only shifted between the two populations or only treatment-effect modifiers. Section 5 completes the toy example and illustrates all theoretical results on an extensive semi-synthetic example inspired from the medical domain. Finally, Section 6 summarizes all practical takeaways for this research and discusses it.

# 2 Problem setting

## 2.1 Toy example

### 2.1.1 Context and intuitive estimation strategy

Assume that we would like to measure the average effect of a treatment (ATE) A on a outcome Y in a target population of interest $P_T$ (for target), and that an existing Randomized Controlled Trial (RCT) had already been conducted on $n = 150$ individuals, sampled from a population $P_R$ (for randomized), to assess the average effect of A on Y. Usually, the average treatment effect is estimated from a trial via an Horvitz-Thomson estimator (Horvitz and Thompson, 1952),

$$ \hat{\tau}_{HT,n} = \frac{1}{n} \sum_{i \in \text{Trial}} \left( \frac{Y_i A_i}{\pi} - \frac{Y_i (1 - A_i)}{1 - \pi} \right), \quad (1) $$

where $\pi$ is the probability of treatment allocation in the trial (in most applications, $\pi = 0.5$). Figure 1 presents results of a simulated trial with an average treatment effect around 8.2. In addition, assume that the trial provides evidence that the treatment effect is heterogeneous with respect to a certain genetic mutation denoted X (with $X = 1$ for the mutation, and $X = 0$ if no mutation). More specifically, the average treatment effect conditional to X is larger for individuals with $X = 1$ than for those with $X = 0$. This situation is illustrated on Figure 1 where the average effect per strata X is also represented. We have at hand a representative sample of $m = 1000$ individuals from the target population we are interest in (for example from an existing

observational database). We observe that individuals with the genetic mutation ($X = 1$) are over-represented in the trial compared to the target population of interest (see Figure 2). As a consequence, the trial overestimates the target population's ATE we are interested in.

<figure><img src="image_2.png" /><figcaption>**Figure 1:** Treatment effect estimates (absolute difference) measured on a simulated trial of size $n = 150$ sampled according to the trial population $P_T$. On the left the estimate on all individuals, and on the right the two estimate stratified ($X = 0$ and $X = 1$) showing treatment effect heterogeneities along the genetic mutation X.</figcaption></figure>

<table><thead><tr><th></th><th>Target ($P_T$)</th><th>Trial ($P_R$)</th></tr></thead><tbody><tr><td>$X = 1$</td><td>30%</td><td>75%</td></tr><tr><td>$X = 0$</td><td>70%</td><td>25%</td></tr></tbody></table>
Fortunately, the representative sample of the target population can be used to learn weights, and re-weight the trial data in the following way,

$$ \hat{\tau}_{n,m} = \frac{1}{n} \sum_{i \in \text{Trial}} \underbrace{\hat{w}_{n,m}(X_i)}_{\text{Weights}} \underbrace{\left( \frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi} \right)}_{\text{Horvitz-Thomson}}. \quad (2) $$

As detailed later on, the weights $\hat{w}_{n,m}$ aims at estimating the probability ratio $\frac{p_T(x)}{p_R(x)}$, where $p_T(x)$ (resp. $p_R(x)$) is the probability of observing an individual with characteristics $X = x$ in the target (resp. randomized) population. The weights $\hat{w}_{n,m}$ depend on the sizes of the randomized and observational data sets, namely $n$ and $m$. Consequently, the ATE estimator $\hat{\tau}_{n,m}$ depends on the size of two data sets, raising questions on how this estimator behaves (bias and variance) as function of $n$ and $m$.

## 2.1.2 Simulations and first observations

To investigate empirically how $\hat{\tau}_{n,m}$ behaves, we run simulations following the Data Generative Process (DGP) described in Section 2.1.1 and represented in Figure 3a. Figure 3b shows the different estimators in action, showing that the re-weighted trial compensates for the distribution shift as expected.

Figure 3b also shows that estimating $\pi$ from the data and plugging it in Equation 2 leads to a clear gain in variance. This phenomenon is linked to seminal works in causal inference, and is further demonstrated in Section 4.2. Finally, Figure 3c shows that if $m$ remains small compared to $n$ or if $n$ remains small compared to $m$, then the asymptotic variance regime differs (see Corollary 2 for a formal statement, and Figure 6 for an

<figure><img src="image_3.png" /><figcaption>(a) Toy example's data generative model: where individuals with $X = 1$ have a higher average treatment effect compared to individuals with $X = 0$. The baseline, centered on 0, is the same for both stratum.</figcaption></figure>

<figure><img src="image_4.png" /><figcaption>(b) Re-weighting in action: Simulations's results with a trial of size $n = 150$, a target sample of size $m = 1,000$ with 1,000 repetitions, where the naive trial estimate corresponds Equation 1, and re-weighted trial to Equation 2. As expected re-weighting allows to recover the ATE of the target population (red dashed line). It is also possible to estimate $\pi$ from the data, giving another re-weighting estimator with lower variance (later introduced in Definition 10).</figcaption></figure>

<figure><img src="image_5.png" /><figcaption>(c) Two data sets leading to two asymptotic regimes: where two situations are considered, one with a large target sample ($m = 2000$) or a small target sample ($n = 50$). Then, increasing $n$ leads to a variance stagnation if $m$ is small, while increasing $n$ allows to further gain in precision if $n \le m$.</figcaption></figure>

<caption>Figure 3: Toy example's simulations - Minimal adjustment set.</caption>
illustration of the theoretical results).

For correct trial generalization, all shifted treatment effect modifier baseline covariates (see Definition 11 and 12, Section 4.3), such as the genetic mutation X, are necessary (Stuart et al., 2011). But, in practice one may be tempted to add as many covariates V as available to account for all possible sources of external validity bias. Doing so, we may add covariates V that are not needed to properly estimate the weights. This is the case if (i) V is shifted between the two data sets, but in reality is not a treatment effect modifier or if (ii) V is a treatment effect modifier, but not shifted between the two data sets. Figure 4a shows that in (i), the covariate V should not be added, as it can considerably inflate the variance and therefore damage the precision (see Corollary 4 for a formal statement); while in (ii), Figure 4b highlights that the covariate V should be added as the precision can be augmented by adding such covariates (see Corollary 5 for a formal statement).

<figure><img src="image_6.png" /><figcaption>**Figure 4:** Toy example's simulations - Extended adjustment set.</figcaption></figure>

In Section 4, we prove these phenomena, deriving explicit finite sample and asymptotic results to characterize the re-weighting process.

## 2.2 Related work

The estimator $\hat{\tau}_{n,m}$ introduced in the toy example (Equation 2) is an exact implementation of the so-called *Inverse Propensity of Sampling Weighting* (IPSW) where the word *sampling* comes from the popular habit of modeling the problem as the one of a randomized trial suffering from selection bias (Cole and Stuart, 2010; Bareinboim and Pearl, 2012a; Tipton, 2013; Dahabreh et al., 2019). Note that the estimator introduced in Equation 2 can also be linked to post-stratification (Imbens, 2011; Miratrix et al., 2013), where post-stratification belongs to the family of adjustment methods on a single RCT. Note that beyond trial re-weighting, other estimation strategies can be chosen when it comes to generalization, for example stratification (Tipton, 2013; O'Muircheartaigh and Hedges, 2013), modeling the response (G-formula or Outcome Modeling) (Kern et al., 2016; Dahabreh et al., 2019), using both strategies in a so-called doubly-robust approach (AIPSW) (Dahabreh et al., 2019, 2020), or entropy balancing (Josey et al., 2021; Lee et al., 2021).

**Link with IPW** The IPSW can be related – to a certain extent – to the well-known *Inverse Propensity Weighting* (IPW) estimator in the context of a single observational data set (Hirano et al., 2003). Indeed, this corresponds to a mirroring situation, where the weights are no longer the probability ratio, but the probability to be treated (propensity score, Rosenbaum and Rubin, 1983). Robins et al. (1992); Hahn (1998); Hirano et al. (2003) showed that IPW is more efficient when weights are estimated, rather than relying on oracle weights. This curious phenomenon can even be found in other areas of statistics (Efron and Hinkley, 1978).
efficient estimation with a minimal adjustment set, it is known that additional and non-necessary baseline co-
variates in the adjustment set of the IPW can either increase the variance (the so-called instruments) (Velentgas
et al., 2013; Schnitzer et al., 2015; Wooldridge, 2016), while another class of covariates (the ones linked only
to the outcome – and also called outcome-related covariates or risk factors or precision covariates) improves
precision (Hahn, 2004; Lunceford and Davidian, 2004; Brookhart et al., 2006; Lefebvre et al., 2008; Witte and
Didelez, 2018). A recent crash-course about good and bad controls recalls this phenomenon (Cinelli et al., 2022).
Finally, another very recent line of research consists in determining – given a Directed Acyclic Graph (DAG) –
the asymptotically-efficient adjustment set for ATE estimation. This is also named ‘optimal’ valid adjustment
set (O-set), corresponding to the adjustment set ensuring the smallest asymptotic variance compared to other
adjustment sets. Henckel et al. (2022) propose a result for linear model, and Rotnitzky and Smucler (2020)
extend this work for any non-parametrically adjusted estimator. Such methods are meant for complex DAGs
where several possible adjustment sets can be used.

**Theoretical results on IPSW** Expression of the variance has been proposed for an estimator related to the IPSW: the stratification estimator (O’Muircheartaigh and Hedges, 2013; Tipton, 2013). These results only consider the situation of an infinite target sample. Similar expressions can also be found in Rothman and Greenland (2000), also assuming an infinite target sample compared to the trial sample size. Buchanan et al. (2018) propose theoretical properties such as asymptotic variance of a variant of IPSW under a parametric model, using M-estimation methods for the proof (Stefanski and Boos, 2002). *Why a variant?* Because their proof is under the situation of a so-called nested design, that is a trial embedded in a larger observational population, so that there is only one single data set to consider and not two. In addition, we have found no discussion - neither empirical nor theoretical - about the impact of adding non-necessary covariates on the IPSW (or any other generalization’s estimator) properties (e.g., bias, variance). Egami and Hartman (2021) propose a method to estimate a separating set – *i.e.* a set of variables affecting both the sampling mechanism and treatment effect heterogeneity – and in particular when the trial contains many more covariates than the target population sample. However, their work focus on identification. Huitfeldt et al. (2019) also consider covariate selection for generalization, but focus on which covariates are necessary depending on the causal measure chosen (ratio, difference, or other). Yang et al. (2020) addresses a similar problem (for non-probability sample and mean estimation), where they advocate selecting all variables, even instrumental variables, for robustness, although it may come at the cost of drop in efficiency. Note that some existing practical recommendations advocate to add as many covariates as possible (Stuart and Rhodes, 2017).

**Contributions** This work considers several variants of the IPSW, whether or not the weights are oracle, semi-oracle, or estimated. In this context, we derive the asymptotic variance of all the variants of IPSW and we show that several asymptotic regimes exist, depending on the relative size of the RCT compared to the target sample. We also provide finite sample expression of the bias and variance for all the IPSW variants introduced, allowing to bound the risk on this estimator for any samples sizes (trial and target population). From these theoretical results, we explain why the addition of some additional but non-necessary covariates in the adjustment set has a large impact on precision, for the best or the worst. Indeed, while non-shifted treatment effect modifiers improve precision by lowering the variance, adding shifted covariates that are not predictive of the outcome considerably reduces the statistical power of the analysis by inflating the variance. For this latter situation, we provide an explicit formula of the variance inflation when the additional covariate set is independent of the necessary one. These results have important consequences for practitioners because they allow to give precise recommendations about how to select covariates. Note that we link our work to seminal works in causal inference, showing that semi-oracle estimation outperforms a completely oracle estimation, while the exact result on IPW on efficient estimation can not be completely extended to the case of generalization.

All our results assume neither a parametric form of the outcome nor the sampling process, but are established
at the cost of restricting the scope to categorical covariates for adjustment. Within the medical domain, scores
or categories are often used to characterize individuals, which justifies this approach.
# 3 Notations and assumptions for causal identifiability

## 3.1 Notations

### 3.1.1 Problem setting

The notations and assumptions used in this work are grounded in the potential outcome framework (Imbens and Rubin, 2015). We assume to have at hand two data sets:

**A randomized controlled trial** denoted $\mathcal{R}$ (for randomized), assessing the efficacy of a binary treatment A on an outcome Y (ordinal, binary, or continuous) conducted on n iid observations. Each observation i is labelled from 1 to n and can be modelled as sampled from a distribution $P_R(X, Y^{(1)}, Y^{(0)}, A) \in \mathcal{X} \times \mathbb{R}^2 \times \{0, 1\}$, where X is a categorical support. For any observation i, $A_i$ denotes the binary treatment assignment (with $A_i = 0$ if no treatment and $A_i = 1$ if treated), and $Y_i^{(a)}$ is the outcome had the subject been given treatment a (for $a \in \{0, 1\}$), which is assumed to be squared integrable. $Y_i$ denotes the observed outcome, defined as $Y_i = A_i Y_i^{(1)} + (1 - A_i) Y_i^{(0)}$. In addition, this trial is assumed to be a Bernoulli trial with a constant probability of treatment assignment for all units and independence of treatment allocation between units (see in appendix Definition 13)<fnref n="1" />. We denote $\mathbb{P}_R[A_i = 1] = \pi$. $X_i$ is a p-dimensional vector of categorical covariates accounting for individual characteristics on the observation i;

**A sample of the target population of interest** denoted $\mathcal{T}$ (for target), containing m iid individuals samples drawn from a distribution $P_T(X, Y^{(1)}, Y^{(0)}, A) \in \mathcal{X} \times \mathbb{R}^2 \times \{0, 1\}$, labelled from n + 1 to n + m. In this data set, we only observe individual categorical characteristics $X_i$. For simplicity, we further use the notation $P_T(X)$ for the marginal of X on distribution $P_T$.

Finally, the probability of X in the target population (resp. trial population) is denoted $p_T(x)$ (resp. $p_R(x)$). Mathematically, a covariate shift between the two populations occurs when there exists $x \in \mathcal{X}$ such that $p_R(x) \neq p_T(x)$. The setting and notations are summarized on Figure 5.

<figure><img src="image_7.png" /><figcaption>**Figure 5: Summary of the data at hand:** on the left, a randomized controlled trial $\mathcal{R}$ of size n sampled according to $P_R$ and informing about the effect of a treatment A on the outcome Y. On the right, a sample $\mathcal{T}$ of size m sampled from the target population of interest $P_T$, containing only information on covariates X. As suggested on the drawing, n is often smaller than m, as trials are usually of limited size compared to large national data base or cohort.</figcaption></figure>

**Comments on the notations** Note that a large part of the literature models the problem with a sampling mechanism from a super population. Doing so, the target and the trial samples are assumed sampled from this super population, with different mechanisms leading to a distributional shift of the trial (e.g. the framing in Stuart et al., 2011; Hartman, 2021). Still, as soon as we are not working with a nested trial (that is a trial embedded in the target sample) and if only baseline covariates are considered for adjustment, the framing with a sampling model is equivalent to the problem setting introduced above (Colnet et al., 2020; Westreich et al., 2017). Note that the literature is increasing adopting the framing that we use here (Kern et al., 2016; Nie et al., 2021; Chattopadhyay et al., 2022).

### 3.1.2 Target quantity of interest

Recall that two distributions, indexed by R and T are involved in our problem setting (Section 3.1.1). Therefore, we will use these indices to denote quantities (expectations, probabilities) taken with respect to these distributions, for example $\mathbb{E}_R[\cdot]$ (resp. $\mathbb{E}_T[\cdot]$) for an expectation over $P_R$ (resp. $P_T$). We define the target population average treatment effect ATE (sometimes called TATE for Target):

$$ \tau := \mathbb{E}_T[Y^{(1)} - Y^{(0)}]. \qquad (3) $$

<footnote n="1">¹For a review of trial designs, in particular explaining the difference between a Bernoulli and a completely randomized design, we refer the reader to Chapter 2 of Imbens and Rubin (2015).</footnote>
Because the randomized controlled data $\mathcal{R}$ are not sampled from the target population of interest, the sample average treatment effect $\tau_R$ (sometimes called SATE for Sample) estimated from this population,

$$ \tau_R := \mathbb{E}_R [Y^{(1)} - Y^{(0)}], $$

may be biased, that is $\tau_R \neq \tau$. While not being the target quantity of interest, we also introduce the so-called Conditional Average Treatment Effect (CATE), as

$$ \forall x \in \mathcal{X}, \tau(x) := \mathbb{E}_T [Y^{(1)} - Y^{(0)} | X = x]. $$

## 3.2 Identification assumptions

Assumptions are needed to be able to generalize the findings from the population data $P_R$ toward the population $P_T$.

**Assumptions on the trial** We first need validity of the trial, also called internal validity. These assumptions are the usual ones formulated in causal inference, and in particular for randomized controlled trials within the potential outcomes framework (Imbens and Rubin, 2015; Hernan, 2020).

**Assumption 1** (Representativity of the randomized data). For all $i \in \mathcal{R}, X_i \sim P_R(X)$ where $P_R$ is the population distribution from which the RCT was sampled.

**Assumption 2** (Trial's internal validity). The RCT at hand $\mathcal{R}$ is assumed to be internaly valid, such that

(i) Consistency and no interference hold, that is: $\forall i \in \mathcal{R}, Y_i = A_i Y_i^{(1)} + (1 - A_i) Y_i^{(0)}$ -an assumption often termed SUTVA (stable unit treatment value);

(ii) Treatment randomization holds, that is: $\forall i \in \mathcal{R}, \{Y_i^{(1)}, Y_i^{(0)}\} \perp A_i$;

(iii) Positivity of trial treatment assignment holds, that is: $0 < \pi < 1$ (usually $\pi = 0.5$).

**Assumptions for generalization** The two following assumptions are specific to generalization or transportability.

**Assumption 3** (Transportability). $\forall x \in \mathcal{X}, \mathbb{P}_R(Y^{(1)} - Y^{(0)} | X = x) = \mathbb{P}_T(Y^{(1)} - Y^{(0)} | X = x)$.

The transportability assumption (Stuart et al., 2011; Pearl and Bareinboim, 2011), also called sample ignorability for treatment effects (Kern et al., 2016) or Conditional Ignorability (Hartman, 2021), is probably the most important assumption to generalize or transport the trial findings to the target population, as this requires to have access to all shifted covariates being treatment modifiers. In other words, it assumes that all the systematic variations in the treatment effect are captured by the covariates $X$ (O'Muircheartaigh and Hedges, 2013). The covariates $X$ are usually named the adjustment or separating set. Note that the concept of treatment effect modifiers depends on the causal measure chosen; in this paper, we only consider the absolute difference most common for a continuous outcome as detailed in Equation 3. Would we have chosen the log-odd-ratio, for instance, then the covariates being treatment effect modifiers could be different. Finally, note that Pearl and Bareinboim (2011) introduces selection diagram to formalize this assumption relying on causal diagrams. Pearl (2015) details why diagrams can contain more identification scenarii. But in this work, we only consider baseline covariates for the transportability assumption (i.e no front-door adjustment).

**Assumption 4** (Support inclusion). $\forall x \in \mathcal{X}, p_R(x) > 0$, and $\text{supp}(P_T(X)) \in \text{supp}(P_R(X))$.

Note that this last assumption is sometimes referred as the positivity of trial participation and can also be viewed as a sampling process with non-zero probability for all individuals.

## 3.3 Estimators

In this work, we denote any estimator targeting a quantity $\tau$ as $\hat{\tau}_{n,m}$ where the index $n$ or $m$ is employed to characterise which data were used in the estimation strategy. For example, an estimator $\hat{\tau}_n$ (resp. $\hat{\tau}_m$) only uses the trial data (resp. observational data) whereas $\hat{\tau}_{n,m}$ uses both data sets.
### 3.3.1 Within-trial estimators of ATE

Two classical estimators targeting $\tau_R$ from trial data are the Horvitz-Thomson and Difference-in-means estimators.

**Definition 1** (Horvitz-Thomson - Horvitz and Thompson (1952)). The Horvitz-Thomson estimator is denoted $\hat{\tau}_{HT,n}$ and defined as,

$$ \hat{\tau}_{HT,n} = \frac{1}{n} \sum_{i=1}^{n} \left( \frac{A_i Y_i}{\pi} - \frac{(1 - A_i) Y_i}{1 - \pi} \right). $$

Under a Bernoulli design (constant and independent probability to be treated $\pi$) the Horvitz-Thomson estimator $\hat{\tau}_{HT,n}$ is an unbiased and consistent estimator of $\tau_R$, and its variance satisfies, for all $n$,

$$ n \mathrm{Var}[\hat{\tau}_{HT,n}] = \mathbb{E}_R \left[ \frac{(Y^{(1)})^2}{\pi} \right] + \mathbb{E}_R \left[ \frac{(Y^{(0)})^2}{1 - \pi} \right] - \tau_R^2 := V_{HT}. \quad (4) $$

**Definition 2** (Difference-in-means - Neyman (1923) and its English translation Splawa-Neyman et al. (1990)). The Difference-in-means estimator is denoted $\hat{\tau}_{DM,n}$ and defined as

$$ \hat{\tau}_{DM,n} = \frac{1}{n_1} \sum_{A_i=1} Y_i - \frac{1}{n_0} \sum_{A_i=0} Y_i, \quad \text{where } n_a = \sum_{i=1}^{n} 1_{A_i=a}. $$

The Difference-in-means is also referred to as the simple difference estimator for e.g. in Miratrix et al. (2013) or difference in the sample means of the observed outcome variable between the treated and control groups for e.g. in Imai et al. (2008). Under a Bernoulli design, the difference-in-means estimator is a consistent estimator of $\tau_R$, and its finite sample variance is bounded by

$$ n \mathrm{Var}[\hat{\tau}_{DM,n}] \le \frac{\mathrm{Var}[Y^{(1)}]}{\pi} + \frac{\mathrm{Var}[Y^{(0)}]}{1-\pi} + \mathcal{O}(n^{-1/2}), \quad (5) $$

and its large sample variance satisfies,

$$ \lim_{n \to \infty} n \mathrm{Var}[\hat{\tau}_{DM,n}] = \frac{\mathrm{Var}[Y_i^{(1)}]}{\pi} + \frac{\mathrm{Var}[Y_i^{(0)}]}{1-\pi} := V_{DM,\infty}. \quad (6) $$

An explicit expression of the finite sample bias and variance of $\hat{\tau}_{DM,n}$ are given in appendix (see Lemma 2). What will be used later on, is the fact that the Difference-in-Means estimator can be viewed as a variant of the Horvitz-Thomson estimator, where the probability to be treated $\pi$ (or propensity score) is estimated, that is,

$$ \hat{\tau}_{DM,n} = \frac{1}{n} \sum_{i=1}^{n} \left( \frac{A_i Y_i}{\hat{\pi}} - \frac{(1 - A_i) Y_i}{1 - \hat{\pi}} \right), \quad \text{where } \hat{\pi} = \frac{\sum_{i=1}^{n} A_i}{n}. $$

Counter-intuitively, the benefit of estimating $\pi$ is to lower the variance. Even if the true probability is $\pi = 0.5$, the actual treatment allocation in the sample can be different (e.g., $\hat{\pi} = 0.48$), and using $\hat{\pi}$ rather than $\pi$ leads to a smaller large sample variance by adjusting to the exact observed probability to be treated in the trial. In particular, it is possible to be convinced of this phenomenon when comparing the two variances,

$$ V_{DM,\infty} = V_{HT} - \left( \sqrt{\frac{1-\pi}{\pi}} \mathbb{E}_R[Y^{(1)}] + \sqrt{\frac{\pi}{1-\pi}} \mathbb{E}_R[Y^{(0)}] \right)^2 \le V_{HT}. \quad (7) $$

Appendix D recalls derivations to obtain (4) to (7). Other estimators of $\tau_R$ exist, and rely on prognostic covariates (also called adjustment) such as outcome-modeling or post-stratification. Below (Section 4.2), we introduce the post-stratification estimator, corresponding to the Horvitz-Thomson estimator where $\pi$ is estimated according to different stratum.

### 3.3.2 Re-weighting estimator for generalizing the trial findings

As mentioned in Subsection 2.2, in this work we focus on the reweighting strategy, that is the Inverse Propensity of Sampling Weighting (IPSW) estimator (Cole and Stuart, 2010; Stuart et al., 2011).

**Definition 3** (Completely oracle IPSW). The completely oracle IPSW estimator is denoted $\hat{\tau}_{\pi, T, R, n}^*$, and defined as

$$ \hat{\tau}_{\pi, T, R, n}^* = \frac{1}{n} \sum_{i=1}^{n} \frac{p_T(X_i)}{p_R(X_i)} Y_i \left( \frac{A_i}{\pi} - \frac{1 - A_i}{1 - \pi} \right), \quad (8) $$

where $\frac{p_T(X_i)}{p_R(X_i)}$ are called the weights or the nuisance components.
Definition 3 corresponds to a completely oracle IPSW, where $p_T$, $p_R$, and the trial allocation probability $\pi$ are known.

### 3.3.3 Probability ratio estimation

In practice neither $p_R$ nor $p_T$ are known, and therefore one needs to estimate these probabilities. As explained in Subsection 3.1.1, we consider the case where $X$ is composed of categorial covariates only. In such a situation, a practical IPSW estimator can be built from Definition 3 by estimating each probability $p_T$ and $p_R$ by their empirical counterpart (that is counting how many observations fall in each categories in the trial and target samples).

**Definition 4 (Probability estimation).** Under the setting defined in Subsection 3.1.1,

$$ \forall x \in \mathcal{X}, \hat{p}_{T,m}(x) := \frac{1}{m} \sum_{i \in \mathcal{T}} 1_{X_i=x} \quad \text{and,} \quad \hat{p}_{R,n}(x) := \frac{1}{n} \sum_{i \in \mathcal{R}} 1_{X_i=x}. $$

Having defined a method for probability estimation, one can build practical IPSW variants.

**Definition 5 (Semi-oracle IPSW).** The semi-oracle IPSW estimator $\hat{\tau}_{\pi,T,n}^*$ is defined as

$$ \hat{\tau}_{\pi,T,n}^* = \frac{1}{n} \sum_{i=1}^{n} \frac{p_T(X_i)}{\hat{p}_{R,n}(X_i)} Y_i \left( \frac{A_i}{\pi} - \frac{1-A_i}{1-\pi} \right), \quad (9) $$

where $\hat{p}_{R,n}$ is estimated according to Definition 4.

Note that this semi-oracle estimator corresponds to the so-called standardization procedure described in Rothman and Greenland (2000).

**Definition 6 (IPSW).** The (estimated) IPSW estimator $\hat{\tau}_{\pi,n,m}$ is defined as

$$ \hat{\tau}_{\pi,n,m} = \frac{1}{n} \sum_{i=1}^{n} \frac{\hat{p}_{T,m}(X_i)}{\hat{p}_{R,n}(X_i)} Y_i \left( \frac{A_i}{\pi} - \frac{1-A_i}{1-\pi} \right), \quad (10) $$

where $\hat{p}_{R,n}$ and $\hat{p}_{T,m}$ are estimated according to Definition 4.

Definition 6 corresponds to the classical implementation of the IPSW since, practically, the probabilities $\hat{p}_{R,n}$ and $\hat{p}_{T,m}$ are not known and must be estimated.

**Another interpretation of IPSW** Note that the IPSW can be understood differently, thanks to the fact that covariates used to adjust are categorical. Indeed, it is possible to re-write the IPSW estimator from Definition 6 as,

$$ \hat{\tau}_{\pi,n,m} = \sum_{x \in \mathcal{X}} \frac{m_x}{m} \sum_{i=1}^{n} 1_{X_i=x} \frac{1}{n_x} \left( \frac{A_i Y_i^{(1)}}{\pi} - \frac{(1-A_i) Y_i^{(1)}}{1-\pi} \right) = \sum_{x \in \mathcal{X}} \frac{m_x}{m} \hat{\tau}_{HT,n_x}, $$

where $m_x = \sum_{i=n+1}^{m} 1_{X_i=x}$ and $n_x = \sum_{i=1}^{n} 1_{X_i=x}$. This corresponds to a procedure where stratum average treatment effects are estimated with an Horvitz-Thomson procedure, and then aggregated with weights corresponding to the target sample proportions. Miratrix et al. (2013) also discusses a similar approach in their section 5, but where the sample proportions corresponds to the true target population of interest. In a way, our work extends this situation to a more general case, considering the noise due to the sampling process from two populations.

**Comment about oracle and semi-oracle interest** The completely-oracle and the semi-oracle estimators are not used in practice, as usually none of the true probabilities are known. Still, they both correspond to some asymptotic situations that are of interest to understand the IPSW. For instance:

* Studying $\hat{\tau}_{\pi,T,R,n}^*$ allows us to observe the effect of averaging over the trial sample $\mathcal{R}$, without the variability due to covariates probabilities estimation ($\hat{p}_{R,n}$ and $\hat{p}_{T,m}$);

* Studying $\hat{\tau}_{\pi,T,n}^*$ allows to understand the situation where the target sample $\mathcal{T}$ is infinite ($m \to \infty$).
In addition, studying these estimators allows us to link our results with seminal works in causal inference showing that the estimated propensity score can lead to better properties than an oracle one (Robins et al., 1992; Hahn, 1998; Hirano et al., 2003). Note that we could introduce another semi-oracle estimator, where $p_R$ is known but not $p_T$. This specific estimator does not correspond to a limit situation helping to figuring out the results, as it is as if the covariates probabilities in the trial are learned on a infinite data sample, but where the treatment effect estimate is still averaged on a finite sample. Finally, since all covariates are assumed to be categorical in our framework, trial and observational densities (continuous covariates) turn into trial and observational probabilities (categorical covariates). Oracles and semi-oracles will be different when considering continuous covariates as the weights will be replaced by density estimation or estimation of the probability of being in the target population (instead of the experimental sample) (e.g. see Kern et al., 2016; Nie et al., 2021)), sometimes directly estimating the ratio by binding the two data sources and therefore making the notion of semi-oracle outdated.

# 4 Theoretical results

## 4.1 Bias and variance of IPSW variants in finite-sample regime

In this section, we expose our main theoretical results on the three variants of the IPSW estimator (Definition 3, 5 and 6). The following results rely on the variance of the Horvitz-Thomson estimator on a given strata $x$ (see Definition 1), denoted $V_{HT}(x)$, and defined as,

$$V_{HT}(x) := \mathbb{E}_{\mathbb{R}} \left[ \frac{(Y^{(1)})^2}{\pi} \mid X = x \right] + \mathbb{E}_{\mathbb{R}} \left[ \frac{(Y^{(0)})^2}{1-\pi} \mid X = x \right] - \tau(x)^2. \quad (11)$$

In this equation, we removed the index $R$ of $\tau(x)$ as $\tau_R(x) = \tau_T(x) = \tau(x)$, thanks to Assumption 3. Removing the index on the two conditional expectations would require to go beyond the classical transportability assumption, by assuming that

$$\forall a \in \{0, 1\}, P_R(Y^{(a)} | X = x) = P_T(Y^{(a)} | X = x),$$

i.e. $X$ contains all the covariates being shifted and predictive of the outcome, which is stronger than Assumption 3.

### 4.1.1 Properties of the completely oracle IPSW

The following result establishes consistency and finite sample bias and variance for the oracle IPSW, which extends the preceding results from Egami and Hartman (2021) (see their appendix, Section SM-2).

**Theorem 1 (Properties of the completely oracle IPSW).** Under the general setting defined in Subsection 3.1.1, granting Assumptions 1-4, the completely oracle IPSW is unbiased and has an explicit variance expression, that is, for all $n$,

$$\mathbb{E}[\hat{\tau}_{\pi, T, R, n}^*] = \tau, \quad \text{and} \quad \text{Var}[\hat{\tau}_{\pi, T, R, n}^*] = \frac{V_o}{n}, \quad \text{where} \quad V_o := \text{Var}_R \left[ \frac{p_T(X)}{p_R(X)} \tau(X) \right] + \mathbb{E}_R \left[ \left( \frac{p_T(X)}{p_R(X)} \right)^2 V_{HT}(X) \right].$$

As a consequence, for all $n$, the quadratic risk of the completely oracle IPSW is given by,

$$\mathbb{E}[(\hat{\tau}_{\pi, T, R, n}^* - \tau)^2] = \frac{V_o}{n},$$

which implies its $L^2$-consistency as $n$ tends to infinity, that is,

$$\hat{\tau}_{\pi, T, R, n}^* \xrightarrow{L^2} \tau.$$

The finite-sample variance $V_o$ depends on the probability ratio, the amplitude of the heterogeneity of treatment effect (through $\tau(x)$), and variances of the potential outcomes. In particular if for some category $x$, the $p_T(x)$ and $p_R(x)$ are very different implies a large variance when generalizing the trial's findings. Note that the convergence rate is a usual one in $\propto \frac{1}{n}$. Although it is not our main contribution, Theorem 1 is of primary importance for comparing the impact of sample sizes on the performances of the different IPSW variants. Appendix A.1 provides a detailed proof of Theorem 1 and sheds light on the technical tools used for more complex IPSW variants.
### 4.1.2 Properties of the semi-oracle IPSW

In this section, we study the behaviour of the semi-oracle IPSW (Definition 5), for which the probability $p_T$ is known but the probability $p_R$ is estimated. One can obtain for a certain $x$, $\hat{p}_{R,n}(x) = 0$ for some $x \in \mathcal{X}$, even if the true probability is non-negative $p_R(x) > 0$. This phenomenon, occurring when no observations in the trial correspond to the covariate vector $x$, induces a finite sample bias of the IPSW estimate. The performance of the semi-oracle IPSW estimate is thus closely related to $1_{Z_n(x)>0}$ where $Z_n(x) = \sum_{i=1}^n 1_{X_i=x}$, as stated in our next results.

**Proposition 1.** Under the general setting defined in Subsection 3.1.1, granting Assumptions 1-4, the bias of the semi-oracle IPSW satisfies, for all $n$,

$$ \mathbb{E}[\hat{\tau}_{\pi, T, n}^*] - \tau = - \sum_{x \in \mathcal{X}} p_T(x) (1 - p_R(x))^n \tau(x), \\ \text{and} \\ \left| \mathbb{E}[\hat{\tau}_{\pi, T, n}^*] - \tau \right| \le (1 - \min_x p_R(x))^n \mathbb{E}_T[|\tau(X)|]. $$

Moreover, under the same set of assumptions, the variance of the semi-oracle IPSW satisfies, for all $n$,

$$ n \mathrm{Var}[\hat{\tau}_{\pi, T, n}^*] = \sum_{x \in \mathcal{X}} p_T(x)^2 V_{HT}(x) \mathbb{E}_R \left[ \frac{1_{Z_n(x)>0}}{\hat{p}_{R,n}(x)} \right] + n \mathrm{Var}[\mathbb{E}_T[\tau(X) 1_{Z_n(X)=0} | \mathbf{X}_n]] , \\ \text{and} \\ \mathrm{Var}[\hat{\tau}_{\pi, T, n}^*] \le \frac{2V_{so}}{n+1} + \left(1 - \min_{x \in \mathcal{X}} p_R(x)\right)^n \mathbb{E}_T[\tau(X)^2], \\ \text{with} \\ V_{so} := \mathbb{E}_R \left[ \left( \frac{p_T(X)}{p_R(X)} \right)^2 V_{HT}(X) \right]. $$

The proof is detailed in Subsection A.2.1. Proposition 1 establishes the exact finite-sample bias and variance of the semi-oracle IPSW estimate. Unlike the completely oracle IPSW, the semi-oracle IPSW is biased for small trials (i.e. small $n$), which can be understood by undercoverage of some categories in the trial. Indeed, for small trials, the probability that a category is not represented at all in the RCT may not be negligible. Fortunately, as shown in Proposition 1, this bias converges to zero exponentially with the trial size $n$. Note that, as soon as $\tau(x)$ is of constant sign, the sign of the bias is known and opposite to that of $\tau(x)$. In fact, because of potentially empty categories in the trial, the expectation of the semi-oracle IPSW estimate $\mathbb{E}[\hat{\tau}_{\pi, T, n}^*]$ is pushed toward zero, if $\tau(x)$ is of constant sign. Proposition 1 also gives the exact finite-sample expression of the variance for the semi-oracle IPSW estimate. Corollary 1 provides asymptotic results derived from these finite-sample expressions:

**Corollary 1 (Asymptotics).** Under the same assumptions as in Proposition 1, the semi-oracle IPSW is asymptotically unbiased, and its asymptotic variance satisfies,

$$ \lim_{n \to \infty} \mathbb{E}[\hat{\tau}_{\pi, T, n}^*] = \tau, \quad \text{and} \quad \lim_{n \to \infty} n \mathrm{Var}[\hat{\tau}_{\pi, T, n}^*] = V_{so}. $$

The proof is detailed in Subsection A.2.2. The quantity $V_{so}$ already exist in the literature, for example in Rothman and Greenland (2000), where a form of semi-oracle IPSW was introduced under the name standardization. Here, we clarify the fact that this formula is valid only for large sample and we provide detailed derivations. Therefore, Corollary 1 is the first theoretical result establishing the asymptotic variance of the semi-oracle IPSW. One can observe from the explicit derivations that the semi-oracle estimator $\hat{\tau}_{\pi, T, n}^*$ has a lower asymptotic variance than the oracle IPSW $\hat{\tau}_{\pi, T, R, n}^*$ recalled in Theorem 1. In particular,

$$ V_{so} = V_o - \mathrm{Var}_R \left[ \frac{p_T(X)}{p_R(X)} \tau(X) \right]. $$

Always positive

This phenomenon has similar explanations<fnref n="2" /> with the common (and often surprising) result stating that an estimated propensity score lowers the variance when re-weighting observational data compared to an estimator relying on oracle propensity score (see Robins et al., 1992; Hahn, 1998; Hirano et al., 2003; Lunceford and Davidian, 2004, regarding IPW estimator). Intuitively, we only need to generalize from the actual sample to the target population, and not from a source trial population to a target population.

<footnote n="2">²In fact, similar considerations appear outside causal inference, for example Efron and Hinkley (1978) argued that the observed information rather than the expected Fisher information should be used to characterize the distribution of maximum-likelihood estimates.</footnote>
The semi oracle estimate has a lower asymptotic variance compared to the estimated IPSW but is also biased. One can thus wonder how the risk of the two estimates compare. Theorem 2 upper bounds the risk of the semi-oracle estimate:

**Theorem 2 (Properties of the semi-oracle IPSW).** Under the general setting defined in Subsection 3.1.1, granting Assumptions 1-4, the quadratic risk of the completely oracle IPSW satisfies,

$$ \mathbb{E}[(\hat{\tau}_{\pi, \tau, n}^* - \tau)^2] \le \frac{2V_{so}}{n+1} + 2(1 - \min_x p_R)^n \mathbb{E}_T[\tau(X)^2], $$

which implies its $L^2$-consistency as $n$ goes to infinity, that is,

$$ \hat{\tau}_{\pi, \tau, n}^* \xrightarrow{L^2} \tau. $$

Subsection A.2.3 details the proof. The second term in the upper bound of Theorem 2 decreases exponentially with $n$, whereas the first term decreases at rate $1/n$. At first, it is not easy to compare this upper bound to the risk of the completely oracle IPSW, due to the factor two before $V_{so}$. Close inspection of the proof of Theorem 2 reveals that the factor 2 can be replaced by $(1 + \varepsilon)$, for all $\varepsilon$, assuming that $n$ is large enough (see Lemma 3). The bound presented here is valid for all $n$ and can be improved if $n$ is taken large enough. Therefore, for all $n$ large enough, the first term in the upper bound is close to $V_{so}/(n+1)$ which is smaller than $V_o/(n+1)$ (see above), which makes the risk of the semi-oracle smaller than that of the completely oracle, for $n$ large enough. This bound opens the doors to guarantees even on small sample size. Also note that, unlike $V_o$, $V_{so}$ can be estimated with the data.

### 4.1.3 Properties of the (estimated) IPSW

Previous results on IPSW are valid when the size of the target population goes to infinity. In this subsection, we establish theoretical guarantees for the estimated IPSW in a more complex setting: we consider finite trial and target population datasets and establish bounds depending on both sample sizes ($n$ and $m$).

**Proposition 2.** Under the general setting defined in Subsection 3.1.1, granting Assumptions 1-4, the bias of the estimated IPSW is the same as that of the semi-oracle IPSW, that is, for all $n, m$,

$$ \mathbb{E}[\hat{\tau}_{\pi, n, m}] - \tau = - \sum_{x \in \mathbf{X}} p_T(x) (1 - p_R(x))^n \tau(x). $$

Moreover, under the same set of assumptions, the variance of the estimated IPSW satisfies, for all $n, m$,

$$ \mathrm{Var}[\hat{\tau}_{\pi, n, m}] = \mathrm{Var}[\hat{\tau}_{\pi, n, m}^*] + \frac{1}{m} \left( \mathrm{Var}_T[\tau(X)1_{Z_n(X) \neq 0}] - \mathrm{Var}[\mathbb{E}_T[\tau(X)1_{Z_n(X) = 0} | \mathbf{X}_n]] \right) \\ + \frac{1}{nm} \sum_{x \in \mathbf{X}} V_{HT}(x) p_T(x) (1 - p_T(x)) \mathbb{E} \left[ \frac{1_{Z_n(x) \neq 0}}{\hat{p}_{R,n}(x)} \right] $$

$$ \text{and} \quad \mathrm{Var}[\hat{\tau}_{\pi, n, m}] \le \frac{2V_{so}}{n+1} + \frac{\mathrm{Var}_T[\tau(X)]}{m} + \frac{2}{m(n+1)} \mathbb{E}_R \left[ \frac{p_T(X)(1-p_T(X))}{p_R(X)^2} V_{HT}(X) \right] \\ + \left(1 - \min_x p_R(x)\right)^{n/2} \mathbb{E}_T[\tau(X)^2] \left(1 + \frac{4}{m}\right). \qquad (12) $$

A proof is given in Subsection A.3.1. Note that the term $\mathrm{Var}_T[\tau(X)]$ can be replaced by $\mathrm{Var}[\tau(X)]$ thanks to Assumption 3. Proposition 2 is the first result to establish the bias and variance of the estimated IPSW in a finite-sample setting. A first observation is that the bias of the (estimated) IPSW is the same as that of the semi-oracle, showing that only a limited trial sample size can explain a finite sample bias. On the other side, the variance terms differ, due to the additional estimation of the target probability $p_T$ in the estimated IPSW. All additional terms compared to the variance of the semi-oracle $\hat{\tau}_{\pi, \tau, n}$ therefore depend on $m$. The explicit expression of the variance shows that $n$ and $m$ must go to infinity for the variance to go to zero.

In this setting, the variance is dominated by the first two terms in inequality 12. If $m \gg n$, the variance is dominated by the first term, which is the dominant term of the semi-oracle variance. Following this idea, Corollary 2 establishes the asymptotic bias and variance of the estimated IPSW in different sample size regimes.
**Corollary 2.** Under the same assumptions as in Proposition 2, the estimated IPSW is asymptotically unbiased when $n$ tends to infinity, that is

$$ \lim_{n \to \infty} \mathbb{E}[\hat{\tau}_{\pi,n,m}] = \tau. $$

Besides, letting $\lim_{n,m \to \infty} m/n = \lambda \in [0, \infty]$, the asymptotic variance of the estimated IPSW satisfies

$$ \lim_{n,m \to \infty} \min(n,m) \mathrm{Var}[\hat{\tau}_{\pi,n,m}] = \min(1, \lambda) \left( \frac{\mathrm{Var}[\tau(X)]}{\lambda} + V_{so} \right). $$

A proof is detailed in Subsection A.3.2.

As highlighted in Corollary 2, there is not a unique asymptotic variance for the estimated IPSW. Its asymptotic variance depends on how the sample sizes $n$ and $m$ compare to each other asymptotically. For example,

* If $m/n \to \infty$, (i.e., $\lambda = \infty$) then the asymptotic variance of the estimated IPSW corresponds to the semi-oracle's one;

* If we consider an asymptotic regime where the observational sample is about ten times bigger than the trial ($\lambda = 10$), then the asymptotic variance is equal to $\lim_{n,m \to \infty} n \mathrm{Var}[\hat{\tau}_{\pi,n,m}] = \mathrm{Var}[\tau(X)]/10 + V_{so} > V_{so}$;

* Finally, if $m/n \to 0$, (i.e., $\lambda = 0$) then the asymptotic variance of the estimated IPSW has no more link to that of the semi-oracle IPSW, and $\lim_{n,m \to \infty} m \mathrm{Var}[\hat{\tau}_{\pi,n,m}] = \mathrm{Var}[\tau(X)]$.

This formula can be used to guide data collection. For example, and using the formula, one could say that at some point gathering $N$ additional individuals information in the target population (which has a cost) could lead to less gain in precision than gathering a bit more data on the trial (if possible). This phenomenon is illustrated on Figure 6.

<figure><img src="image_8.png" /><figcaption>Figure 6: Illustration of Corollary 2</figcaption></figure>

Upper bound on the risk of the estimated IPSW can be established, based on Proposition 2.

**Theorem 3** (Properties of the IPSW). Under the general setting defined in Subsection 3.1.1, granting Assumptions 1-4, the quadratic risk of the estimated IPSW satisfies,

$$ \mathbb{E}[(\hat{\tau}_{\pi,n,m} - \tau)^2] \le \frac{2V_{so}}{n+1} + \frac{\mathrm{Var}[\tau(X)]}{m} + \frac{2}{m(n+1)} \mathbb{E}_R \left[ \frac{p_T(X)(1-p_T(X))}{p_R(X)^2} V_{HT}(X) \right] \\ + 2 \left(1 - \min_x p_R(x)\right)^n \mathbb{E}_T[\tau(X)^2] \left(1 + \frac{2}{m}\right), \quad (13) $$

which implies its $L^2$-consistency as $m, n$ tends to infinity, that is,

$$ \hat{\tau}_{\pi,n,m} \xrightarrow{L^2} \tau. $$

Proof is detailed in Subsection A.3.3. The first and fourth terms in inequality (13) correspond to the bound of the semi-oracle estimator (see Theorem 2). Following the intuition, the bound on the risk of the estimated IPSW is larger than the one of the semi-oracle. This is due to the cost of estimating $p_T$ from a finite sample of size $m$. However, when $m \gg n$, the dominant terms in the risk of the estimated and semi-oracle IPSW are the same. Indeed, consistency of the (estimated) IPSW for continuous covariates has been proven in the literature, for e.g. Buchanan et al. (2018) demonstrate consistency and asymptotic normality under a nested-design and assuming a parametric selection process. Colnet et al. (2021) demonstrate consistency assuming uniform convergence of the probability ratio under a cross-fitting procedure and no parametric assumption. Our results are the first to establish the bias and the variance of the estimated IPSW in finite and asymptotic regimes, with an explicit dependence on both sample sizes.

**What if the probability to be treated depends on $x$?** In some trials, the probability to receive treatment depends on the strata (for e.g. for ethical reason). If so, all the previous results are kept unchanged, replacing $\pi$ by $\pi(x)$, and the proofs are written with $\pi(x)$, even if the main results are reported with a constant $\pi$ for briefness. In particular, all the covariates used to stratify the propensity to receive treatment in the trial should be used in the IPSW.
## 4.2 Estimating the probability to be treated in the trial?

So far, we have considered an estimation procedure where $\pi$, the probability to be treated in the trial, is plugged in the formula. Still, one may want to estimate it for the purpose of precision. This idea follows the same spirit of what can be done with the Horvitz-Thomson (Definition 1) and the Difference-in-means (Definition 2), where the large-sample gain in variance is recalled in Equation (7). To our knowledge, different version of IPSW are currently present in the literature, with or without an estimated $\pi$ (see Table 1 in appendix for a non-exhaustive review). In our work, we propose to estimate $\pi$ per strata, and then adapt the semi-oracle IPSW (Definition 5) and the estimated IPSW (Definition 6).

**Definition 7 (Estimation of $\hat{\pi}$ for each strata).** Under the setting defined in Subsection 3.1.1,

$$ \forall x \in \mathbf{X}, \hat{\pi}_n(x) = \frac{\sum_{i \in \mathcal{R}} \mathbb{1}_{X_i=x} \mathbb{1}_{A_i=1}}{\sum_{i \in \mathcal{R}} \mathbb{1}_{X_i=x}}. $$

Strange as it may seem, estimating $\pi$ per strata and not on the whole sample can also be beneficial in RCTs to improve precision. Imbens (2011); Miratrix et al. (2013) introduce the post-stratification procedure, a technique aiming to use covariate information for precision when estimating the ATE from a single trial. These two research works detail why a so-called post-stratification estimator yields a lower variance compared to the Difference-in-Means – and therefore a Horvitz-Thomson – as soon as the covariates used for stratification are predictive of the outcome. More particularly, the post-stratification estimator on a single trial is defined as follows.

**Definition 8 (Post-stratification - Imbens (2011); Miratrix et al. (2013)).** The post-stratification estimator is denoted $\hat{\tau}_{\text{PS},n}$ and defined as,

$$ \hat{\tau}_{\text{PS},n} = \frac{1}{n} \sum_{i=1}^{n} \frac{A_i Y_i}{\hat{\pi}_n(x)} - \frac{(1 - A_i) Y_i}{1 - \hat{\pi}_n(x)}, $$

where $\pi$ is estimated according to Definition 7.

The different displays of the post-stratification estimator $\hat{\tau}_{\text{PS},n}$ in literature are recalled in Section D. The gain in efficiency of an IPSW version with estimated $\pi$ follows this intuition.

**Definition 9 (Semi-oracle IPSW with $\hat{\pi}$).** The semi-oracle IPSW estimator $\hat{\tau}_{T,n}^*$ with estimated propensity scores $\hat{\pi}_n$ is defined as

$$ \hat{\tau}_{T,n}^* = \frac{1}{n} \sum_{i=1}^{n} \frac{p_T(X_i)}{\hat{p}_{R,n}(X_i)} Y_i \left( \frac{A_i}{\hat{\pi}_n(X_i)} - \frac{1 - A_i}{1 - \hat{\pi}_n(X_i)} \right), \quad (14) $$

with $\hat{p}_{R,n}(x)$ and $\hat{\pi}_n(x)$ defined in Definitions 4 and 7.

**Definition 10 (IPSW with $\hat{\pi}$).** The completely-estimated IPSW estimator $\hat{\tau}_{n,m}$ with estimated propensity scores $\hat{\pi}_n$ is defined as

$$ \hat{\tau}_{n,m} = \frac{1}{n} \sum_{i=1}^{n} \frac{\hat{p}_{T,m}(X_i)}{\hat{p}_{R,n}(X_i)} Y_i \left( \frac{A_i}{\hat{\pi}_n(X_i)} - \frac{1 - A_i}{1 - \hat{\pi}_n(X_i)} \right), \quad (15) $$

where $\hat{p}_{T,m}(x)$, $\hat{p}_{R,n}(x)$, and $\hat{\pi}_n(x)$ defined in Definitions 4 and 7.

Before stating the formal results, and following the spirit of what was done with the variance of the Horvitz-Thomson per strata (11), we introduce $V_{\text{DM},n}(x)$:

$$ V_{\text{DM},n}(x) = n \text{Var}_{\mathbb{R}}[\hat{\tau}_{\text{DM},n} | X = x]. \quad (16) $$

The explicit variance of the Difference-in-Means under a Bernoulli design is provided in Appendix (see Lemma 2), and not displayed here for conciseness.

**Proposition 3 (IPSW's properties when also estimating $\pi$).** Under the general setting defined in Subsection 3.1.1, granting Assumptions 1-4, the bias of the estimated IPSW with estimated $\hat{\pi}_n$ (see Definition 7) is given by

$$ \mathbb{E}[\hat{\tau}_{n,m}] - \tau = \sum_{x \in \mathbf{X}} p_T(x) \mathbb{E}[Y^{(0)} | X = x] \left(1 - p_R(x)(1 - \pi(x))\right)^n \\ - \sum_{x \in \mathbf{X}} p_T(x) \mathbb{E}[Y^{(1)} | X = x] (1 - p_R(x)\pi(x))^n. $$
Besides, the variance of the estimated IPSW with estimated $\hat{\pi}_n$ satisfies, for all $n$

$$ \mathrm{Var}[\hat{\tau}_{n,m}] = \frac{1}{m} \mathrm{Var}[\tau(X) - C_n(X)] + \left(1 - \frac{1}{m}\right) \mathrm{Var}[\mathbb{E}[C_n(X)|\mathbf{X}_n]] \\ + \sum_{x \in \mathcal{X}} \left( \frac{p_T(x)(1 - p_T(x))}{m} + p_T^2(x) \right) \mathbb{E}\left[\frac{1}{Z_n(x)}\right] V_{DM,n}(x), $$

$$ \text{where} \qquad C_n(X) = \mathbb{E}[Y^{(1)} | X] (1 - \pi(X))^{Z_n(X)} - \mathbb{E}[Y^{(0)} | X] \pi(X)^{Z_n(X)}. $$

$$ \text{Furthermore,} \quad \mathrm{Var}[\hat{\tau}_{n,m}] \le \frac{2\tilde{V}_{so}}{n+1} + \frac{\mathrm{Var}[\tau(X)]}{m} + \frac{2}{(n+1)m} \mathbb{E}_R \left[ \frac{p_T(X)(1-p_T(X))}{p_R(X)^2} V_{DM}(X) \right] \\ + 2 \left(1 + \frac{3}{m}\right) \left(1 - \min_x \left((1 - \tilde{\pi}(x))^2 p_R(x)\right)\right)^{n/2} \mathbb{E}[(Y^{(1)})^2 + (Y^{(0)})^2], $$

$$ \text{where} \qquad \tilde{\pi}(x) = \max(\pi(x), 1 - \pi(x)) \quad \text{and} \quad \tilde{V}_{so} := \mathbb{E}_R \left[ \left( \frac{p_T(X)}{p_R(X)} \right)^2 V_{DM,n}(X) \right]. $$

Proof is detailed in Subsection A.4.1. Note that the bias takes a simpler form in the most usual case if $\pi(x) = 1/2$,

$$ \mathbb{E}[\hat{\tau}_{n,m}] - \tau = - \sum_{x \in \mathcal{X}} p_T(x) \tau(x) \left(1 - \frac{p_R(x)}{2}\right)^n . $$

In this case, the bias of the estimated IPSW with estimated $\hat{\pi}_n$ is larger than the one of all three previous IPSW (completely oracle, semi-oracle and estimated with oracle $\pi$), but still decreases exponentially with $n$. Another difference comes from the fact that the sign and magnitude of the bias no longer depends on the sign and magnitude of $\tau(x)$ but also of $\mathbb{E}[Y^{(0)}]$ and $\mathbb{E}[Y^{(1)}]$. The bound on the variance of $\hat{\tau}_{n,m}$ is very close to the one of $\hat{\tau}_{\pi,n,m}$, and in particular for any fixed $m$,

$$ \mathrm{Var}[\hat{\tau}_{n,m}] \le \frac{2\tilde{V}_{so}}{n+1} + \frac{\mathrm{Var}[\tau(X)]}{m} + \frac{2}{(n+1)m} \mathbb{E}_R \left[ \frac{p_T(X)(1-p_T(X))}{p_R(X)^2} V_{DM}(X) \right] + o\left(\frac{1}{n}\right), $$

where the main difference comes from $\tilde{V}_{so}$ that contains $V_{DM,n}(X)$ rather than $V_{HT}(X)$. Combining (6) and (7) allows to have

$$ n \mathrm{Var}[\hat{\tau}_{DM,n}] \le V_{HT}(x) + \mathcal{O}\left(n^{-1/2}\right), $$

which allows to conclude that for all $n$ large enough, the bound on the variance of $\hat{\tau}_{n,m}$ is tighter than the bound on the variance of $\hat{\tau}_{\pi,n,m}$. This can also be observed on the large sample variance.

**Corollary 3.** Under the same assumptions as in Proposition 3, the completely estimated IPSW is asymptotically unbiased when $n$ tends to infinity, that is

$$ \lim_{n \to \infty} \mathbb{E}[\hat{\tau}_{n,m}] = \tau. $$

Besides, letting $\lim_{n,m \to \infty} m/n = \lambda \in [0, \infty]$, the asymptotic variance of completely estimated IPSW satisfies

$$ \lim_{n,m \to \infty} \min(n,m) \mathrm{Var}[\hat{\tau}_{n,m}] = \min(1, \lambda) \left( \frac{\mathrm{Var}[\tau(X)]}{\lambda} + \tilde{V}_{so,\infty} \right), $$

$$ \text{where} \qquad \tilde{V}_{so,\infty} := \mathbb{E}_R \left[ \left( \frac{p_T(X)}{p_R(X)} \right)^2 V_{DM,\infty}(X) \right], $$

$$ \text{and} \qquad V_{DM,\infty}(x) := \frac{\mathrm{Var}_R[Y^{(1)} | X = x]}{\pi} + \frac{\mathrm{Var}_R[Y^{(0)} | X = x]}{1 - \pi}. $$

Proof is detailed in Subsection A.4.2. Because $\forall x \in \mathcal{X}$, $V_{DM,\infty}(x) \le V_{HT}(x)$, then $\tilde{V}_{so,\infty} \le V_{so}$, so that the large sample variance of the semi-oracle and completely estimated IPSW are smaller than with an oracle $\pi$, regardless of the regime at which $n$ and $m$ tend to infinity. Similarly to the result on $\hat{\tau}_{\pi,n,m}$, upper bound on the risk of the completely estimated IPSW can be established, based on Proposition 3.
**Theorem 4 (Properties of the IPSW).** Under the general setting defined in Subsection 3.1.1, granting Assumptions 1-4, the quadratic risk of the completely estimated IPSW with estimated $\hat{\pi}$ satisfies,

$$ \mathbb{E}[(\hat{\tau}_{n,m} - \tau)^2] \le \frac{2\tilde{V}_{so}}{n+1} + \frac{\mathrm{Var}[\tau(X)]}{m} + \frac{2}{m(n+1)}\mathbb{E}_R \left[ \frac{p_T(X)(1-p_T(X))}{p_R(X)^2} V_{DM}(X) \right] \\ + 2\left(2+\frac{3}{m}\right)\left(1-\min_x((1-\tilde{\pi}(x))p_R(x))\right)^{n/2} \mathbb{E}[(Y^{(1)})^2 + (Y^{(0)})^2]. \quad (17) $$

Consequently, the estimator $\hat{\tau}_{n,m}$ is $L^2$-consistent as $m, n$ tends to infinity, that is,

$$ \hat{\tau}_{n,m} \xrightarrow{L^2} \tau. $$

Proof is detailed in Subsection A.4.3. For the risk, and for the same arguments than for the bound on the variance, it can be shown that for a reasonable $n$, the bound on the risk of $\hat{\tau}_{n,m}$ is tighter than for $\hat{\tau}_{\pi,n,m}$. All the previous results establish theoretical guidance explaining why an estimator also estimating $\pi$ per strata should be preferred in practice, at least for a reasonable trial sample size $n$. To our knowledge we have not found work explicitly stating that estimating $\pi$ in the IPSW should be preferred, even if Dahabreh et al. (2020) uses a logistic regression to estimate the propensity to receive treatment in the trial.

## 4.3 Extended adjustment set: when using extra covariates

In this section, we detail the impact of adding covariates that are not necessary for adjustment – for example being only shifted or only treatment effect modifiers – on the IPSW performances. Indeed, in the literature, one of the natural approach is to adjust on all shifted covariates, also named the sampling set (Cole and Stuart, 2010; Tipton, 2013). Another adjustment set is also possible, being the heterogeneity set comprising all the treatment effect modifiers (Hartman, 2021), even if, knowing which covariate is treatment effect modifier is harder. As mentioned in the related work (Subsection 2.2), there is an important literature about optimal adjustment set for precision in the causal inference literature, but to our knowledge the topic has not been tackled yet when it comes to efficiency in generalization. Egami and Hartman (2021) discuss extensively the usage of these two sets for identification but do not study their impact on the asymptotic variance.

In this section the theoretical results hold for a specific regime, where the target sample is bigger than the trial sample, that is $m \gg n$. In other word, this situation is equivalent as considering the semi-oracle IPSW with estimated $\pi$ (Definition 9).

**Formalization** Consider that the user has at disposal an external set of baseline categorical covariates denoted $V$. We assume that Assumptions 3 and 4 are preserved when adding $V$ to the adjustment set $X$ previously considered$^3$. As mentioned above, this external covariates set can be of two different natures.

**Definition 11** ($V$ is not a treatment effect modifier). $V$ does not modulate treatment effect modifier, that is

$$ \forall v \in V, \forall s \in \{T, R\}, \quad \mathbb{P}_s(Y^{(1)} - Y^{(0)} | X = x, V = v) = \mathbb{P}_s(Y^{(1)} - Y^{(0)} | X = x). $$

**Definition 12** ($V$ is not shifted). $V$ is not shifted, that is

$$ \forall v \in V, \quad p_T(v) = p_R(v). $$

To distinguish estimator using the set $X$ or the extended set $X, V$, we denote $\hat{\tau}(X)$ and $\hat{\tau}(X, V)$ the two estimations strategies. One can show that adding only shifted covariates $V$ leads to a loss of precision, when the set $V$ is independent of the set $X$.

**Corollary 4** (Adding shifted and independent covariates). Consider the semi-oracle IPSW estimator $\hat{\tau}_{T,n}^*$ (Definition 9), and a set of additional shifted covariates $V$ (Definition 11) independent of $X$, which are not treatment effect modifiers. Then,

$$ \lim_{n \to \infty} n \mathrm{Var}_R [\hat{\tau}_{T,n}^*(X, V)] = \left( \sum_{v \in V} \frac{p_T(v)^2}{p_R(v)} \right) \lim_{n \to \infty} n \mathrm{Var}_R [\hat{\tau}_{T,n}^*(X)]. $$

<footnote>$^3$Note that if preserving transportability is pretty straightforward as $V$ is a baseline covariate too (for e.g. no collider bias), the support inclusion's assumption can be more challenging when adding too many covariates (see D'Amour et al. (2017) for a discussion).</footnote>
Proof is detailed in Subsection B.1. This results states that the asymptotic variance of the semi-oracle estimator is always bigger if an additional independent shifted covariate set V is added in the adjustment. Moreover, the stronger the shift, the bigger the variance inflation. Note that this specific rule was retrieved in the toy example, where the plain line (corresponding to Corollary 4) matches the empirical dots on Figure 4a.

On the contrary, adding an additional treatment effect modifier covariate set leads to a gain in precision.

**Corollary 5** (Adding non-shifted treatment effect modifiers). Consider the semi-oracle IPSW estimator $\hat{\tau}_{T,n}^*$ (Definition 9). Consider an additional non-shifted treatment effect modifier set (Definition 12) independent of X. Then,

$$ \lim_{n \to \infty} n \mathrm{Var}_R [\hat{\tau}_{T,n}^*(X, V)] = \lim_{n \to \infty} n \mathrm{Var}_R [\hat{\tau}_{T,n}^*(X)] - \mathbb{E}_R \left[ \frac{p_{\tau}(X)}{p_R(X)} \mathrm{Var}[\tau(X, V) | X] \right]. $$

In particular,

$$ \lim_{n \to \infty} n \mathrm{Var}_R [\hat{\tau}_{T,n}^*(X, V)] \leq \lim_{n \to \infty} n \mathrm{Var}_R [\hat{\tau}_{T,n}^*(X)]. $$

Proof is detailed in Subsection B.2. This result follows a similar spirit as Rotnitzky and Smucler (2020) due to the comparison of two asymptotic variances, even though the context and the theoretical tools are different.

# 5 Synthetic and semi-synthetic simulations

In this section, one additional analysis based on the toy example is provided to illustrate the different asymptotic regimes from Section 4. In addition, results are also illustrated on a semi-synthetic simulation aiming to mimic a medical scenario. The code to reproduce the simulations and the different figures is available on Github<fnref n="4" />.

## 5.1 Synthetic: additional experiment from the toy example

While most of the results are illustrated at the beginning of the article through the toy example, here we more thoroughly investigate empirically the different asymptotic regimes of the IPSW and its variants. In particular we complete Figure 3c that highlights the phenomenon of different asymptotic regimes, with a complete visualization of risks and variances allowing to more precisely illustrate the theoretical results, and in particular Corollary 2. More precisely, the quadratic risk is depicted in Figure 7b, while the variance via $min(n, m)$ Var $[\hat{\tau}_{n,m}]$ is displayed in Figure 7a. In both figures, different estimators (oracle or not) are considered with different regimes for m, as n grows to infinity. In particular, this simulation confirms that

(i) all IPSW variants are consistent, even though their convergence speeds depend on the regime (Figure 7b),

(ii) the completely oracle IPSW has a bigger variance than the semi-oracle IPSW (Figure 7a),

(iii) the asymptotic variance depends on the asymptotic regime (Figure 7a),

(iv) the completely estimated IPSW reaches the variance of the semi-oracle one if the target population sample is bigger than the trial (Figure 7a).

## 5.2 Semi-synthetic

In the semi-synthetic simulation, the data are taken from an application in critical care medicine, and only the outcome generative model is simulated, such that the covariate distribution and in particular the distribution shift between populations is inherited from a real situation.

### 5.2.1 Design

Two data-sets are used to generate two sources:

1. A randomized controlled trial (RCT), called CRASH-3 (Dewan et al., 2012), aiming to measure the effect of Tranexamic Acide (TXA) to prevent death from Traumatic Brain Injury (TBI). A total of 175 hospitals in 29 different countries participated to the RCT, where adults with TBI suffering from intracranial bleeding were randomly administrated TXA (CRASH-3, 2019). The inclusion criteria of the trial are patients with a Glasgow Coma Scale (GCS)<fnref n="5" /> score of 12 or lower or any intracranial bleeding on CT scan, and no major extracranial bleeding.

<footnote n="4">⁴BenedicteColnet/IPSW-categorical.</footnote>

<footnote n="5">⁵The Glasgow Coma Scale (GCS) is a neurological scale which aims to assess a person's consciousness. The lower the score, the higher the gravity of the trauma.</footnote>
<figure><img src="image_9.png" /><figcaption>**Figure 7: Risks and different asymptotic regimes:** Based on the toy example simulation (see Section 2 and data-generative process from Figure 3a) where empirical variance from either the completely oracle (Definition 3), the semi-oracle (Definition 5) or the estimated IPSW (Definition 6) are estimated repeating 6,000 times each simulation for each trial sample size (x-axis). Simulations cover different regimes of size n and m. On the y-axis the empirical variance min(n, m) Var [τ̂$_{n,m}$] is plotted (with the exception of min(n, m) = n for completely- and semi- oracle variants, represented in plain lines). Each color represents one specific estimator and regime.</figcaption></figure>

2. An observational cohort, called Traumabase, comprising 23 French Trauma centers, collects detailed clinical data from the scene of the accident to the release from the hospital. The resulting database, called the Traumabase, comprises 23,000 trauma admissions to date, and is continually updated, representing a fair, almost-exhaustive data base about actual individuals taken in charge in France and suffering from trauma.

These two data sources are turned into two source populations representing a real-world situation with six covariates so that the distribution structure and, in particular, the distributional shift mimics a real-world situation. The six covariates kept in common are: GCS (categorical), gender (categorical), pupil reactivity (categorical), age (continuous), systolic blood pressure (continuous), and time-to-treatment (TTT) (continuous). The continuous covariates are then turned into categories. Additional details about data preparation are available in Appendix (see Section C). In this semi-synthetic simulation, only the outcome model is completely synthetic, and follows

$$Y := f(\text{GCS, Gender}) + A \tau(\text{TTT, Blood Pressure}) + \epsilon_{\text{TTT}}, \quad (18)$$

where f and τ are two functions of the covariates, and $\epsilon_{TTT}$ is a gaussian noise such that $E[\epsilon_{TTT} | X] = 0$, but where heteroscedasticity is observed along the covariate TTT. The higher the time-to-treatment, the higher $Var[\epsilon_{TTT} | TTT]$, and so the noise on Y (see Section C for the detailed generated function). This outcome model is such that only time-to-treatment (TTT) and blood pressure are effect modifiers, while other covariates only affects the baseline value or have no impact. Each time a simulation is conducted observations are sampled from the two populations with replacement, and the outcome is created following equation (18). The trial is such that $\pi = 0.5$.

### 5.2.2 Results

**Minimal adjustment set is sufficient to generalize** The minimal adjustment set to generalize the trial results is constituted of the time-to-treatment(TTT) and the systolic blood pressure (blood). Using only these two covariates, the simulations illustrate how the re-weighting procedure allows to correct for the population shift between the trial and the target population as presented on Figure 8 (1,000 repetitions).

**Estimating $\pi$ lowers the variance** Simulations also illustrate the fact that estimating $\pi$ (Definition 10) compared to not estimating it (Definition 6) lowers the variance, as shown on Figure 8. This is expected from Corollary 3.

**The generalized (or re-weighted) estimate is not necessarily noisier than the trial's estimate** Note that the variance of the IPSW - with estimation of $\pi$ or not - has a similar variance as the estimates coming
<figure><img src="image_10.png" /><figcaption>**Figure 8:** IPSW estimating π or not: Simulations with n = 500, m = 10 000 where the IPSW estimator from Definitions 6 and 10 are compared to the estimates of the non-reweighted trials (Definitions 1 and 2) showing that the IPSW allow to recover the true ATE on the target population represented by the red dashed line (illustrating consistency from Theorem 3). Estimating π leads to a lower variance as expected (Corollary 3).</figcaption></figure>

from the RCT only (Horvitz-Thomson or difference-in-means). This is due to the presence of heteroscedasticity in the generative model (see equation (18)). Indeed, we would like to emphasize that re-weighting the trial does not necessarily lead to wider confidence intervals. This somehow challenges a common and intuitive idea present in the literature and stating that a re-weighted trial always has a larger variance than the trial itself (Gatsonis and Sally, 2017; Ling et al., 2022). This intuition comes from the multiplication of weights that can take large values (in particular if, for some x, $p_R(x) \ll p_T(x)$), making this idea valid as soon as the outcome noise is homoscedastic. However, the asymptotic variance of the semi-oracle IPSW from Corollary 1 highlights that this intuitive and reasonable idea is not necessarily true, as soon as there is heteroscedascity, which occurs if some categories for which potential outcomes have higher uncertainty (larger noise) are more represented in the trial than in the target population:

$$V_{so} = \sum_{x \in \mathcal{X}} \left( \frac{p_T^2(x)}{p_R(x)} \left( \frac{\mathrm{Var}[Y^{(1)}|X=x]}{\pi} + \frac{\mathrm{Var}[Y^{(0)}|X=x]}{1-\pi} \right) \right) \quad \text{Can be small for some } x \text{ with high weights} \quad \frac{p_T^2(x)}{p_R(x)}$$

In particular in this simulation, having a variance of the IPSW estimate smaller than that of the treatment effect estimator on the trial is possible because individuals treated earlier have less uncertainty in the response than individuals with high TTT (encoded in $\epsilon_{TTT}$), and the simulation is made such that in the target population such individuals are more present than in the trial.

**Shifted and not treatment effect modifier covariate increases variance: the example of Glasgow score (GCS)** It is possible to illustrate the results from Section 4.3 with the semi-synthetic simulation. For example, the Glasgow score (GCS) can be added to the minimal adjustment set previously used (see Figure 8), and leads to a loss of precision as this covariate is relatively strongly shifted between the two data sets and is not a treatment effect modifier (even if in the simulation this covariate has an impact on the outcome). The increase in variance can be observed on Figure 9, where the green boxplot on the left represents such situation.

<figure><img src="image_11.png" /><figcaption>**Figure 9:** Effect of non-necessary covariates on the variance: IPSW (Definition 10) with n = 3 000 and m = 10 000 showing that the addition of the covariate GCS (shifted covariate not being a treatment effect modifier) increases the variance of the IPSW, while the addition of a non-shifted treatment effect modifier (here simulated as no covariates from the actual data base where not shited) leads to an improvement in variance, compared to the minimal set. Simulations are repeated 1,000 times.</figcaption></figure>

**While a non-shifted but treatment effect modifier lowers the variance** To illustrate a gain in precision due to the addition of a non-shifted treatment effect modifier, it was not possible to use the *natural* covariates
from the two original data sets as a distributional shift was always present in all covariates. To model such a situation, we added a categorical covariate X_sup (5 levels), independent with all other covariates and without shift, in the data generative model to represent such a situation:

$$Y := f(\text{GCS, Gender}) + A \tau(\text{TTT, Blood Pressure, X\_sup}) + \epsilon_{\text{TTT}}. \quad (19)$$

Doing so, it is possible to illustrate that adding X_sup in the adjustment set allows to lower the variance, and Figure 9 presents such situation with the purple boxplot on the right.

# 6 Conclusion and future work

In this work, we establish finite-sample and asymptotic results on different versions of the so-called *Inverse Propensity Sampling Weights* estimator, when the adjustment set is constituted of categorical covariates. We give the explicit expressions of the biases and variances for all estimates, together with their quadratic risk. Our detailed analysis allows us to compare this different estimate in different finite-sample regimes. Indeed, to the best of our knowledge, our work is the first to study the impact of finite trial and observational data sets on IPSW performance in the context of generalization, by providing rate of convergence for several IPSW estimates. By doing so, we link these results with previous results in epidemiology where one data source was considered infinite, and also explain how certain observations can be seen through the eyes of seminal work in causal inference (efficient estimation with IPW).

**Which covariate to include?** This work also reveals that care should be taken when selecting the covariates to generalize. From applied literature, we have noticed that practitioners usually select almost all available covariates to build the weights, which is encouraged by the fear of missing an important shifted treatment effect modifier. We show that inclusion of many covariates comes with the risk of adjusting on shifted covariates that are not treatment effect modifiers, which can drastically damage the precision. On the contrary, even though adding some non-shifted covariates may sound counterintuitive, we show that such practice improves asymptotic precision, as soon as the non-shifted additional covariate set modulates treatment effect. Still, adding too many covariates endangers overlap and therefore can lead to finite sample bias. In light of these theoretical results, we believe that physicians and epidemiologists have an important role to play in selecting a limited number of covariates when generalizing trial's findings.

**Future work** Studying only categorical covariates is probably the main restriction of this work, as data can be hybrid and composed of continuous and categorical information. However, even when facing a hybrid set of covariates - continuous and categorical - the user can still create bins for continuous covariates. Even if such data-processing is not necessarily recommended, for a limited number of covariates this should allow to extend the analysis. Indeed, binning covariate leads to within-stratum confounding, that is a residual confounding due to rough bins, and therefore to an asymptotic bias due to factors that are poorly controlled on. To avoid within-stratum residual confounding, it is desirable to create more bins and split the data into more strata, but stratifying too finely with a finite sample may lead to (i) a variance inflation and (ii) the support inclusion assumption's invalidity. Indeed, the performances of the IPSW in a high-dimensional setting can be limited. For example, if all input variables are binary, the finite-sample bias and variance can be rewritten as a function of $n/2^d$ (where d is the number of input variables) and can thus spin out of control if the sample sizes are too small compared to the dimension of the problem. Future work should investigate how our conclusion on the different asymptotic regimes and the covariates selection's impact on variance can be extended to settings with mixed-type covariates (for e.g. a smoother version of IPSW with density ratio estimation).

In practice, the limitation due to categorical covariates is balanced by the fact that within the medical field, clinical indicators and covariates are often scores and categories. For example, Berkowitz et al. (2018) apply the IPSW to generalize the effect of blood pressure control relying on many categorical covariates such as health insurance status (insured, uninsured), tobacco smoking status (never, current, former), and so on. When facing continuous covariates in practice, and having in mind the current theoretical understanding of the different generalization estimators, this IPSW version has interests. A solution would be found at the crossroads between identification bias (due to imprecise bins) and variance inflation or finite sample bias (due to numerous bins). Quantifying such a tradeoff in specific settings would definitely help the practitioners by providing clear guidelines.

# Acknowledgment

Part of this work was done while Bénédicte Colnet was visiting the Simons Institute for the Theory of Computing. Also, part of this work was done during a visiting scholar period in the Stanford's Statistics Department.
Therefore, we would like to thank the department for their welcoming and all the helpful and inspiring discussions, in particular with Prof. Trevor HASTIE.

# Funding and conflict of interest

Authors are all funded by their respective employer (INRIA or École polytechnique) and have declared no conflict of interest.

# References

Arnould, L., C. Boyer, and E. Scornet (2021, 18–24 Jul). Analyzing the tree-layer structure of deep forests. In M. Meila and T. Zhang (Eds.), *Proceedings of the 38th International Conference on Machine Learning*, Volume 139 of *Proceedings of Machine Learning Research*, pp. 342–350. PMLR.

Athey, S., R. Chetty, and G. Imbens (2020). Combining experimental and observational data to estimate treatment effects on long term outcomes. *arXiv preprint arXiv:2006.09676*.

Bareinboim, E. and J. Pearl (2012a). Controlling selection bias in causal inference. In N. D. Lawrence and M. Girolami (Eds.), *Proceedings of the Fifteenth International Conference on Artificial Intelligence and Statistics*, Volume 22 of *Proceedings of Machine Learning Research*, La Palma, Canary Islands, pp. 100–108. PMLR.

Bareinboim, E. and J. Pearl (2012b). Transportability of causal effects: Completeness results. In *Proceedings of the Twenty-Sixth AAAI Conference on Artificial Intelligence*, AAAI’12, pp. 698–704. AAAI Press.

Berkowitz, S. A., J. B. Sussman, D. E. Jonas, and S. Basu (2018). Generalizing intensive blood pressure treatment to adults with diabetes mellitus. *Journal of the American College of Cardiology* 72(11), 1214–1223. SPECIAL FOCUS ISSUE: BLOOD PRESSURE.

Biau, G. (2012). Analysis of a random forests model. *Journal of Machine Learning Research* 13(38), 1063–1095.

Brookhart, M. A., S. Schneeweiss, K. J. Rothman, R. J. Glynn, J. Avorn, and T. Stürmer (2006). Variable selection for propensity score models. *American journal of epidemiology* 163(12), 1149–1156.

Buchanan, A. L., M. G. Hudgens, S. R. Cole, K. R. Mollan, P. E. Sax, E. S. Daar, A. A. Adimora, J. J. Eron, and M. J. Mugavero (2018). Generalizing evidence from randomized trials using inverse probability of sampling weights. *Journal of the Royal Statistical Society: Series A (Statistics in Society)* 181, 1193–1209.

Chattopadhyay, A., E. R. Cohn, and J. R. Zubizarreta (2022). One-step weighting to generalize and transport treatment effect estimates to a target population.

Cinelli, C., A. Forney, and J. Pearl (2022). A crash course in good and bad controls. *Sociological Methods & Research*.

Cole, S. R. and E. A. Stuart (2010). Generalizing evidence from randomized clinical trials to target populations: The actg 320 trial. *American Journal of Epidemiology* 172, 107–115.

Colnet, B., J. Josse, E. Scornet, and G. Varoquaux (2021). Causal effect on a target population: a sensitivity analysis to handle missing covariates. *Accepted in Journal of Causal Inference*.

Colnet, B., I. Mayer, G. Chen, A. Dieng, R. Li, G. Varoquaux, J.-P. Vert, J. Josse, and S. Yang (2020). Causal inference methods for combining randomized trials and observational studies: a review.

CRASH-3 (2019). Effects of tranexamic acid on death, disability, vascular occlusive events and other morbidities in patients with acute traumatic brain injury (CRASH-3): a randomised, placebo-controlled trial. *The Lancet* 394(10210), 1713–1723.

Dahabreh, I. J., S. E. Robertson, J. A. Steingrimsson, E. A. Stuart, and M. A. Hernán (2020). Extending inferences from a randomized trial to a new target population. *Statistics in Medicine* 39(14), 1999–2014.

Dahabreh, I. J., J. M. Robins, S. J. Haneuse, and M. A. Hernán (2019). Generalizing causal inferences from randomized trials: counterfactual and graphical identification. *arXiv preprint arXiv:1906.10792*.

D'Amour, A., P. Ding, A. Feller, L. Lei, and J. Sekhon (2017, 11). Overlap in observational studies with high-dimensional covariates. *Journal of Econometrics* 221.
Deaton, A. and N. Cartwright (2018). Understanding and misunderstanding randomized controlled trials. *Social Science & Medicine* **210**, 2–21. Randomized Controlled Trials and Evidence-based Policy: A Multidisciplinary Dialogue.

Degtiar, I. and S. Rose (2022). A review of generalizability and transportability. *Annual Review of Statistics and Its Application*.

Dewan, Y., E. Komolafe, J. Mejia-Mantilla, P. Perel, I. Roberts, and H. Shakur-Still (2012, 06). CRASH-3: Tranexamic acid for the treatment of significant traumatic brain injury: study protocol for an international randomized, double-blind, placebo-controlled trial. *Trials* **13**, 87.

Efron, B. and D. V. Hinkley (1978). Assessing the accuracy of the maximum likelihood estimator: Observed versus expected fisher information. *Biometrika* **65**(3), 457–482.

Egami, N. and E. Hartman (2021, 08). Covariate selection for generalizing experimental results: Application to a large-scale development program in uganda*. *Journal of the Royal Statistical Society: Series A (Statistics in Society)* **184**.

Gatsonis, C. and M. C. Sally (2017). *Methods in Comparative Effectiveness Research*, pp. 177–199. Chapman & Hall.

Hahn, J. (1998). On the role of the propensity score in efficient semiparametric estimation of average treatment effects. *Econometrica* **66**(2), 315–332.

Hahn, J. (2004, 02). Functional restriction and efficiency in causal inference. *The Review of Economics and Statistics* **86**, 73–76.

Harshaw, C., J. A. Middleton, and F. Sävje (2021). Optimized variance estimation under interference and complex experimental designs.

Hartman, E. (2021). *Generalizing Experimental Results*, pp. 385–410. Cambridge University Press.

Hartman, E., R. Grieve, R. Ramsahai, and J. S. Sekhon (2015). From sample average treatment effect to population average treatment effect on the treated: combining experimental with observational studies to estimate population treatment effects. *Journal of the Royal Statistical Society: Series A (Statistics in Society)* **178**(3), 757–778.

Henckel, L., E. Perković, and M. H. Maathuis (2022, April). Graphical criteria for efficient total effect estimation via adjustment in causal linear models. *Journal of the Royal Statistical Society Series B* **84**(2), 579–599.

Hernan, MA Robins, J. (2020). *Causal Inference: What If*. Boca Raton: Chapman & Hall/CRC.

Hirano, K., G. Imbens, and G. Ridder (2003, 02). Efficient estimation of average treatment effects using the estimated propensity score. *Econometrica* **71**, 1161–1189.

Horvitz, D. G. and D. J. Thompson (1952). A generalization of sampling without replacement from a finite universe. *Journal of the American Statistical Association* **47**(260), 663–685.

Huang, M. (2022). Sensitivity analysis in the generalization of experimental results.

Huitfeldt, A., S. Swanson, M. Stensrud, and E. Suzuki (2019, 12). Effect heterogeneity and variable selection for standardizing causal effects to a target population. *European Journal of Epidemiology* **34**.

Imai, K., G. King, and E. A. Stuart (2008). Misunderstandings between experimentalists and observationalists about causal inference. *Journal of the Royal Statistical Society: Series A (Statistics in Society)* **171**(2), 481–502.

Imbens, G. W. (2011). Experimental design for unit and cluster randomised trials. *International Initiative for Impact Evaluation Paper*.

Imbens, G. W. and D. B. Rubin (2015). *Causal Inference in Statistics, Social, and Biomedical Sciences*. Cambridge UK: Cambridge University Press.

Josey, K. P., S. A. Berkowitz, D. Ghosh, and S. Raghavan (2021). Transporting experimental results with entropy balancing. *Statistics in Medicine* **40**(19), 4310–4326.

Kallus, N., A. M. Puli, and U. Shalit (2018). Removing hidden confounding by experimental grounding. In *Advances in neural information processing systems*, pp. 10888–10897.
Kern, H. L., E. A. Stuart, J. Hill, and D. P. Green (2016). Assessing methods for generalizing experimental impact estimates to target populations. *Journal of research on educational effectiveness* 9(1), 103–127.

Lee, D., S. Yang, L. Dong, X. Wang, D. Zeng, and J. Cai (2021, 12). Improving trial generalizability using observational studies. *Biometrics*.

Lefebvre, G., J. Delaney, and R. Platt (2008, 08). Impact of mis-specification of the treatment model on estimates from a marginal structural model. *Statistics in medicine* 27, 3629–42.

Ling, A. Y., M. E. Montez-Rath, P. Carita, K. Chandross, L. Lucats, Z. Meng, B. Sebastien, K. Kapphahn, and M. Desai (2022). A critical review of methods for real-world applications to generalize or transport clinical trial findings to target populations of interest.

Liu, R., S. Rizzo, S. Whipple, N. Pal, A. Lopez Pineda, M. Lu, B. Arnieri, Y. Lu, W. Capra, R. Copping, and J. Zou (2021, 04). Evaluating eligibility criteria of oncology trials using real-world data and ai. *Nature* 592.

Lunceford, J. K. and M. Davidian (2004). Stratification and weighting via the propensity score in estimation of causal treatment effects: A comparative study. In *Statistics in Medicine*, pp. 2937–2960.

Miratrix, L. W., J. S. Sekhon, and B. Yu (2013). Adjusting treatment effect estimates by post-stratification in randomized experiments. *Journal of the Royal Statistical Society Series B* 75, 369–396.

Nie, X., G. Imbens, and S. Wager (2021). Covariate balancing sensitivity analysis for extrapolating randomized trials across locations.

O'Muircheartaigh, C. and L. Hedges (2013, 11). Generalizing from unrepresentative experiments: A stratified propensity score approach. *Journal of the Royal Statistical Society: Series C (Applied Statistics)* 63.

Pearl, J. (2015). Generalizing experimental findings. *Journal of Causal Inference* 3(2), 259–266.

Pearl, J. and E. Bareinboim (2011). Transportability of causal and statistical relations: A formal approach. In *Proceedings of the Twenty-Fifth AAAI Conference on Artificial Intelligence*, AAAI’11, pp. 247–254. AAAI Press.

Robins, J. M., S. D. Mark, and W. Newey (1992). Estimating exposure effects by modelling the expectation of exposure conditional on confounders. *Biometrics* 48 2, 479–95.

Rosenbaum, P. R. and D. B. Rubin (1983). The central role of the propensity score in observational studies for causal effects. *Biometrika* 70(1), 41–55.

Rothman, K. J. (2011). *Epidemiology: an introduction* (2 ed.). Oxford University Press.

Rothman, K. J. and S. Greenland (2000). *Modern Epidemiology* (2 ed.). Lippincott Williams and Wilkins.

Rothwell, P. (2007, 01). External validity of randomised controlled trials: “to whom do the results of this trial apply?”. *Lancet* 365, 82–93.

Rotnitzky, A. and E. Smucler (2020). Efficient adjustment sets for population average causal treatment effect estimation in graphical models. *Journal of Machine Learning Research* 21(188), 1–86.

Schnitzer, M., J. Lok, and S. Gruber (2015, 07). Variable selection for confounder control, flexible modeling and collaborative targeted minimum loss-based estimation in causal inference. *The international journal of biostatistics* 12.

Splawa-Neyman, J., D. M. Dabrowska, and T. P. Speed (1990). On the Application of Probability Theory to Agricultural Experiments. Essay on Principles. Section 9. *Statistical Science* 5(4), 465 – 472.

Stefanski, L. A. and D. D. Boos (2002). The calculus of m-estimation. *The American Statistician* 56(1), 29–38.

Stuart, E. A., S. R. Cole, C. P. Bradshaw, and P. J. Leaf (2011). The use of propensity scores to assess the generalizability of results from randomized trials. *Journal of the Royal Statistical Society: Series A (Statistics in Society)* 174, 369–386.

Stuart, E. A. and A. Rhodes (2017). Generalizing treatment effect estimates from sample to population: A case study in the difficulties of finding sufficient data. *Evaluation Review* 41(4), 357–388. PMID: 27491758.

Tipton, E. (2013). Improving generalizations from experiments using propensity score subclassification: Assumptions, properties, and contexts. *Journal of Educational and Behavioral Statistics* 38, 239–266.
Tipton, E., K. Hallberg, L. Hedges, and W. Chan (2016, 07). Implications of small samples for generalization: Adjustments and rules of thumb. *Evaluation Review* 41.

Velentgas, P., N. A. Dreyer, P. Nourjah, S. R. Smith, and M. Torchia (2013). Developing a protocol for observational comparative effectiveness research: A user's guide.

Westreich, D., J. Edwards, C. Lesko, E. Stuart, and S. Cole (2017, 05). Transportability of trial results using inverse odds of sampling weights. *American journal of epidemiology* 186.

Witte, J. and V. Didelez (2018, 10). Covariate selection strategies for causal inference: Classification and comparison. *Biometrical Journal* 61.

Wooldridge, J. (2016). Should instrumental variables be used as matching variables? *Research in Economics* 70(2), 232–237.

Yang, S., J. K. Kim, and R. Song (2020). Doubly robust inference when combining probability and non-probability samples with high dimensional data. *Journal of the Royal Statistical Society: Series B (Statistical Methodology)* 82.
# APPENDIX

## A Main proofs

### A.1 Proof of Theorem 1 - Completely oracle estimator $\hat{\tau}_{\pi, T, R, n}^*$

We first recall the expression of the completely oracle estimator introduced in Definition 3,

$$ \hat{\tau}_{\pi, T, R, n}^* = \frac{1}{n} \sum_{i=1}^{n} \frac{p_T(X_i)}{p_R(X_i)} \left( \frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi} \right). $$

This estimator can be rewritten as,

$$ \hat{\tau}_{\pi, T, R, n}^* = \sum_{x \in \mathcal{X}} \frac{p_T(x)}{p_R(x)} \left( \frac{1}{n} \sum_{i=1}^{n} 1_{X_i=x} \left( \frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi} \right) \right), $$

since $X_i$ take values in a categorical set $\mathcal{X}$. This rewriting is extensively used in the proof.

### Bias

Recall that, for all $x \in \mathcal{X}$, $p_R(x)$ and $p_T(x)$ are not random variables. We have

$$
\begin{align*}
\mathbb{E}[\hat{\tau}_{\pi, T, R, n}^*] &= \mathbb{E}\left[\sum_{x \in \mathcal{X}} \frac{p_T(x)}{p_R(x)} \frac{1}{n} \sum_{i=1}^{n} 1_{X_i=x} \left(\frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi}\right)\right] && \text{By definition} \\
&= \sum_{x \in \mathcal{X}} \mathbb{E}\left[\frac{p_T(x)}{p_R(x)} \frac{1}{n} \sum_{i=1}^{n} 1_{X_i=x} \left(\frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi}\right)\right] && \text{Linearity of } \mathbb{E}[\cdot] \\
&= \sum_{x \in \mathcal{X}} \frac{p_T(x)}{p_R(x)} \mathbb{E}\left[\frac{1}{n} \sum_{i=1}^{n} 1_{X_i=x} \left(\frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi}\right)\right] && \text{$p_R(x)$ and $p_T(x)$ are not random} \\
&= \sum_{x \in \mathcal{X}} \frac{p_T(x)}{p_R(x)} \mathbb{E}_R\left[1_{X_i=x} \left(\frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi}\right)\right] && \text{Linearity & iid trial} \\
&= \sum_{x \in \mathcal{X}} \frac{p_T(x)}{p_R(x)} \mathbb{E}_R\left[1_{X_i=x} \left(\frac{Y_i^{(1)} A_i}{\pi} - \frac{Y_i^{(0)}(1-A_i)}{1-\pi}\right)\right] && \text{SUTVA (see Assumption 2).}
\end{align*}
$$

Noting that,

$$ p_R(x) = \mathbb{P}_R[X = x] = \mathbb{P}_R[X_i = x] = \mathbb{E}_R[1_{X_i=x}], $$

one can condition on the random variable $X_i$, yielding

$$ \mathbb{E}_R\left[1_{X_i=x}\left(\frac{Y_i^{(1)} A_i}{\pi} - \frac{Y_i^{(0)}(1-A_i)}{1-\pi}\right)\right] = \mathbb{E}_R\left[\frac{Y_i^{(1)} A_i}{\pi} - \frac{Y_i^{(0)}(1-A_i)}{1-\pi} \mid X_i=x\right] \underbrace{\mathbb{E}_R[1_{X_i=x}]}_{=p_R(x)}. $$
Then,

$$
\begin{align*}
\mathbb{E}[\hat{\tau}_{\pi, T, R, n}^*] &= \sum_{x \in \mathcal{X}} p_T(x) \mathbb{E}_R \left[ \frac{Y_i^{(1)} A_i}{\pi} - \frac{Y_i^{(0)} (1 - A_i)}{1 - \pi} \mid X_i = x \right] && \text{From previous derivations} \\
&= \sum_{x \in \mathcal{X}} p_T(x) \left( \frac{\mathbb{E}_R [Y_i^{(1)} A_i \mid X_i = x]}{\pi} - \frac{\mathbb{E}_R [Y_i^{(0)} (1 - A_i) \mid X_i = x]}{1 - \pi} \right) && \text{Linearity of } \mathbb{E}[\cdot] \text{ and } \pi \text{ is constant} \\
&= \sum_{x \in \mathcal{X}} p_T(x) \left( \frac{\mathbb{E}_R [Y_i^{(1)} \mid X_i = x] \mathbb{E}_R [A_i \mid X_i = x]}{\pi} - \frac{\mathbb{E}_R [Y_i^{(0)} \mid X_i = x] \mathbb{E}_R [(1 - A_i) \mid X_i = x]}{1 - \pi} \right) && \text{Randomization (see Assumption 2)} \\
&= \sum_{x \in \mathcal{X}} p_T(x) \left( \mathbb{E}_R [Y_i^{(1)} \mid X_i = x] - \mathbb{E}_R [Y_i^{(0)} \mid X_i = x] \right) && \mathbb{E}_R [A_i \mid X_i = x] = \pi \\
&= \sum_{x \in \mathcal{X}} p_T(x) \mathbb{E}_R [Y_i^{(1)} - Y_i^{(0)} \mid X_i = x] && \text{Linearity of } \mathbb{E}[\cdot] \\
&= \sum_{x \in \mathcal{X}} p_T(x) \mathbb{E}_T [Y_i^{(1)} - Y_i^{(0)} \mid X_i = x] && \text{Transportability (see Assumption 3)} \\
&= \tau, && \text{Law of total probability}
\end{align*}
$$

which concludes the first part of the proof.

Note that the previous derivations, relying on iid, Assumption 2 (Trial internal validity with SUTVA, definition of π, and randomization), Assumption 3, and the law of total probability, lead to the following intermediary result,

$$
\mathbb{E}_{\mathbb{R}} \left[ \frac{Y_i^{(1)} A_i}{\pi} - \frac{Y_i^{(0)} (1 - A_i)}{1 - \pi} \mid X_i = x \right] = \mathbb{E}_{\mathbb{T}} \left[ Y_i^{(1)} - Y_i^{(0)} \mid X_i = x \right] = \tau(x). \quad (20)
$$

(20) will be used in other proofs.

Variance

To shorten notation, we denote by $\mathbf{X}_n \in \mathcal{X}^n$ the vector composed of the $n$ observations in the trial. We then
use the law of total variance, conditioning on $\mathbf{X}_n$,

$$
\mathrm{Var}[\hat{\tau}_{\pi, T, R, n}^*] = \mathrm{Var}[\mathbb{E}[\hat{\tau}_{\pi, T, R, n}^* | \mathbf{X}_n]] + \mathbb{E}[\mathrm{Var}[\hat{\tau}_{\pi, T, R, n}^* | \mathbf{X}_n]]. \quad (21)
$$

Considering the first term in the right-hand side of (21),

$$
\begin{align*}
\mathbb{E}[\hat{\tau}_{\pi, T, R, n}^* | \mathbf{X}_n] &= \mathbb{E} \left[ \sum_{x \in \mathcal{X}} \frac{p_T(x)}{p_R(x)} \frac{1}{n} \sum_{i=1}^{n} \mathbb{1}_{X_i=x} \left( \frac{Y_i^{(1)} A_i}{\pi} - \frac{Y_i^{(0)} (1-A_i)}{1-\pi} \right) | \mathbf{X}_n \right] && \text{By definition (and SUTVA)} \\
&= \sum_{x \in \mathcal{X}} \frac{p_T(x)}{p_R(x)} \frac{1}{n} \mathbb{E} \left[ \sum_{i=1}^{n} \mathbb{1}_{X_i=x} \left( \frac{Y_i^{(1)} A_i}{\pi} - \frac{Y_i^{(0)} (1-A_i)}{1-\pi} \right) | \mathbf{X}_n \right]. && \text{Linearity of } \mathbb{E}[\cdot]
\end{align*}
$$

Note that this last derivation also uses the fact that neither $p_T(x)$ nor $p_R(x)$ are random variables.

$$
\begin{align*}
\mathbb{E}[\hat{\tau}_{\pi, T, R, n}^* | \mathbf{X}_n] &= \sum_{x \in \mathcal{X}} \frac{p_T(x)}{p_R(x)} \sum_{i=1}^{n} \frac{1}{n} \mathbb{1}_{X_i=x} \mathbb{E} \left[ \frac{Y_i^{(1)} A_i}{\pi} - \frac{Y_i^{(0)} (1-A_i)}{1-\pi} \mid X_i \right] && \text{iid individuals} \\
&= \sum_{x \in \mathcal{X}} \frac{p_T(x)}{p_R(x)} \sum_{i=1}^{n} \frac{1}{n} \mathbb{1}_{X_i=x} \tau(X_i) \\
&= \frac{1}{n} \sum_{x \in \mathcal{X}} \frac{p_T(x)}{p_R(x)} \tau(x) \sum_{i=1}^{n} \mathbb{1}_{X_i=x} && \text{Transportability (see Assumption 3)}
\end{align*}
$$
Now, this last term can be written as a unique sum on $i \in \{1, \dots, n\}$, that is,

$$ \frac{1}{n} \sum_{x \in \mathcal{X}} \frac{p_T(x)}{p_R(x)} \tau(x) \sum_{i=1}^{n} \mathbb{1}_{X_i=x} = \frac{1}{n} \sum_{i=1}^{n} \frac{p_T(X_i)}{p_R(X_i)} \tau(X_i). $$

Taking the variance of this term leads to,

$$ \begin{aligned} \mathrm{Var} \left[ \mathbb{E}_R \left[ \hat{\tau}_{\pi, T, R, n}^* | \mathbf{X}_n \right] \right] &= \mathrm{Var} \left[ \frac{1}{n} \sum_{i=1}^{n} \frac{p_T(X_i)}{p_R(X_i)} \tau(X_i) \right] \\ &= \frac{1}{n} \mathrm{Var}_R \left[ \frac{p_T(X)}{p_R(X)} \tau(X) \right]. \quad \text{iid observations on trial (Assumption 2)} \quad (22) \end{aligned} $$

Regarding the second term,

$$ \begin{aligned} \mathrm{Var} \left[ \hat{\tau}_{\pi, T, R, n}^* | \mathbf{X}_n \right] &= \mathrm{Var}_R \left[ \frac{1}{n} \sum_{i=1}^{n} \frac{p_T(X_i)}{p_R(X_i)} \left( \frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi} \right) | \mathbf{X}_n \right] \\ &= \frac{1}{n^2} \sum_{i=1}^{n} \left( \frac{p_T(X_i)}{p_R(X_i)} \right)^2 \mathrm{Var}_R \left[ \left( \frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi} \right) | \mathbf{X}_n \right] \\ &= \frac{1}{n^2} \sum_{i=1}^{n} \left( \frac{p_T(X_i)}{p_R(X_i)} \right)^2 \mathrm{Var}_R \left[ \left( \frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi} \right) | \mathbf{X}_i \right]. \end{aligned} \quad (23) $$

Recall that the variance of the Horvitz-Thomson estimator (see Definition 1) conditioned on $X_i$ is given by

$$ \mathrm{Var}_R \left[ \hat{\tau}_{HT, n} | X_i \right] = \frac{1}{n} \mathrm{Var}_R \left[ \left( \frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi} \right) | X_i \right]. \quad (24) $$

Then, one can use Lemma ?? (see Section D) to have

$$ n \mathrm{Var} \left[ \hat{\tau}_{HT, n} | X_i \right] = \mathbb{E}_R \left[ \frac{(Y^{(1)})^2}{\pi} | X_i \right] + \mathbb{E}_R \left[ \frac{(Y^{(0)})^2}{1-\pi} | X_i \right] - \tau(X_i)^2 := V_{HT}(X_i). \quad (25) $$

Then, coming back to (23),

$$ \begin{aligned} \mathbb{E}_R \left[ \mathrm{Var} \left[ \hat{\tau}_{\pi, T, R, n}^* | \mathbf{X}_n \right] \right] &= \mathbb{E}_R \left[ \frac{1}{n^2} \sum_{i=1}^{n} \left( \frac{p_T(X_i)}{p_R(X_i)} \right)^2 V_{HT}(X_i) \right] \\ &= \mathbb{E}_R \left[ \frac{1}{n^2} \sum_{i=1}^{n} \left( \sum_{x \in \mathcal{X}} \mathbb{1}_{X_i=x} \right) \left( \frac{p_T(X_i)}{p_R(X_i)} \right)^2 V_{HT}(X_i) \right] \\ &= \mathbb{E}_R \left[ \sum_{x \in \mathcal{X}} \frac{1}{n^2} \left( \frac{p_T(x)}{p_R(x)} \right)^2 V_{HT}(x) \mathbb{E}_R \left[ \sum_{i=1}^{n} \mathbb{1}_{X_i=x} \right] \right] \\ &= \sum_{x \in \mathcal{X}} \frac{1}{n^2} \left( \frac{p_T(x)}{p_R(x)} \right)^2 V_{HT}(x) \mathbb{E}_R \left[ \frac{1}{n} \sum_{i=1}^{n} \mathbb{1}_{X_i=x} \right] \\ &= \sum_{x \in \mathcal{X}} \frac{1}{n} \left( \frac{p_T(x)}{p_R(x)} \right)^2 V_{HT}(x) p_R(x) \quad \text{Assumption 1} \\ &= \sum_{x \in \mathcal{X}} \frac{1}{n} \frac{p_T^2(x)}{p_R(x)} V_{HT}(x) \\ &= \frac{1}{n} \sum_{x \in \mathcal{X}} \frac{p_T^2(x)}{p_R(x)} \left( \mathbb{E}_R \left[ \frac{(Y^{(1)})^2}{\pi} | X=x \right] + \mathbb{E}_R \left[ \frac{(Y^{(0)})^2}{1-\pi} | X=x \right] - \tau(x)^2 \right), \quad (26) \\ &= \frac{1}{n} \sum_{x \in \mathcal{X}} \frac{p_T^2(x)}{p_R(x)} \left( \mathbb{E}_R \left[ \frac{(Y^{(1)})^2}{\pi} | X=x \right] + \mathbb{E}_R \left[ \frac{(Y^{(0)})^2}{1-\pi} | X=x \right] - \tau(x)^2 \right), \quad (27) \end{aligned} $$

Combining (26) and (22) into (21) leads to, for all $n$,

$$ \mathrm{Var} \left[ \hat{\tau}_{\pi, T, R, n}^* \right] = \frac{V_o}{n} $$
where

$$V_o = \mathrm{Var} \left[ \frac{p_T(X_i)}{p_R(X_i)} \tau(X_i) \right] + \sum_{x \in \mathcal{X}} \frac{p_T^2(x)}{p_R(x)} V_{HT}(x).$$

Note that it is also possible to write the result such as,

$$V_o = \mathrm{Var} \left[ \frac{p_T(X)}{p_R(X)} \tau(X) \right] + \mathbb{E}_R \left[ \frac{p_T^2(X)}{p_R^2(X)} V_{HT}(X) \right],$$

noting that

$$\sum_{x \in \mathcal{X}} \frac{p_T^2(x)}{p_R(x)} V_{HT}(x) = \mathbb{E}_R \left[ \frac{p_T^2(X)}{p_R^2(X)} V_{HT}(X) \right]$$

## Quadratic risk and consistency

For any estimate $\hat{\tau}$, we have

$$\mathbb{E}[(\hat{\tau} - \tau)^2] = (\mathbb{E}[\hat{\tau}] - \tau)^2 + \mathrm{Var}[\hat{\tau}].$$

Therefore, the risk of the completely oracle IPSW estimate satisfies

$$\mathbb{E}[(\hat{\tau} - \tau)^2] = \frac{V_o}{n}.$$

The $L^2$ consistency holds by letting $n$ tend to infinity.

# A.2 Proofs for the semi-oracle IPSW $\hat{\tau}_{\pi, \mathbf{r}, n}^*$

## A.2.1 Proof of Proposition 1

*Proof.* We first recall the definition of the semi-oracle estimator introduced in Definition 5:

$$\hat{\tau}_{\pi, \mathbf{r}, n}^* = \frac{1}{n} \sum_{i=1}^{n} \frac{p_T(X_i)}{\hat{p}_{\mathbf{r}, n}(X_i)} \left( \frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi} \right),$$

where, for all $x \in \mathcal{X}$,

$$\hat{p}_{\mathbf{r}, n}(x) = \frac{\sum_{i=1}^{n} 1_{X_i=x}}{n}. \qquad (28)$$

Similarly to the completely oracle estimator, the semi-oracle estimator can be written as,

$$\hat{\tau}_{\pi, \mathbf{r}, n}^* = \sum_{x \in \mathcal{X}} \frac{p_T(x)}{\hat{p}_{\mathbf{r}, n}(x)} \left( \frac{1}{n} \sum_{i=1}^{n} 1_{X_i=x} \left( \frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi} \right) \right),$$

since $X_i$ take values in a categorical set $\mathcal{X}$.

## Bias

To shorten notation, we denote the full vector of covariates $\mathbf{X}_n \in \mathcal{X}^n$, comprising the $n$ observations $X_1, X_2, \dots, X_n \in \mathcal{X}$ in the trial. We have

$$
\begin{align*}
\mathbb{E}[\hat{\tau}_{\pi, \mathbf{r}, n}^*] &= \mathbb{E} \left[ \sum_{x \in \mathcal{X}} \frac{p_T(x)}{\hat{p}_{\mathbf{r}, n}(x)} \left( \frac{1}{n} \sum_{i=1}^n 1_{X_i=x} \left( \frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi} \right) \right) \right] && \text{By definition} \\
&= \sum_{x \in \mathcal{X}} \mathbb{E} \left[ \frac{p_T(x)}{\hat{p}_{\mathbf{r}, n}(x)} \left( \frac{1}{n} \sum_{i=1}^n 1_{X_i=x} \left( \frac{Y_i^{(1)} A_i}{\pi} - \frac{Y_i^{(0)}(1-A_i)}{1-\pi} \right) \right) \right] && \text{Linearity and SUTVA} \\
&= \sum_{x \in \mathcal{X}} \mathbb{E} \left[ \mathbb{E} \left[ \frac{p_T(x)}{\hat{p}_{\mathbf{r}, n}(x)} \left( \frac{1}{n} \sum_{i=1}^n 1_{X_i=x} \left( \frac{Y_i^{(1)} A_i}{\pi} - \frac{Y_i^{(0)}(1-A_i)}{1-\pi} \right) \right) \mid \mathbf{X}_n \right] \right] && \text{Law of total expect.} \\
&= \sum_{x \in \mathcal{X}} \mathbb{E} \left[ p_T(x) \mathbb{E} \left[ \frac{1}{\hat{p}_{\mathbf{r}, n}(x)} \left( \frac{1}{n} \sum_{i=1}^n 1_{X_i=x} \left( \frac{Y_i^{(1)} A_i}{\pi} - \frac{Y_i^{(0)}(1-A_i)}{1-\pi} \right) \right) \mid \mathbf{X}_n \right] \right] && p_T(x) \text{ is deterministic} \\
&= \sum_{x \in \mathcal{X}} \mathbb{E} \left[ \frac{p_T(x)}{\hat{p}_{\mathbf{r}, n}(x)} \mathbb{E} \left[ \left( \frac{1}{n} \sum_{i=1}^n 1_{X_i=x} \left( \frac{Y_i^{(1)} A_i}{\pi} - \frac{Y_i^{(0)}(1-A_i)}{1-\pi} \right) \right) \mid \mathbf{X}_n \right] \right] && \\
&= \sum_{x \in \mathcal{X}} \mathbb{E} \left[ \frac{p_T(x)}{\hat{p}_{\mathbf{r}, n}(x)} \frac{1}{n} \sum_{i=1}^n 1_{X_i=x} \mathbb{E} \left[ \frac{Y_i^{(1)} A_i}{\pi} - \frac{Y_i^{(0)}(1-A_i)}{1-\pi} \mid \mathbf{X}_n \right] \right] &&
\end{align*}
$$
This last line uses the fact that $\sum_{i=1}^{n} \mathbb{1}_{X_i=x}$ is measurable with respect to $\mathbf{X}_n$. Then, note that,

$$ \mathbb{1}_{X_i=x} \mathbb{E} \left[ \frac{Y_i^{(1)} A_i}{\pi} - \frac{Y_i^{(0)} (1 - A_i)}{1 - \pi} \mid \mathbf{X}_n \right] = \mathbb{1}_{X_i=x} \mathbb{E} \left[ \frac{Y_i^{(1)} A_i}{\pi} - \frac{Y_i^{(0)} (1 - A_i)}{1 - \pi} \mid X_i \right] \quad \text{iid observations.} $$

Then, recall from the proof in Subsection A.1, and in particular from (20) that

$$ \begin{aligned} \mathbb{1}_{X_i=x} \mathbb{E} \left[ \frac{Y_i^{(1)} A_i}{\pi} - \frac{Y_i^{(0)} (1 - A_i)}{1 - \pi} \mid \mathbf{X}_n \right] &= \mathbb{1}_{X_i=x} \mathbb{E} \left[ \frac{Y_i^{(1)} A_i}{\pi} - \frac{Y_i^{(0)} (1 - A_i)}{1 - \pi} \mid X=x \right] & \text{Indicator forcing } X=x. \\ &= \mathbb{1}_{X_i=x} \tau(x) & \text{Transportability.} \end{aligned} $$

Therefore,

$$ \begin{aligned} \mathbb{E} [\hat{\tau}_{\pi, T, n}^*] &= \sum_{x \in \mathcal{X}} \mathbb{E} \left[ \frac{p_T(x)}{\hat{p}_{\pi, n}(x)} \frac{\sum_{i=1}^n \mathbb{1}_{X_i=x}}{n} \tau(x) \right] \\ &= \sum_{x \in \mathcal{X}} \mathbb{E} \left[ \frac{p_T(x)}{\frac{\sum_{i=1}^n \mathbb{1}_{X_i=x}}{n}} \frac{\sum_{i=1}^n \mathbb{1}_{X_i=x}}{n} \tau(x) \right] & \text{Estimation procedure - Equation 28} \end{aligned} $$

Let $Z_n(x) = \sum_{i=1}^n \mathbb{1}_{X_i=x}$ distributed as $\mathfrak{B}(n, p_R(x))$. Note that, by convention, the term inside the expectation is null if $Z_n(x) = 0$.<fnref n="6" /> This leads to the following equality,

$$ \begin{aligned} \mathbb{E} [\hat{\tau}_{\pi, T, n}^*] &= \sum_{x \in \mathcal{X}} \mathbb{E} [p_T(x) \tau(x) \mathbb{1}_{Z_n(x)>0}] \\ &= \sum_{x \in \mathcal{X}} p_T(x) \tau(x) \mathbb{E} [\mathbb{1}_{Z_n(x)>0}] \\ &= \sum_{x \in \mathcal{X}} p_T(x) \tau(x) (1 - (1 - p_R(x))^n). \end{aligned} $$

## Upper bound of the bias.

If $p_R(x) = 0$, then $p_T(x) = 0$ (due to the support inclusion assumption, see Assumption 4). Therefore, for all $x \in \mathcal{X}, 0 < p_R(x)$. Then, it is possible to bound the bias for any sample size $n$, noting that,

$$ \begin{aligned} |\mathbb{E}[\hat{\tau}_{\pi, T, n}^*] - \tau| &= \left| \sum_{x \in \mathcal{X}} p_T(x) \tau(x) (1 - (1 - p_R(x))^n) - \tau \right| \\ &= \left| \sum_{x \in \mathcal{X}} p_T(x) \tau(x) (1 - (1 - p_R(x))^n) - \sum_{x \in \mathcal{X}} p_T(x) \tau(x) \right| \\ &= \left| \sum_{x \in \mathcal{X}} p_T(x) \tau(x) (1 - p_R(x))^n \right| \\ &\leq \left(1 - \min_x p_R(x)\right)^n \sum_{x \in \mathcal{X}} p_T(x) |\tau(x)| \\ &\leq \left(1 - \min_x p_R(x)\right)^n \mathbb{E}_T [|\tau(X)|]. \end{aligned} $$

## Variance

The proof follows the same track as that of the completely oracle IPSW, conditioning on $\mathbf{X}_n$, and using the law of total variance,

$$ \mathrm{Var}[\hat{\tau}_{\pi, T, n}^*] = \mathrm{Var}[\mathbb{E}[\hat{\tau}_{\pi, T, n}^* | \mathbf{X}_n]] + \mathbb{E}[\mathrm{Var}[\hat{\tau}_{\pi, T, n}^* | \mathbf{X}_n]]. \quad (29) $$

<footnote n="6">⁶Note that to be clearer we could have introduced the multiplication by $\mathbb{1}_{Z_n(x)>0}$ in the formula summing over the categories from the beginning. Indeed, this was implicit as it is the re-writing of a sum on the trial's observations. But this also leads to heavy notations.</footnote>
For the first inside term,

$$ \mathbb{E}[\hat{\tau}_{\pi, T, n}^* | \mathbf{X}_n] = \mathbb{E} \left[ \sum_{x \in \mathcal{X}} \frac{p_T(x)}{\hat{p}_{R,n}(x)} \frac{1}{n} \sum_{i=1}^{n} \mathbb{1}_{X_i=x} \left( \frac{Y_i^{(1)} A_i}{\pi} - \frac{Y_i^{(0)} (1-A_i)}{1-\pi} \right) \middle| \mathbf{X}_n \right] \quad \text{By definition (and SUTVA)} $$

$$ = \sum_{x \in \mathcal{X}} \frac{p_T(x)}{\hat{p}_{R,n}(x)} \frac{1}{n} \sum_{i=1}^{n} \mathbb{1}_{X_i=x} \mathbb{E} \left[ \left( \frac{Y_i^{(1)} A_i}{\pi} - \frac{Y_i^{(0)} (1-A_i)}{1-\pi} \right) \middle| \mathbf{X}_n \right] \quad \text{Linearity of } \mathbb{E}[\cdot] $$

$$ = \sum_{x \in \mathcal{X}} \frac{p_T(x)}{\hat{p}_{R,n}(x)} \frac{1}{n} \sum_{i=1}^{n} \mathbb{1}_{X_i=x} \tau(X_i) $$

$$ = \sum_{x \in \mathcal{X}} p_T(x) \tau(x) \mathbb{1}_{Z_n(x)>0} \quad \text{Equation 28} $$

$$ = \mathbb{E}_{T} [\tau(X) \mathbb{1}_{Z_n(X)>0} | \mathbf{X}_n] \quad \text{Re-writing the sum as expectancy.} $$

Note that

$$ \begin{aligned} \mathrm{Var} [\mathbb{E}_T [\tau(X) \mathbb{1}_{Z_n(X)>0} | \mathbf{X}_n]] &= \mathrm{Var} [\mathbb{E}_T [\tau(X)] - \mathbb{E}_T [\tau(X) \mathbb{1}_{Z_n(X)=0} | \mathbf{X}_n]] \\ &= \mathrm{Var} [\tau - \mathbb{E}_T [\tau(X) \mathbb{1}_{Z_n(X)=0} | \mathbf{X}_n]] \\ &= \mathrm{Var} [\mathbb{E}_T [\tau(X) \mathbb{1}_{Z_n(X)=0} | \mathbf{X}_n]], \end{aligned} \quad (30) $$

as the only source of randomness comes from $\mathbb{E}_T[\tau(X)\mathbb{1}_{Z_n(X)=0}|\mathbf{X}_n]$. Therefore, the first inside term of (29) corresponds to,

$$ \mathrm{Var} [\mathbb{E}[\hat{\tau}_{\pi, T, n}^* | \mathbf{X}_n]] = \mathrm{Var} [\mathbb{E}_T [\tau(X) \mathbb{1}_{Z_n(X)=0} | \mathbf{X}_n]]. \quad (31) $$

On the other hand,

$$ \begin{aligned} \mathrm{Var}[\hat{\tau}_{\pi, T, n}^* | \mathbf{X}_n] &= \mathrm{Var} \left[ \frac{1}{n} \sum_{i=1}^{n} \frac{p_T(X_i)}{\hat{p}_{R,n}(X_i)} \left( \frac{Y_i A_i}{\pi} - \frac{Y_i (1-A_i)}{1-\pi} \right) \middle| \mathbf{X}_n \right] \\ &= \frac{1}{n^2} \sum_{i=1}^{n} \left( \frac{p_T(X_i)}{\hat{p}_{R,n}(X_i)} \right)^2 \mathrm{Var} \left[ \left( \frac{Y_i A_i}{\pi} - \frac{Y_i (1-A_i)}{1-\pi} \right) \middle| \mathbf{X}_n \right] \\ &= \frac{1}{n^2} \sum_{i=1}^{n} \left( \frac{p_T(X_i)}{\hat{p}_{R,n}(X_i)} \right)^2 \mathrm{Var} \left[ \left( \frac{Y_i A_i}{\pi} - \frac{Y_i (1-A_i)}{1-\pi} \right) \middle| X_i \right] \\ &= \frac{1}{n^2} \sum_{i=1}^{n} \left( \frac{p_T(X_i)}{\hat{p}_{R,n}(X_i)} \right)^2 V_{HT}(X_i), \end{aligned} $$

where the last row comes from intermediary results in the completely oracle proof (see equation (25)), with

$$ V_{HT}(x) := \mathbb{E}_{\mathbb{R}} \left[ \frac{(Y^{(1)})^2}{\pi} \middle| X_i \right] + \mathbb{E}_{\mathbb{R}} \left[ \frac{(Y^{(0)})^2}{1-\pi} \middle| X_i \right] - \tau(X)^2. $$

Then,

$$ \mathbb{E}[\mathrm{Var}[\hat{\tau}_{\pi, T, n}^* | \mathbf{X}_n]] = \mathbb{E} \left[ \frac{1}{n^2} \sum_{i=1}^{n} \left( \frac{p_T(X_i)}{\hat{p}_{R,n}(X_i)} \right)^2 V_{HT}(X_i) \right] \quad \text{From previous derivations} $$

$$ = \mathbb{E} \left[ \sum_{x \in \mathcal{X}} \left( \frac{1}{n^2} \sum_{i=1}^{n} \mathbb{1}_{X_i=x} \left( \frac{p_T(X_i)}{\hat{p}_{R,n}(X_i)} \right)^2 V_{HT}(X_i) \right) \right] \quad \text{Categorical X} $$

$$ = \mathbb{E} \left[ \sum_{x \in \mathcal{X}} \frac{1}{n^2} \left( \frac{p_T(x)}{\hat{p}_{R,n}(x)} \right)^2 V_{HT}(x) \left( \sum_{i=1}^{n} \mathbb{1}_{X_i=x} \right) \right] \\ = \sum_{x \in \mathcal{X}} \frac{1}{n^2} p_T(x)^2 V_{HT}(x) \mathbb{E} \left[ \left( \frac{1}{\hat{p}_{R,n}(x)} \right)^2 \left( \sum_{i=1}^{n} \mathbb{1}_{X_i=x} \right) \right]. $$

Replacing $\hat{p}_{R,n}(x)$ by its explicit expression,

$$ \mathbb{E}[\mathrm{Var}[\hat{\tau}_{\pi, T, n}^* | \mathbf{X}_n]] = \frac{1}{n} \sum_{x \in \mathcal{X}} p_T(x)^2 V_{HT}(x) \mathbb{E} \left[ \left( \frac{1}{\frac{1}{n} \sum_{i=1}^{n} \mathbb{1}_{X_i=x}} \right)^2 \left( \frac{1}{\frac{1}{n} \sum_{i=1}^{n} \mathbb{1}_{X_i=x}} \right) \right]. \quad (32) $$
As in the study of the bias, we introduce $Z_n(x) = \sum_{i=1}^n 1_{X_i=x}$, distributed as $\mathfrak{B}(n, p)$. One can then write,

$$ \mathbb{E}[\mathrm{Var}[\hat{\tau}_{\pi, T, n}^* | \mathbf{X}_n]] = \frac{1}{n} \sum_{x \in \mathcal{X}} p_T(x)^2 V_{\mathrm{HT}}(x) \mathbb{E}_{\mathbb{R}} \left[ \frac{1_{Z_n(x)>0}}{\frac{1}{n} \sum_{i=1}^n 1_{X_i=x}} \right]. $$

Recalling (29) and (31), we have

$$ \begin{aligned} \mathrm{Var}[\hat{\tau}_{\pi, T, n}^*] &= \mathrm{Var}[\mathbb{E}[\hat{\tau}_{\pi, T, n}^* | \mathbf{X}_n]] + \mathbb{E}[\mathrm{Var}[\hat{\tau}_{\pi, T, n}^* | \mathbf{X}_n]] \\ &= \mathrm{Var}[\mathbb{E}_T[\tau(X)1_{Z_n(X)=0}|\mathbf{X}_n]] + \frac{1}{n} \sum_{x \in \mathcal{X}} p_T(x)^2 V_{\mathrm{HT}}(x) \mathbb{E}\left[\frac{1_{Z_n(x)>0}}{\frac{1}{n}\sum_{i=1}^n 1_{X_i=x}}\right]. \end{aligned} \quad (33) $$

### Upper bound on the variance

According to Arnould et al. (2021) (see page 27), since $Z_n(x)$ is distributed as $\mathfrak{B}(n, p_R(x))$, we have

$$ \forall x \in \mathcal{X}, \mathbb{E}\left[\frac{1_{Z_n(x) \neq 0}}{Z_n(x)}\right] \leq \frac{2}{(n+1)p_R(x)}. $$

Besides,

$$ \begin{aligned} \mathrm{Var}[\mathbb{E}_T[\tau(X)1_{Z_n(X)=0}|\mathbf{X}_n]] &\leq \mathbb{E}_T[\tau(X)^2 1_{Z_n(X)=0}] \\ &\leq \mathbb{E}_T[\tau(X)^2 (1 - p_R(X))^n] \\ &\leq \mathbb{E}_T[\tau(X)^2] \left(1 - \min_{x \in \mathcal{X}} p_R(x)\right)^n. \end{aligned} $$

Combining these inequalities with (33) yields, for all $n$,

$$ \mathrm{Var}[\hat{\tau}_{\pi, T, n}^*] \leq \mathbb{E}_T[\tau(X)^2] \left(1 - \min_{x \in \mathcal{X}} p_R(x)\right)^n + \frac{2}{n+1} \sum_{x \in \mathcal{X}} \frac{p_T(x)^2}{p_R(x)} V_{\mathrm{HT}}(x). $$

This expression can be further simplified in,

$$ \mathrm{Var}[\hat{\tau}_{\pi, T, n}^*] \leq \frac{2V_{so}}{n+1} + \left(1 - \min_{x \in \mathcal{X}} p_R(x)\right)^n \mathbb{E}_T[\tau(X)^2], $$

where

$$ V_{so} := \sum_{x \in \mathcal{X}} \frac{p_T(x)^2}{p_R(x)} V_{\mathrm{HT}}(x) = \mathbb{E}_T \left[ \left( \frac{p_T(X)}{p_R(X)} \right)^2 V_{\mathrm{HT}}(X) \right]. $$

### A.2.2 Proof of Corollary 1

#### Proof. Asymptotically unbiased

Recall the expression of the semi-oracle IPSW bias from Proposition 1.

$$ \mathbb{E}[\hat{\tau}_{\pi, T, n}^*] = \sum_{x \in \mathcal{X}} p_T(x) \tau(x) (1 - (1 - p_R(x))^n). $$

According to Assumption 4, we have $\forall x \in \mathcal{X}, 0 < p_R(x) < 1$. As a consequence,

$$ \lim_{n \to \infty} (1 - (1 - p_R(x))^n = 1, $$

which leads to

$$ \lim_{n \to \infty} \mathbb{E}[\hat{\tau}_{\pi, T, n}^*] = \tau. $$

#### Asymptotic variance

Recall the expression of the variance of the semi-oracle IPSW from Proposition 1:
$$n \operatorname{Var}[\hat{\tau}_{\pi, T, n}^*] = n \operatorname{Var}[\mathbb{E}[\hat{\tau}_{\pi, T, n}^* | \mathbf{X}_n]] + \sum_{x \in \mathcal{X}} p_T(x)^2 V_{HT}(x) \mathbb{E}_R \left[ \frac{1_{Z_n(x)>0}}{\frac{1}{n} \sum_{i=1}^n 1_{X_i=x}} \right]. \quad (34)$$

Note that the first term tends to zero since

$$0 \le n \operatorname{Var}[\mathbb{E}[\hat{\tau}_{\pi, T, n}^* | \mathbf{X}_n]] \le \mathbb{E}_T[\tau(X)^2] \left(1 - \min_{x \in \mathcal{X}} p_R(x)\right)^n.$$

Therefore,

$$\lim_{n \to \infty} n \operatorname{Var}[\hat{\tau}_{\pi, T, n}^*] = \lim_{n \to \infty} \sum_{x \in \mathcal{X}} p_T(x)^2 V_{HT}(x) \mathbb{E}_R \left[ \frac{1_{Z_n(x)>0}}{\frac{1}{n} \sum_{i=1}^n 1_{X_i=x}} \right]. \quad (35)$$

The next part of the proof consists in characterizing how the term $\mathbb{E}_R[\frac{1_{Z_n(x)>0}}{Z_n(x)/n}]$ converges. Let $\varepsilon > 0$. Since, for all $x$, $p_R(x) > 0$, we have

$$\mathbb{E} \left[ \frac{1_{Z_n(x)>0}}{\frac{Z_n(x)}{n}} \right] = \mathbb{E} \left[ \frac{1_{Z_n(x)>0}}{\frac{Z_n(x)}{n}} 1_{|\frac{Z_n(x)}{n} - p_R(x)| \ge \varepsilon} \right] + \mathbb{E} \left[ \frac{1_{Z_n(x)>0}}{\frac{Z_n(x)}{n}} 1_{|\frac{Z_n(x)}{n} - p_R(x)| < \varepsilon} \right]. \quad (36)$$

Regarding the first term in (36), we have

$$\mathbb{E} \left[ \frac{1_{Z_n(x)>0}}{\frac{Z_n(x)}{n}} 1_{|\frac{Z_n(x)}{n} - p_R(x)| \ge \varepsilon} \right] \le n \mathbb{P} \left[ \left| \frac{Z_n(x)}{n} - p_R(x) \right| \ge \varepsilon \right],$$

since, on the event $Z_n(x) > 0$, $Z_n(x) \ge 1$. Now, by Chernoff's inequality,

$$\mathbb{P} \left[ \left| \frac{Z_n(x)}{n} - p_R(x) \right| \ge \varepsilon \right] \le 2 \exp(-2\varepsilon^2 n),$$

which yields

$$\mathbb{E} \left[ \frac{1_{Z_n(x)>0}}{\frac{Z_n(x)}{n}} 1_{|\frac{Z_n(x)}{n} - p_R(x)| \ge \varepsilon} \right] \le 2n \exp(-2\varepsilon^2 n). \quad (37)$$

Regarding the second term in equation (36), since

$$\frac{1_{Z_n(x)>0}}{\frac{Z_n(x)}{n}} 1_{|\frac{Z_n(x)}{n} - p_R(x)| < \varepsilon}$$

is bounded above, for $\varepsilon < p_R(x)/2$ and converges in probability to $1/p_R(x)$, we have

$$\mathbb{E} \left[ \frac{1_{Z_n(x)>0}}{\frac{Z_n(x)}{n}} 1_{|\frac{Z_n(x)}{n} - p_R(x)| < \varepsilon} \right] \to \frac{1}{p_R(x)}, \quad \text{as } n \to \infty. \quad (38)$$

Combining (37) and (38), we have

$$\mathbb{E} \left[ \frac{1_{Z_n(x)>0}}{Z_n(x)/n} \right] \to \frac{1}{p_R(x)}, \quad \text{as } n \to \infty.$$

Using equation (35), we finally obtain

$$\lim_{n \to \infty} n \operatorname{Var}[\hat{\tau}_{\pi, T, n}^*] = \sum_{x \in \mathcal{X}} \frac{p_T(x)^2}{p_R(x)} V_{HT}(x) = \mathbb{E} \left[ \left( \frac{p_T(X)}{p_R(X)} \right)^2 V_{HT}(X) \right] := V_{\text{so}}.$$

### A.2.3 Proof of Theorem 2

*Proof.* For any estimate $\hat{\tau}$, we have

$$\mathbb{E}[(\hat{\tau} - \tau)^2] = (\mathbb{E}[\hat{\tau}] - \tau)^2 + \operatorname{Var}[\hat{\tau}].$$
Therefore, the risk of the semi-oracle IPSW estimate can be bounded using results from Subsection A.2.1 (or Proposition 1), and in particular the bounds on the variance and the bias,

$$ 
\begin{aligned}
\mathbb{E}[(\hat{\tau} - \tau)^2] & \leq (1 - \min_x p_R(x))^{2n} \mathbb{E}_T [\|\tau(X)\|^2] + \frac{2V_{so}}{n+1} + (1 - \min_{x \in \mathcal{X}} p_R(x))^n \mathbb{E}_T [\tau(X)^2] \\
& \leq \frac{2V_{so}}{n+1} + 2 (1 - \min_{x \in \mathcal{X}} p_R(x))^n \mathbb{E}_T [\tau(X)^2],
\end{aligned}
$$

In particular thanks to the fact that,

$$ \mathrm{Var}_T [\|\tau(X)\|] = \mathbb{E}_T [\tau(X)^2] - \mathbb{E}_T [\|\tau(X)\|^2], $$

so that,

$$ \mathbb{E}_T [\|\tau(X)\|^2] \leq \mathbb{E}_T [\tau(X)^2]. $$

The $L^2$ consistency holds by letting $n$ tend to infinity. $\square$

## A.3 Proofs for (estimated) IPSW $\hat{\tau}_{\pi,n,m}$

We first recall the definition of a fully estimated estimator introduced in Definition 6.

$$ \hat{\tau}_{\pi,n,m} = \frac{1}{n} \sum_{i=1}^{n} \frac{\hat{p}_{\mathrm{T},m}(X_i)}{\hat{p}_{\mathrm{R},n}(X_i)} \left( \frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi} \right), $$

where, for all $x \in \mathcal{X}$,

$$ \hat{p}_{\mathrm{R},n}(x) = \frac{\sum_{i=1}^{n} 1_{X_i=x}}{n}, \quad \text{and} \quad \hat{p}_{\mathrm{T},m}(x) = \frac{\sum_{i=n+1}^{n+m} 1_{X_i=x}}{m}. \qquad (39) $$

Similar to the completely oracle estimator, this estimated IPSW can be written as,

$$ \hat{\tau}_{\pi,n,m} = \sum_{x \in \mathcal{X}} \frac{\hat{p}_{\mathrm{T},m}(x)}{\hat{p}_{\mathrm{R},n}(x)} \left( \frac{1}{n} \sum_{i=1}^{n} 1_{X_i=x} \left( \frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi} \right) \right). $$

All the proofs below rely on this decomposition.

### A.3.1 Proof of Proposition 2

#### Proof. Expression of the bias

Using the exact same derivations as in Subsection A.2.1 (Bias), but using the law of total expectation when conditioning on $\mathbf{X}_{n+m} \in \mathcal{X}^{n+m}$ (i.e. comprising the $n$ and $m$ observations $X_1, X_2, \dots, X_n, X_{n+1}, \dots, X_{n+m} \in \mathcal{X}$ in the trial and target population, one has,

$$ 
\begin{aligned}
\mathbb{E}[\hat{\tau}_{\pi,n,m}] &= \sum_{x \in \mathcal{X}} \mathbb{E} \left[ \frac{\hat{p}_{\mathrm{T},m}(x) \sum_{i=1}^{n} 1_{X_i=x}}{\hat{p}_{\mathrm{R},n}(x)} \tau(x) \right] \\
&= \sum_{x \in \mathcal{X}} \mathbb{E} \left[ \frac{\hat{p}_{\mathrm{T},m}(x) \sum_{i=1}^{n} 1_{X_i=x}}{\sum_{i=1}^{n} 1_{X_i=x}} \tau(x) \right] \quad \text{Estimation procedure - Equation 39} \\
&= \sum_{x \in \mathcal{X}} \mathbb{E} \left[ \hat{p}_{\mathrm{T},m}(x) \tau(x) 1_{Z_n(x) \neq 0} \right].
\end{aligned}
$$

Note that $Z_n(x)$ only depend on the trial sample $\mathcal{R}$ and $\hat{p}_{\mathrm{T},m}(x)$ on the observational sample. In addition, $\tau(x)$ is deterministic, therefore

$$ \mathbb{E}[\hat{\tau}_{\pi,n,m}] = \sum_{x \in \mathcal{X}} \tau(x) \mathbb{E}[\hat{p}_{\mathrm{T},m}(x)] \mathbb{E}[1_{Z_n(x) \neq 0}]. $$

Note that $\mathbb{E}[\hat{p}_{\mathrm{T},m}(x)] = p_{\mathrm{T}}(x)$. Besides, according to the proof of the semi-oracle IPSW,

$$ \mathbb{E}[1_{Z_n(x) \neq 0}] = (1 - (1 - p_R(x))^n). $$
Therefore,

$$ \mathbb{E}[\hat{\tau}_{\pi,n,m}] = \sum_{x \in \mathcal{X}} p_{\mathrm{T}}(x) \tau(x) (1 - (1 - p_{\mathrm{R}}(x))^{n}), $$

that is

$$ \mathbb{E}[\hat{\tau}_{\pi,n,m}] - \tau = - \sum_{x \in \mathcal{X}} p_{\mathrm{T}}(x) \tau(x) (1 - p_{\mathrm{R}}(x))^{n}. $$

## Upper bound on the bias

It is possible to bound the bias for any sample size $n$, using the exact same derivations than for the semi-oracle IPSW.

## Expression of the variance

The proof follows a similar spirit as the proof for the completely oracle estimator, conditioning on all observations $\mathbf{X}_{n+m}$.

$$ \mathrm{Var}[\hat{\tau}_{\pi,n,m}] = \mathrm{Var}[\mathbb{E}[\hat{\tau}_{\pi,n,m} | \mathbf{X}_{n+m}]] + \mathbb{E}[\mathrm{Var}[\hat{\tau}_{\pi,n,m} | \mathbf{X}_{n+m}]]. \quad (40) $$

$$ \begin{aligned} \mathbb{E}[\hat{\tau}_{\pi,n,m} | \mathbf{X}_{n+m}] &= \mathbb{E} \left[ \sum_{x \in \mathcal{X}} \frac{\hat{p}_{\mathrm{T},m}(x)}{\hat{p}_{\mathrm{R},n}(x)} \left( \frac{1}{n} \sum_{i=1}^{n} \mathbb{1}_{X_i=x} \left( \frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi} \right) \right) | \mathbf{X}_{n+m} \right] \\ &= \sum_{x \in \mathcal{X}} \mathbb{E} \left[ \frac{\hat{p}_{\mathrm{T},m}(x)}{\hat{p}_{\mathrm{R},n}(x)} \left( \frac{1}{n} \sum_{i=1}^{n} \mathbb{1}_{X_i=x} \left( \frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi} \right) \right) | \mathbf{X}_{n+m} \right] \quad \text{Linearity of } \mathbb{E}[\cdot] \\ &= \sum_{x \in \mathcal{X}} \frac{\hat{p}_{\mathrm{T},m}(x)}{\hat{p}_{\mathrm{R},n}(x)} \mathbb{E} \left[ \frac{1}{n} \sum_{i=1}^{n} \mathbb{1}_{X_i=x} \left( \frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi} \right) | \mathbf{X}_{n+m} \right]. \end{aligned} $$

Indeed, $\hat{p}_{\mathrm{R},n}(x)$ and $\hat{p}_{\mathrm{T},m}(x)$ are measurable with respect to $\mathbf{X}_{n+m}$.

Pursuing the computation, we have

$$ \begin{aligned} \mathbb{E}[\hat{\tau}_{\pi,n,m} | \mathbf{X}_{n+m}] &= \sum_{x \in \mathcal{X}} \frac{\hat{p}_{\mathrm{T},m}(x)}{\hat{p}_{\mathrm{R},n}(x)} \mathbb{E} \left[ \frac{1}{n} \sum_{i=1}^{n} \mathbb{1}_{X_i=x} \left( \frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi} \right) | \mathbf{X}_{n+m} \right] \\ &= \sum_{x \in \mathcal{X}} \frac{\hat{p}_{\mathrm{T},m}(x)}{\hat{p}_{\mathrm{R},n}(x)} \frac{1}{n} \sum_{i=1}^{n} \mathbb{E} \left[ \mathbb{1}_{X_i=x} \left( \frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi} \right) | \mathbf{X}_{n+m} \right] \quad \text{Linearity of } \mathbb{E}[\cdot] \\ &= \sum_{x \in \mathcal{X}} \frac{\hat{p}_{\mathrm{T},m}(x)}{\hat{p}_{\mathrm{R},n}(x)} \frac{1}{n} \sum_{i=1}^{n} \mathbb{E} \left[ \left( \frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi} \right) | \mathbf{X}_{n+m} \right] \quad \text{Conditioning on } \mathbf{X}_n \\ &= \sum_{x \in \mathcal{X}} \frac{\hat{p}_{\mathrm{T},m}(x)}{\hat{p}_{\mathrm{R},n}(x)} \tau(x) \frac{1}{n} \sum_{i=1}^{n} \mathbb{1}_{X_i=x} \quad \text{Transportability} \\ &= \sum_{x \in \mathcal{X}} \hat{p}_{\mathrm{T},m}(x) \tau(x) \mathbb{1}_{Z_n(x) \neq 0}, \end{aligned} $$

where $Z_n(x) = \sum_{i=1}^{n} \mathbb{1}_{X_i=x}$. Then,

$$ \begin{aligned} \mathrm{Var}[\mathbb{E}[\hat{\tau}_{\pi,n,m} | \mathbf{X}_{n+m}]] &= \mathrm{Var} \left[ \sum_{x \in \mathcal{X}} \hat{p}_{\mathrm{T},m}(x) \tau(x) \mathbb{1}_{Z_n(x) \neq 0} \right] \\ &= \mathrm{Var} \left[ \sum_{x \in \mathcal{X}} \frac{\sum_{i=n+1}^{n+m} \mathbb{1}_{X_i=x}}{m} \tau(x) \mathbb{1}_{Z_n(x) \neq 0} \right] \\ &= \mathrm{Var} \left[ \frac{1}{m} \sum_{i=n+1}^{n+m} \tau(X_i) \mathbb{1}_{Z_n(X_i) \neq 0} \right] \end{aligned} $$

Note that, contrary to the semi-oracle IPSW, this term is non-null due to estimation of $\hat{p}_{\mathrm{T},m}$. By the law of
total variance,

$$
\begin{align*}
\operatorname{Var}\left[\frac{1}{m} \sum_{i=n+1}^{n+m} \tau(X_i) 1_{Z_n(X_i) \neq 0}\right] &= \mathbb{E}\left[\operatorname{Var}\left[\frac{1}{m} \sum_{i=n+1}^{n+m} \tau(X_i) 1_{Z_n(X_i) \neq 0} | \mathbf{X}_n\right]\right] \\
&\quad + \operatorname{Var}\left[\mathbb{E}\left[\frac{1}{m} \sum_{i=n+1}^{n+m} \tau(X_i) 1_{Z_n(X_i) \neq 0} | \mathbf{X}_n\right]\right] \\
&= \frac{1}{m} \mathbb{E}\left[\operatorname{Var}\left[\tau(X) 1_{Z_n(X) \neq 0} | \mathbf{X}_n\right]\right] + \operatorname{Var}\left[\mathbb{E}\left[\tau(X) 1_{Z_n(X) \neq 0} | \mathbf{X}_n\right]\right] \\
&= \frac{1}{m} \operatorname{Var}\left[\tau(X) 1_{Z_n(X) \neq 0}\right] + \left(1 - \frac{1}{m}\right) \operatorname{Var}\left[\mathbb{E}\left[\tau(X) 1_{Z_n(X) \neq 0} | \mathbf{X}_n\right]\right],
\end{align*}
$$

where the last line comes from the law of total variance applied to $\operatorname{Var}[\tau(X)1_{Z_n(X) \neq 0}]$. Recalling similar derivations from the semi-oracle IPSW proof, and in particular (30), one has

$$
\mathrm{Var} \left[ \mathbb{E} \left[ \tau(X) 1_{Z_n(X) \neq 0} | \mathbf{X}_n \right] \right] = \mathrm{Var} \left[ \mathbb{E}_T \left[ \tau(X) 1_{Z_n(X) = 0} | \mathbf{X}_n \right] \right],
$$

so that

$$
\operatorname{Var} \left[ \mathbb{E} \left[ \hat{\tau}_{\pi,n,m} \mid \mathbf{X}_n \right] \right] = \frac{1}{m} \operatorname{Var} \left[ \tau(X) 1_{Z_n(X) \neq 0} \right] + \left(1 - \frac{1}{m}\right) \operatorname{Var} \left[ \mathbb{E}_T \left[ \tau(X) 1_{Z_n(X) = 0} \mid \mathbf{X}_n \right] \right]. \quad (41)
$$

For the other term of (40),

$$
\begin{align*}
\operatorname{Var}[\hat{\tau}_{\pi,n,m} | \mathbf{X}_{n+m}] &= \operatorname{Var}\left[\frac{1}{n} \sum_{i=1}^{n} \frac{\hat{p}_{\mathrm{T},m}(X_i)}{\hat{p}_{\mathrm{R},n}(X_i)} \left(\frac{Y_i A_i}{\pi} - \frac{Y_i(1-A_i)}{1-\pi}\right) | \mathbf{X}_{n+m}\right] \\
&= \frac{1}{n^2} \sum_{i=1}^{n} \left(\frac{\hat{p}_{\mathrm{T},m}(X_i)}{\hat{p}_{\mathrm{R},n}(X_i)}\right)^2 V_{\mathrm{HT}}(X_i).
\end{align*}
$$

Derivations are very similar to the semi-oracle estimator, using the fact that $\hat{p}_{R,n}(x)$ and $\hat{p}_{T,m}(x)$ are measurable with respect to $\mathbf{X}_{n+m}$. We have

$$
\begin{align*}
\mathbb{E}[\operatorname{Var}[\hat{\tau}_{\pi,n,m} | \mathbf{X}_{n+m}]] &= \mathbb{E}\left[\frac{1}{n^2} \sum_{i=1}^{n} \left(\hat{p}_{\mathrm{T},m}(X_i)\right)^2 V_{\mathrm{HT}}(X_i)\right] && \text{From previous derivations} \\
&= \mathbb{E}\left[\sum_{x \in \mathcal{X}} \left(\frac{1}{n^2} \sum_{i=1}^{n} 1_{X_i=x} \left(\hat{p}_{\mathrm{T},m}(X_i)\right)^2 \hat{V}_{\mathrm{HT}}(X_i)\right)\right] && \text{Categorical } \mathcal{X} \\
&= \mathbb{E}\left[\sum_{x \in \mathcal{X}} \frac{1}{n^2} \left(\frac{\hat{p}_{\mathrm{T},m}(x)}{\hat{p}_{\mathrm{R},n}(x)}\right)^2 V_{\mathrm{HT}}(x) \left(\sum_{i=1}^{n} 1_{X_i=x}\right)\right] \\
&= \sum_{x \in \mathcal{X}} \frac{1}{n^2} V_{\mathrm{HT}}(x) \mathbb{E}\left[\left(\frac{\hat{p}_{\mathrm{T},m}(x)}{\hat{p}_{\mathrm{R},n}(x)}\right)^2 \left(\sum_{i=1}^{n} 1_{X_i=x}\right)\right] \\
&= \sum_{x \in \mathcal{X}} \frac{1}{n} V_{\mathrm{HT}}(x) \mathbb{E}_{\mathcal{R}}\left[\frac{\left(\hat{p}_{\mathrm{T},m}(x)\right)^2}{\hat{p}_{\mathrm{R},n}(x)} 1_{Z_n(x) \neq 0}\right].
\end{align*}
$$

In particular, the last term can be simplified in

$$
\mathbb{E} [\operatorname{Var}[\hat{\tau}_{\pi,n,m} | \mathbf{X}_{n+m}]] = \sum_{x \in \mathcal{X}} \frac{1}{n} V_{\mathrm{HT}}(x) \mathbb{E} \left[ (\hat{p}_{\mathrm{T},m}(x))^2 \right] \mathbb{E} \left[ \frac{1}{\hat{p}_{\mathrm{R},n}(x)} \right]. \quad (42)
$$

This last derivation is possible because $\hat{p}_{\mathrm{T},m}(x)$, which depends on $\mathcal{T}$, and $\hat{p}_{\mathrm{R},n}(x)$, which depends on $\mathcal{R}$, are independent. The difference from the semi-oracle estimator comes from the term

$$
\begin{align*}
\mathbb{E}[(\hat{p}_{\mathrm{T},m}(x))^2] &= \mathbb{E}\left[\left(\frac{\sum_{i=n+1}^{m} 1_{X_i=x}}{m}\right)^2\right] \\
&= \frac{1}{m^2}\mathbb{E}\left[\left(\sum_{i=n+1}^{m} 1_{X_i=x}\right)^2\right] \\
&= \frac{1}{m^2}(mp_{\mathrm{T}}(x)(1-p_{\mathrm{T}})(x) + m^2p_{\mathrm{T}}^2(x)) \\
&= \frac{p_{\mathrm{T}}(x)(1-p_{\mathrm{T}}(x))}{m} + p_{\mathrm{T}}^2(x). \tag{43}
\end{align*}
$$
Using (41) and (43) in (40), we have

$$
\begin{align}
\mathrm{Var}[\hat{\tau}_{\pi,n,m}] &= \mathrm{Var}[\mathbb{E}[\hat{\tau}_{\pi,n,m} | \mathbf{X}_{n+m}]] + \mathbb{E}[\mathrm{Var}[\hat{\tau}_{\pi,n,m} | \mathbf{X}_{n+m}]] \nonumber \\
&= \frac{1}{m} \mathrm{Var}_T[\tau(X)1_{Z_n(X) \neq 0}] + \left(1 - \frac{1}{m}\right) \mathrm{Var}[\mathbb{E}_T[\tau(X)1_{Z_n(X) = 0} | \mathbf{X}_n]] \nonumber \\
&\quad + \frac{1}{n} \sum_{x \in \mathcal{X}} V_{HT}(x) \frac{p_T(x)(1 - p_T(x))}{m} \mathbb{E}\left[\frac{1_{Z_n(x) \neq 0}}{\hat{p}_{R,n}(x)}\right] + \frac{1}{n} \sum_{x \in \mathcal{X}} V_{HT}(x) p_T^2(x) \mathbb{E}\left[\frac{1_{Z_n(x) \neq 0}}{\hat{p}_{R,n}(x)}\right] \nonumber \\
&= \frac{1}{m} \left(\mathrm{Var}_T[\tau(X)1_{Z_n(X) \neq 0}] - \mathrm{Var}[\mathbb{E}_T[\tau(X)1_{Z_n(X) = 0} | \mathbf{X}_n]]\right) + \mathrm{Var}[\hat{\tau}_{\pi,T,n}^*] \nonumber \\
&\quad + \frac{1}{nm} \sum_{x \in \mathcal{X}} V_{HT}(x) p_T(x)(1 - p_T(x)) \mathbb{E}\left[\frac{1_{Z_n(x) \neq 0}}{\hat{p}_{R,n}(x)}\right]. \tag{44}
\end{align}
$$

Upper bound on the variance.

We first bound (41), corresponding to

$$
\mathrm{Var}[\mathbb{E}[\hat{\tau}_{\pi,n,m} | \mathbf{X}_{n+m}]] = \frac{1}{m} \mathrm{Var}_T[\tau(X)1_{Z_n(X) \neq 0}] + \left(1 - \frac{1}{m}\right) \mathrm{Var}[\mathbb{E}[\tau(X)1_{Z_n(X) = 0} | \mathbf{X}_{n+m}]] .
$$

We have

$$
\begin{align*}
\mathrm{Var}_T[\tau(X)1_{Z_n(X) \neq 0}] &= \mathrm{Var}_T[\tau(X) - \tau(X)1_{Z_n(X) = 0}] \\
&= \mathrm{Var}_T[\tau(X)] - 2 \mathrm{Cov}_T(\tau(X), \tau(X)1_{Z_n(X) = 0}) + \mathrm{Var}_T[\tau(X)1_{Z_n(X) = 0}] \\
&\le \mathrm{Var}_T[\tau(X)] + 2 (\mathrm{Var}_T[\tau(X)] \mathrm{Var}_T[\tau(X)1_{Z_n(X) = 0}])^{1/2} + \mathrm{Var}_T[\tau(X)1_{Z_n(X) = 0}],
\end{align*}
$$

with

$$
\begin{align*}
\mathrm{Var}_T[\tau(X)1_{Z_n(X)=0}] &\le \mathbb{E}[\tau(X)^2 1_{Z_n(X)=0}] \\
&\le \mathbb{E}[\tau(X)^2 \mathbb{E}[1_{Z_n(X)=0} | X]] \\
&\le \mathbb{E}[\tau(X)^2 (1 - p_R(X))^n] \\
&\le (1 - \min_x p_R(x))^n \mathbb{E}_T[\tau(X)^2].
\end{align*}
$$

Consequently,

$$
\begin{align*}
\mathrm{Var}_T[\tau(X)1_{Z_n(X) \neq 0}] &\le \mathrm{Var}_T[\tau(X)] + 2\mathrm{E}_T[\tau(X)^2] (1 - \min_x p_R(x))^{n/2} + (1 - \min_x p_R(x))^n \mathrm{E}_T[\tau(X)^2] \\
&\le \mathrm{Var}_T[\tau(X)] + 4\mathrm{E}_T[\tau(X)^2] (1 - \min_x p_R(x))^{n/2}.
\end{align*}
$$

One can also bound the other term of (41) following the same derivations as the semi-oracle IPSW,

$$
\begin{align}
\mathrm{Var}[\mathbb{E}[\tau(X)1_{Z_n(X)=0}|\mathbf{X}_{n+m}]] &\le \mathbb{E}[\tau(X)^21_{Z_n(X)=0}] \nonumber \\
&= \mathbb{E}[\tau(X)^2\mathbb{E}[1_{Z_n(X)=0}|X]] \nonumber \\
&= \mathbb{E}[\tau(X)^2\mathbb{P}[Z_n(X)=0|X]] \nonumber \\
&\le \mathbb{E}[\tau(X)^2](1-\min_x p_R(x))^{n}. \tag{45}
\end{align}
$$

The first bound is obtained using the fact that the variance of a random variable is bounded by the expectancy
of the squared random variables, and either the law of total variance or Jensen inequality.

Then, using the fact that $1 - \frac{1}{m} \le 1$,

$$
\begin{align}
\mathrm{Var}[\mathbb{E}_T[\hat{\tau}_{\pi,n,m} | \mathbf{X}_{n+m}]] &\le \frac{\mathrm{Var}_T[\tau(X)]}{m} + \frac{4\mathbb{E}_T[\tau(X)^2]}{m} (1 - \min_x p_R(x))^{n/2} + \mathbb{E}_T[\tau(X)^2] (1 - \min_x p_R(x))^n \nonumber \\
&\le \frac{\mathrm{Var}_T[\tau(X)]}{m} + \mathbb{E}_T[\tau(X)^2] \left(\frac{4}{m} + 1\right) (1 - \min_x p_R(x))^{n/2}. \tag{46}
\end{align}
$$

Then, for the other term of the asymptotic variance, one can use the results from Arnould et al. (2021) (see
page 27) to bound the variance, which leads to
$$
\begin{align*}
\mathbb{E}[\mathrm{Var}[\hat{\tau}_{\pi,n,m} | \mathbf{X}_{n+m}]] &= \sum_{x \in \mathcal{X}} \frac{1}{n} g(x) \mathbb{E}[(\hat{p}_{\mathrm{T},m}(x))^2] \mathbb{E}\left[\frac{1}{\frac{Z_n(x)}{n}}\right] \\
&\leq \sum_{x \in \mathcal{X}} g(x) \mathbb{E}\left[(\hat{p}_{\mathrm{T},m}(x))^2\right] \frac{2}{(n+1)p_{\mathrm{R}}(x)} \tag*{Arnould et al. (2021) (p.27)} \\
&= \sum_{x \in \mathcal{X}} g(x) \left(\frac{p_{\mathrm{T}}(x)(1-p_{\mathrm{T}}(x))}{m} + p_{\mathrm{T}}(x)^2\right) \frac{2}{(n+1)p_{\mathrm{R}}(x)}
\end{align*}
$$

Finally, using (46), and (44),

$$
\mathrm{Var}[\hat{\tau}_{\pi,n,m}] \le \frac{\mathrm{Var}_T[\tau(X)]}{m} + \mathbb{E}_T[\tau(X)^2] \left(\frac{4}{m} + 1\right) \left(1 - \min_x p_R(x)\right)^{n/2} \\
+ \frac{2}{n+1} \left( \mathbb{E}_R \left[ \left(\frac{p_T(X)}{p_R(X)}\right)^2 V_{HT}(X) \right] + \frac{1}{m} \mathbb{E}_R \left[ \frac{p_T(X)(1-p_T(X))}{p_R(X)^2} V_{HT}(X) \right] \right). \quad (47)
$$

A.3.2 Proof of Corollary 2

Asymptotic bias

The proof is exactly the same as for the semi-oracle IPSW, see Subsection A.2.2.

Asymptotic variance

We recall that the explicit expression of the variance is

$$
\begin{align*}
\mathrm{Var}[\hat{\tau}_{\pi,n,m}] ={}& \frac{1}{m} \mathrm{Var}_T[\tau(X)1_{Z_n(X) \neq 0}] + \left(1 - \frac{1}{m}\right) \mathrm{Var}\left[\mathbb{E}[\tau(X)1_{Z_n(X)=0}|\mathbf{X}_n]\right] \\
& + \frac{1}{n} \sum_{x \in \mathcal{X}} V_{HT}(x) \frac{p_T(x)(1-p_T(x))}{m} \mathbb{E}\left[\frac{1}{\hat{p}_{R,n}(x)}\right] + \mathrm{Var}[\hat{\tau}_{\pi,T,n}^*].
\end{align*}
$$

Let's consider a slightly different quantity, multiplying by $\min(n, m)$,

$$
\min(n,m) \mathrm{Var}[\hat{\tau}_{\pi,n,m}] = \frac{\min(n,m)}{m} \mathrm{Var}_T[\tau(X)1_{Z_n(X) \neq 0}] + \min(n,m) \left(1 - \frac{1}{m}\right) \mathrm{Var}\left[\mathbb{E}[\tau(X)1_{Z_n(X)=0}|\mathbf{X}_n]\right] \\
+ \frac{\min(n,m)}{nm} \sum_{x \in \mathcal{X}} V_{HT}(x) p_T(x) (1 - p_T(x)) \mathbb{E}\left[\frac{1}{\hat{p}_{R,n}(x)}\right] + \min(n,m) \mathrm{Var}[\hat{\tau}_{\pi,T,n}^*].
$$

Now, we study an asymptotic regime where $n$ and $m$ can grow toward infinity but at different paces. Let $\lim_{n,m \to \infty} \frac{m}{n} = \lambda \in [0, \infty]$, where $\lambda$ characterizes the regime.

**Case 1:** If $\lambda \in [1, \infty)$, one can replace $\min(n, m)$ by $n$, so that

$$
\lim_{n,m \to \infty} n \mathrm{Var}[\hat{\tau}_{\pi,n,m}] = \lim_{n,m \to \infty} \underbrace{\left( \frac{n}{m} \mathrm{Var}_T[\tau(X)1_{Z_n(X) \neq 0}] + n \left(1 - \frac{1}{m}\right) \mathrm{Var}\left[\mathbb{E}[\tau(X)1_{Z_n(X)=0}|\mathbf{X}_n]\right] \right)}_{=0} \\
+ \underbrace{\lim_{n,m \to \infty} \left( \frac{1}{m} \sum_{x \in \mathcal{X}} V_{HT}(x) p_T(x) (1 - p_T(x)) \mathbb{E}\left[\frac{1}{\hat{p}_{R,n}(x)}\right] \right)}_{=V_{so}} \\
+ \underbrace{\lim_{n,m \to \infty} (n \mathrm{Var}[\hat{\tau}_{\pi,T,n}^*])}_{=V_{so}}
$$

Corollary 1

where we also used from former proof, (37) and (38) stating that

$$
\mathbb{E}\left[\frac{1}{Z_n(x)>0}\right] \to \frac{1}{p_R(x)}, \quad \text{as } n \to \infty.
$$
Recalling (45),

$$0 \le \mathrm{Var} \left[ \mathbb{E} \left[ \tau(X) \mathbf{1}_{Z_n(X)=0} | \mathbf{X}_n \right] \right] \le \tau \left( 1 - \min_x p_R(x) \right)^{2n},$$

due to the exponential convergence one has,

$$\lim_{n \to \infty} n \mathrm{Var} \left[ \mathbb{E} \left[ \tau(X) \mathbf{1}_{Z_n(X)=0} | \mathbf{X}_n \right] \right] = 0,$$

and therefore,

$$\lim_{n,m \to \infty} n \left(1 - \frac{1}{m}\right) \mathrm{Var} \left[ \mathbb{E} \left[ \tau(X) \mathbf{1}_{Z_n(X)=0} | \mathbf{X}_n \right] \right] = 0. \quad (48)$$

Besides,

$$\lim_{n \to \infty} \mathrm{Var}_T \left[ \tau(X) \mathbf{1}_{Z_n(X) \neq 0} \right] = \mathrm{Var}_T \left[ \tau(X) \right],$$

To summarize, if $\lambda \in [1, \infty]$, one can conclude that

$$\lim_{n,m \to \infty} n \mathrm{Var} \left[ \hat{\tau}_{\pi,n,m} \right] = \frac{\mathrm{Var} \left[ \tau(X) \right]}{\lambda} + V_{so}. \quad (49)$$

**Case 2:** If $\lambda \in [0, 1]$, one can replace $\min(n, m)$ by $m$, so that

$$\lim_{n,m \to \infty} m \mathrm{Var} \left[ \hat{\tau}_{\pi,n,m} \right] = \lim_{n,m \to \infty} \mathrm{Var}_T \left[ \tau(X) \mathbf{1}_{Z_n(X) \neq 0} \right] + \lim_{n,m \to \infty} m \left(1 - \frac{1}{m}\right) \mathrm{Var} \left[ \mathbb{E} \left[ \tau(X) \mathbf{1}_{Z_n(X)=0} | \mathbf{X}_n \right] \right] \\ + \lim_{n,m \to \infty} \frac{1}{n} \sum_{x \in \mathcal{X}} V_{HT}(x) p_T(x) (1 - p_T(x)) \mathbb{E} \left[ \frac{\mathbf{1}_{Z_n(x) \neq 0}}{\hat{p}_{R,n}(x)} \right] \\ + \lim_{n,m \to \infty} \lambda \sum_{x \in \mathcal{X}} V_{HT}(x) p_T^2(x) \mathbb{E} \left[ \frac{\mathbf{1}_{Z_n(x) \neq 0}}{\hat{p}_{R,n}(x)} \right].$$

In particular,

$$\lim_{n,m \to \infty} \mathrm{Var}_T \left[ \tau(X) \mathbf{1}_{Z_n(X) \neq 0} \right] = \mathrm{Var}_T \left[ \tau(X) \right].$$

As above, we have

$$\lim_{n,m \to \infty} m \left(1 - \frac{1}{m}\right) \mathrm{Var} \left[ \mathbb{E} \left[ \tau(X) \mathbf{1}_{Z_n(X)=0} | \mathbf{X}_n \right] \right] = 0,$$

because,

$$0 \le m \left(1 - \frac{1}{m}\right) \mathrm{Var} \left[ \mathbb{E} \left[ \tau(X) \mathbf{1}_{Z_n(X)=0} | \mathbf{X}_n \right] \right] \le n \left(1 - \frac{1}{m}\right) \mathrm{Var} \left[ \mathbb{E} \left[ \tau(X) \mathbf{1}_{Z_n(X)=0} | \mathbf{X}_n \right] \right].$$

In addition, (37) and (38) ensure that

$$\lim_{n,m \to \infty} \lambda \sum_{x \in \mathcal{X}} V_{HT}(x) p_T^2(x) \mathbb{E} \left[ \frac{\mathbf{1}_{Z_n(x) \neq 0}}{\hat{p}_{R,n}(x)} \right] = \lambda V_{so}.$$

As an intermediary conclusion, if $\lambda \in [0, 1]$,

$$\lim_{n,m \to \infty} \min(n, m) \mathrm{Var} \left[ \hat{\tau}_{\pi,n,m} \right] = \mathrm{Var} \left[ \tau(X) \right] + \lambda V_{so} \quad (50)$$

**General conclusion:** It is possible to gather equations (49) and (50) in one single conclusion. Therefore, letting $\lim_{n,m \to \infty} m/n = \lambda \in [0, \infty]$, the asymptotic variance of estimated IPSW satisfies

$$\lim_{n,m \to \infty} \min(n, m) \mathrm{Var} \left[ \hat{\tau}_{\pi,n,m} \right] = \min(1, \lambda) \left( \frac{\mathrm{Var} \left[ \tau(X) \right]}{\lambda} + V_{so} \right).$$
### A.3.3 Proof of Theorem 3

*Proof.* For any estimate $\hat{\tau}$, we have

$$ \mathbb{E}[(\hat{\tau} - \tau)^2] = (\mathbb{E}[\hat{\tau}] - \tau)^2 + \text{Var}[\hat{\tau}]. $$

Therefore, the risk of the (estimated) IPSW estimate can be bounded using results from Subsection A.3.1 (or Proposition 2), and in particular the bounds on the variance and the bias,

$$ \begin{aligned} \mathbb{E}[(\hat{\tau} - \tau)^2] &\le (1 - \min_x p_R(x))^{2n} \mathbb{E}_T[\tau(X)^2] + \frac{\text{Var}_T[\tau(X)]}{m} + (1 - \min_x p_R(x))^{n/2} \left( \frac{4\mathbb{E}_T[\tau(X)^2]}{m} + \tau \right) \\ &\quad + \frac{2}{n+1} \left( \mathbb{E}_R \left[ \left( \frac{p_T(X)}{p_R(X)} \right)^2 V_{HT}(X) \right] + \frac{1}{m} \mathbb{E}_R \left[ \frac{p_T(X)(1-p_T(X))}{p_R(X)^2} V_{HT}(X) \right] \right) \\ &\le \frac{2V_{so}}{n+1} + \frac{\text{Var}_T[\tau(X)]}{m} + \frac{2}{m(n+1)} \mathbb{E}_R \left[ \frac{p_T(X)(1-p_T(X))}{p_R(X)^2} V_{HT}(X) \right] \\ &\quad + (1 - \min_x p_R(x))^{n/2} \left( 1 + \mathbb{E}_T[\tau(X)^2] + \frac{4\mathbb{E}_T[\tau(X)^2]}{m} \right). \end{aligned} $$

The $L^2$ consistency holds by letting $n$ and $m$ tend to infinity. $\square$

## A.4 Estimated IPSW with estimated $\hat{\pi}_n(x)$

### A.4.1 Proof of Proposition 3

*Proof. Bias*

We start by computing the bias of

$$ \begin{aligned} \mathbb{E}[\hat{\tau}_{n,m}] &= \mathbb{E}\left[\frac{1}{n}\sum_{i=1}^{n} \frac{\hat{p}_{T,m}(X_i)}{\hat{p}_{R,n}(X_i)} Y_i \left( \frac{A_i}{\hat{\pi}_n(X_i)} - \frac{1-A_i}{1-\hat{\pi}_n(X_i)} \right)\right] \\ &= \frac{1}{n}\mathbb{E}\left[\mathbb{E}\left[\sum_{x \in \mathcal{X}} \frac{\hat{p}_{T,m}(x)}{\hat{p}_{R,n}(x)} \sum_{i=1}^{n} 1_{X_i=x} Y_i \left( \frac{A_i}{\hat{\pi}_n(x)} - \frac{1-A_i}{1-\hat{\pi}_n(x)} \right) \mid \mathbf{X}_n, \mathbf{A}_n, \mathbf{Y}_n \right]\right] \\ &= \frac{1}{n}\mathbb{E}\left[\sum_{x \in \mathcal{X}} \frac{\mathbb{E}[\hat{p}_{T,m}(x) \mid \mathbf{X}_n, \mathbf{A}_n, \mathbf{Y}_n]}{\hat{p}_{R,n}(x)} \sum_{i=1}^{n} 1_{X_i=x} Y_i \left( \frac{A_i}{\hat{\pi}_n(x)} - \frac{1-A_i}{1-\hat{\pi}_n(x)} \right)\right] \\ &= \frac{1}{n}\mathbb{E}\left[\sum_{x \in \mathcal{X}} \frac{p_T(x)}{\hat{p}_{R,n}(x)} \sum_{i=1}^{n} 1_{X_i=x} Y_i \left( \frac{A_i}{\hat{\pi}_n(x)} - \frac{1-A_i}{1-\hat{\pi}_n(x)} \right)\right]. \end{aligned} $$

This derivation is possible as $\hat{p}_{T,m}$ is estimated on a different data set than the trial. Using SUTVA (Assumption 2), one can replace observed outcomes by potential outcomes, and

$$ \begin{aligned} \mathbb{E}[\hat{\tau}_{n,m}] &= \frac{1}{n} \mathbb{E} \left[ \sum_{x \in \mathcal{X}} \frac{p_T(x)}{\hat{p}_{R,n}(x)} \sum_{i=1}^{n} 1_{X_i=x} \left( \frac{Y_i^{(1)} A_i}{\hat{\pi}_n(x)} - \frac{Y_i^{(0)}(1-A_i)}{1-\hat{\pi}_n(x)} \right) \right] \\ &= \frac{1}{n} \mathbb{E} \left[ \sum_{x \in \mathcal{X}} \frac{p_T(x)}{\hat{p}_{R,n}(x)} \sum_{i=1}^{n} 1_{X_i=x} \mathbb{E} \left[ \left( \frac{Y_i^{(1)} A_i}{\hat{\pi}_n(x)} - \frac{Y_i^{(0)}(1-A_i)}{1-\hat{\pi}_n(x)} \right) \mid \mathbf{X}_n, \mathbf{Y}_n^{(1)}, \mathbf{Y}_n^{(0)} \right] \right]. \end{aligned} $$

Let us consider, for any fixed $x \in \mathcal{X}$,

$$ \mathbb{E} \left[ \frac{Y_i^{(1)} A_i}{\hat{\pi}_n(x)} \mid \mathbf{X}_n, \mathbf{Y}_n^{(1)}, \mathbf{Y}_n^{(0)} \right] = Y_i^{(1)} \mathbb{E} \left[ \frac{A_i}{\hat{\pi}_n(x)} \mid \mathbf{X}_n \right]. $$
Up to reordering the $X_i$'s, we have

$$ 
\begin{aligned}
\mathbb{E} \left[ \frac{A_i}{\hat{\pi}_n(x)} | \mathbf{X}_n \right] &= \mathbb{E} \left[ \frac{A_i}{\frac{\sum_{j=1}^{Z_n(x)} A_j}{Z_n(x)}} | \mathbf{X}_n \right] \\
&= Z_n(x) \mathbb{E} \left[ \frac{A_i}{\sum_{j=1}^{Z_n(x)} A_j} | \mathbf{X}_n \right] \\
&= Z_n(x) \pi(x) \mathbb{E} \left[ \frac{1}{1 + \sum_{j=2}^{Z_n(x)} A_j} | \mathbf{X}_n \right].
\end{aligned}
$$

The last rows uses the law of total probability. According to Lemma 11 (i) in Biau (2012), and considering $B_n(x) \sim \mathfrak{B}(n, p)$, for any $x \in \mathcal{X}$,

$$ \mathbb{E} \left[ \frac{1}{1 + B_n(x)} \right] = \frac{1}{(n+1)p} - \frac{(1-p)^{n+1}}{(n+1)p}. $$

Since, conditional on $\mathbf{X}_n$, $\sum_{j=2}^{Z_n(x)} A_j$ is distributed as $\mathfrak{B}(Z_n(x) - 1, \pi(x))$,

$$ 
\begin{aligned}
\mathbb{E} \left[ \frac{A_i}{\hat{\pi}_n(x)} | \mathbf{X}_n \right] &= Z_n(x) \pi(x) \left( \frac{1}{Z_n(x) \pi(x)} - \frac{(1 - \pi(x))^{Z_n(x)}}{Z_n(x) \pi(x)} \right) \\
&= 1 - (1 - \pi(x))^{Z_n(x)}.
\end{aligned}
$$

Similarly,

$$ \mathbb{E} \left[ \frac{(1 - A_i)}{1 - \hat{\pi}_n(x)} | \mathbf{X}_n \right] = 1 - \pi(x)^{Z_n(x)}. $$

Consequently,

$$ 
\begin{aligned}
\mathbb{E} \left[ \left( \frac{Y_i^{(1)} A_i}{\hat{\pi}_n(x)} - \frac{Y_i^{(0)} (1 - A_i)}{1 - \hat{\pi}_n(x)} \right) | \mathbf{X}_n, \mathbf{Y}_n^{(1)}, \mathbf{Y}_n^{(0)} \right] &= Y_i^{(1)} (1 - (1 - \pi(x))^{Z_n(x)}) - Y_i^{(0)} (1 - \pi(x)^{Z_n(x)}) \\
&= (Y_i^{(1)} - Y_i^{(0)}) - Y_i^{(1)} (1 - \pi(x))^{Z_n(x)} + Y_i^{(0)} \pi(x)^{Z_n(x)}.
\end{aligned}
$$

Therefore,

$$ \mathbb{E}[\hat{\tau}_{n,m}] = \frac{1}{n} \mathbb{E} \left[ \sum_{x \in \mathcal{X}} \frac{p_{\mathrm{T}}(x)}{\hat{p}_{\mathrm{R},n}(x)} \sum_{i=1}^{n} 1_{X_i=x} (Y_i^{(1)} - Y_i^{(0)}) \right] \quad (51) $$

$$ + \frac{1}{n} \mathbb{E} \left[ \sum_{x \in \mathcal{X}} \frac{p_{\mathrm{T}}(x)}{\hat{p}_{\mathrm{R},n}(x)} \sum_{i=1}^{n} 1_{X_i=x} Y_i^{(0)} \pi(x)^{Z_n(x)} \right] \quad (52) $$

$$ - \frac{1}{n} \mathbb{E} \left[ \sum_{x \in \mathcal{X}} \frac{p_{\mathrm{T}}(x)}{\hat{p}_{\mathrm{R},n}(x)} \sum_{i=1}^{n} 1_{X_i=x} Y_i^{(1)} (1 - \pi(x))^{Z_n(x)} \right]. \quad (53) $$

On one hand, considering (51),

$$ 
\begin{aligned}
\frac{1}{n} \mathbb{E} \left[ \sum_{x \in \mathcal{X}} \frac{p_{\mathrm{T}}(x)}{\hat{p}_{\mathrm{R},n}(x)} \sum_{i=1}^{n} 1_{X_i=x} (Y_i^{(1)} - Y_i^{(0)}) \right] &= \frac{1}{n} \sum_{x \in \mathcal{X}} \mathbb{E} \left[ \frac{p_{\mathrm{T}}(x)}{\hat{p}_{\mathrm{R},n}(x)} \sum_{i=1}^{n} 1_{X_i=x} (Y_i^{(1)} - Y_i^{(0)}) \right] \\
&= \sum_{x \in \mathcal{X}} \mathbb{E} \left[ p_{\mathrm{T}}(x) 1_{Z_n(x)>0} \tau(x) \right],
\end{aligned}
$$

corresponding to the bias in the semi-oracle and the estimated IPSW. Indeed, we recall from the semi-oracle IPSW proof that,

$$ \sum_{x \in \mathcal{X}} \mathbb{E} [p_{\mathrm{T}}(x) 1_{Z_n(x)>0} \tau(x)] = \sum_{x \in \mathcal{X}} p_{\mathrm{T}}(x) (1 - (1 - p_{\mathrm{R}}(x))^n) \tau(x). $$

On the other hand, considering (52),
$$
\begin{aligned}
\frac{1}{n} \mathbb{E} \left[ \sum_{x \in \mathcal{X}} \frac{p_T(x)}{\hat{p}_{R,n}(x)} \sum_{i=1}^{n} \mathbb{1}_{X_i=x} Y_i^{(0)} \pi(x)^{Z_n(x)} \right] &= \frac{1}{n} \mathbb{E} \left[ \sum_{x \in \mathcal{X}} \frac{p_T(x)}{\hat{p}_{R,n}(x)} \sum_{i=1}^{n} \mathbb{1}_{X_i=x} \mathbb{E} \left[ Y_i^{(0)} \mid X_i=x \right] \pi(x)^{Z_n(x)} \right] \\
&= \mathbb{E} \left[ \sum_{x \in \mathcal{X}} p_T(x) \mathbb{1}_{Z_n(x)>0} \mathbb{E} \left[ Y_i^{(0)} \mid X_i=x \right] \pi(x)^{Z_n(x)} \right] \\
&= \sum_{x \in \mathcal{X}} p_T(x) \mathbb{E} \left[ Y_i^{(0)} \mid X_i=x \right] \mathbb{E} \left[ \mathbb{1}_{Z_n(x)>0} \pi(x)^{Z_n(x)} \right] \\
&= \sum_{x \in \mathcal{X}} p_T(x) \mathbb{E} \left[ Y_i^{(0)} \mid X_i=x \right] \mathbb{E} \left[ (1-\mathbb{1}_{Z_n(x)=0}) \pi(x)^{Z_n(x)} \right] \\
&= \sum_{x \in \mathcal{X}} p_T(x) \mathbb{E} \left[ Y_i^{(0)} \mid X_i=x \right] \left( \mathbb{E} \left[ \pi(x)^{Z_n(x)} \right] - \mathbb{E} \left[ \mathbb{1}_{Z_n(x)=0} \right] \right).
\end{aligned}
$$

Now, note that $\mathbb{P}[Z_n(x) = 0] = (1 - p_R(x))^n$ and

$$
\begin{aligned}
\mathbb{E} [\pi(x)^{Z_n(x)}] &= \prod_{j=1}^{n} \mathbb{E} [\pi(x)^{\mathbb{1}_{X_i=x}}] \\
&= (\pi(x)p_R(x) + (1 - p_R(x)))^n. \\
&= (1 - p_R(x)(1 - \pi(x)))^n.
\end{aligned}
$$

Therefore,

$$
\frac{1}{n} \mathbb{E} \left[ \sum_{x \in \mathcal{X}} \frac{p_T(x)}{\hat{p}_{R,n}(x)} \sum_{i=1}^{n} \mathbb{1}_{X_i=x} Y_i^{(0)} \pi(x)^{Z_n(x)} \right] = \sum_{x \in \mathcal{X}} p_T(x) \mathbb{E} \left[ Y_i^{(0)} \mid X_i=x \right] \left( (1-p_R(x)(1-\pi(x)))^n - (1-p_R(x))^n \right).
$$

Similarly, considering (53),

$$
-\frac{1}{n}\mathbb{E}\left[\sum_{x \in \mathcal{X}} \frac{p_{\mathrm{T}}(x)}{\hat{p}_{\mathrm{R},n}(x)} \sum_{i=1}^{n} \mathbb{1}_{X_i=x} Y_i^{(1)} (1-\pi)^{Z_n(x)}\right] = -\sum_{x \in \mathcal{X}} p_{\mathrm{T}}(x) \mathbb{E}\left[Y_i^{(1)} \mid X_i=x\right] \left((1-p_{\mathrm{R}}(x)\pi(x))^n - (1-p_{\mathrm{R}}(x))^n\right).
$$

Finally, the bias of the estimated IPSW with estimated treatment proportion is given by

$$
\begin{aligned}
\mathbb{E}[\hat{\tau}_{n,m}] - \tau &= - \sum_{x \in \mathcal{X}} p_T(x) \tau(x) (1 - p_R(x))^n \\
&\quad + \sum_{x \in \mathcal{X}} p_T(x) \left( \mathbb{E}[Y_i^{(1)} | X_i = x] - \mathbb{E}[Y_i^{(0)} | X_i = x] \right) (1 - p_R(x))^n \\
&\quad + \sum_{x \in \mathcal{X}} p_T(x) \mathbb{E}[Y_i^{(0)} | X_i = x] (1 - p_R(x)(1 - \pi(x)))^n \\
&\quad - \sum_{x \in \mathcal{X}} p_T(x) \mathbb{E}[Y_i^{(1)} | X_i = x] (1 - p_R(x)\pi(x))^n,
\end{aligned}
$$

such that,

$$
\begin{aligned}
\mathbb{E}[\hat{\tau}_{n,m}] - \tau = & \sum_{x \in \mathcal{X}} p_T(x) \mathbb{E}[Y_i^{(0)} | X_i = x] (1 - p_R(x)(1 - \pi(x)))^n \\
& - \sum_{x \in \mathcal{X}} p_T(x) \mathbb{E}[Y_i^{(1)} | X_i = x] (1 - p_R(x)\pi(x))^n.
\end{aligned}
$$

Variance

As above, we have

$$
\mathrm{Var}[\hat{\tau}_{n,m}] = \mathrm{Var}[\mathbb{E}[\hat{\tau}_{n,m} | \mathbf{X}_{m+n}]] + \mathbb{E}[\mathrm{Var}[\hat{\tau}_{n,m} | \mathbf{X}_{m+n}]]. \quad (54)
$$
Let us examine the first term. We have

$$
\begin{align*}
\mathbb{E}[\hat{\tau}_{n,m} | \mathbf{X}_{m+n}] &= \mathbb{E}\left[\frac{1}{n} \sum_{i=1}^{n} \frac{\hat{p}_{\mathrm{T},m}(X_i)}{\hat{p}_{\mathrm{R},n}(X_i)} Y_i \left(\frac{A_i}{\hat{\pi}_n(X_i)} - \frac{1-A_i}{1-\hat{\pi}_n(X_i)}\right) | \mathbf{X}_{m+n}\right] \\
&= \frac{1}{n} \sum_{i=1}^{n} \frac{\hat{p}_{\mathrm{T},m}(X_i)}{\hat{p}_{\mathrm{R},n}(X_i)} \mathbb{E}\left[\frac{Y_i^{(1)} A_i}{\hat{\pi}_n(X_i)} - \frac{Y_i^{(0)}(1-A_i)}{1-\hat{\pi}_n(X_i)} \middle| \mathbf{X}_{m+n}\right] \\
&= \frac{1}{n} \sum_{i=1}^{n} \frac{\hat{p}_{\mathrm{T},m}(X_i)}{\hat{p}_{\mathrm{R},n}(X_i)} \mathbb{E}\left[\mathbb{E}\left[\frac{Y_i^{(1)} A_i}{\hat{\pi}_n(X_i)} - \frac{Y_i^{(0)}(1-A_i)}{1-\hat{\pi}_n(X_i)} \middle| \mathbf{X}_{m+n}, \mathbf{Y}_n^{(1)}, \mathbf{Y}_n^{(0)}\right] \middle| \mathbf{X}_{m+n}\right].
\end{align*}
$$

A similar computation as the one used in the derivation of the bias above shows that

$$
\mathbb{E} \left[ \frac{Y_i^{(1)} A_i}{\hat{\pi}_n(X_i)} - \frac{Y_i^{(0)}(1-A_i)}{1-\hat{\pi}_n(X_i)} \middle| \mathbf{X}_{m+n}, \mathbf{Y}_n^{(1)}, \mathbf{Y}_n^{(0)} \right] = (Y_i^{(1)} - Y_i^{(0)}) - Y_i^{(1)}(1-\pi(X_i))^{Z_n(X_i)} + Y_i^{(0)}\pi(X_i)^{Z_n(X_i)}
$$

which leads to

$$
\begin{align*}
\mathbb{E}[\hat{\tau}_{n,m} | \mathbf{X}_{m+n}] &= \frac{1}{n} \sum_{i=1}^{n} \frac{\hat{p}_{\mathrm{T},m}(X_i)}{\hat{p}_{\mathrm{R},n}(X_i)} \mathbb{E} \left[ (Y_i^{(1)} - Y_i^{(0)}) - Y_i^{(1)}(1-\pi(X_i))^{Z_n(X_i)} + Y_i^{(0)}\pi(X_i)^{Z_n(X_i)} \middle| \mathbf{X}_{m+n} \right] \\
&= \frac{1}{n} \sum_{i=1}^{n} \frac{\hat{p}_{\mathrm{T},m}(X_i)}{\hat{p}_{\mathrm{R},n}(X_i)} \left( \tau(X_i) - \mathbb{E}[Y_i^{(1)} | X_i] (1-\pi(X_i))^{Z_n(X_i)} + \mathbb{E}[Y_i^{(0)} | X_i] \pi(X_i)^{Z_n(X_i)} \right).
\end{align*}
$$

Rewriting the previous sum yields

$$
\begin{align*}
\mathbb{E}[\hat{\tau}_{n,m} | \mathbf{X}_{m+n}] &= \frac{1}{n} \sum_{x \in \mathcal{X}} \sum_{i=1}^{n} \mathbb{1}_{X_i=x} \frac{\hat{p}_{\mathrm{T},m}(X_i)}{\hat{p}_{\mathrm{R},n}(X_i)} \left( \tau(X_i) - \mathbb{E}[Y_i^{(1)} | X_i] (1-\pi(X_i))^{Z_n(X_i)} + \mathbb{E}[Y_i^{(0)} | X_i] \pi(X_i)^{Z_n(X_i)} \right) \\
&= \sum_{x \in \mathcal{X}} \hat{p}_{\mathrm{T},m}(x) \left( \tau(x) - \mathbb{E}[Y_i^{(1)} | X_i = x] (1-\pi(x))^{Z_n(x)} + \mathbb{E}[Y_i^{(0)} | X_i = x] \pi(x)^{Z_n(x)} \right) \\
&= \frac{1}{m} \sum_{i=n+1}^{n+m} U_n(X_i),
\end{align*}
$$

where

$$
U_n(X_i) := \left( \tau(X_i) - \mathbb{E}[Y_i^{(1)} | X_i] (1 - \pi(X_i))^{Z_n(X_i)} + \mathbb{E}[Y_i^{(0)} | X_i] \pi(X_i)^{Z_n(X_i)} \right).
$$

By the law of total variance,

$$
\begin{align*}
\operatorname{Var}[\mathbb{E}[\hat{\tau}_{n,m} | \mathbf{X}_{m+n}]]
&= \operatorname{Var}\left[\frac{1}{m} \sum_{i=n+1}^{n+m} U_n(X_i)\right] \\
&= \mathbb{E}\left[\operatorname{Var}\left[\frac{1}{m} \sum_{i=n+1}^{n+m} U_n(X_i) | \mathbf{X}_n\right]\right] + \operatorname{Var}\left[\mathbb{E}\left[\frac{1}{m} \sum_{i=n+1}^{n+m} U_n(X_i) | \mathbf{X}_n\right]\right] \\
&= \frac{1}{m} \mathbb{E}\left[\operatorname{Var}[U_n(X) | \mathbf{X}_n]\right] + \operatorname{Var}\left[\mathbb{E}[U_n(X) | \mathbf{X}_n]\right] \\
&= \frac{1}{m} \operatorname{Var}[U_n(X)] + \left(1 - \frac{1}{m}\right) \operatorname{Var}[\mathbb{E}[U_n(X) | \mathbf{X}_n]]
\end{align*}
$$

where the last line comes from the law of total variance applied to $\operatorname{Var}[U_n(X)]$. Since

$$
\begin{align*}
\operatorname{Var}[\mathbb{E}[U_n(X)|\mathbf{X}_n]]
&= \operatorname{Var}\left[\mathbb{E}\left[(\tau(X) - \mathbb{E}[Y^{(1)}|X](1-\pi(X))^{Z_n(X)} + \mathbb{E}[Y^{(0)}|X]\pi(X)^{Z_n(X)})|\mathbf{X}_n\right]\right] \\
&= \operatorname{Var}\left[\mathbb{E}\left[\mathbb{E}[Y^{(0)}|X]\pi(X)^{Z_n(X)} - \mathbb{E}[Y^{(1)}|X](1-\pi(X))^{Z_n(X)}|\mathbf{X}_n\right]\right],
\end{align*}
$$

as the only source of randomness comes from $Z_n(X)$ (and not from $\tau(X)$), we have

$$
\operatorname{Var}[\mathbb{E}[\hat{\tau}_{n,m} | \mathbf{X}_{m+n}]] = \frac{1}{m} \operatorname{Var}[\tau(X) - C_n(X)] + \left(1 - \frac{1}{m}\right) \operatorname{Var}[\mathbb{E}[C_n(X)|\mathbf{X}_n]], \quad (55)
$$
where

$$C_n(X) = \mathbb{E}[Y^{(1)} | X] (1 - \pi(X))^{Z_n(X)} - \mathbb{E}[Y^{(0)} | X] \pi(X)^{Z_n(X)}.$$

Regarding the other term, and first re-writing $\hat{\tau}_{n,m}$,

$$\begin{aligned}
\hat{\tau}_{n,m} &= \frac{1}{n} \sum_{i=1}^{n} \frac{\hat{p}_{\mathrm{T},m}(X_i)}{\hat{p}_{\mathrm{R},n}(X_i)} \left( \frac{A_i Y_i^{(1)}}{\hat{\pi}_n(X_i)} - \frac{(1-A_i)Y_i^{(0)}}{1-\hat{\pi}_n(X_i)} \right) \\
&= \sum_{i=1}^{n} \frac{\hat{p}_{\mathrm{T},m}(X_i)}{Z_n(X_i)} \left( \frac{A_i Y_i^{(1)}}{\hat{\pi}_n(X_i)} - \frac{(1-A_i)Y_i^{(0)}}{1-\hat{\pi}_n(X_i)} \right) \\
&= \sum_{x \in \mathcal{X}} \frac{\hat{p}_{\mathrm{T},m}(x)}{Z_n(x)} \sum_{i=1}^{n} 1_{X_i=x} \left( \frac{A_i Y_i^{(1)}}{\hat{\pi}_n(x)} - \frac{(1-A_i)Y_i^{(0)}}{1-\hat{\pi}_n(x)} \right).
\end{aligned}$$

Hence,

$$\begin{aligned}
& \mathrm{Var}[\hat{\tau}_{n,m} | \mathbf{X}_{n+m}] \\
&= \mathrm{Var} \left[ \sum_{x \in \mathcal{X}} \frac{\hat{p}_{\mathrm{T},m}(x)}{Z_n(x)} \sum_{i=1}^{n} 1_{X_i=x} \left( \frac{A_i Y_i^{(1)}}{\hat{\pi}_n(x)} - \frac{(1-A_i)Y_i^{(0)}}{1-\hat{\pi}_n(x)} \right) | \mathbf{X}_{n+m} \right] \\
&= \sum_{x \in \mathcal{X}} (\hat{p}_{\mathrm{T},m}(x))^2 \mathrm{Var} \left[ \frac{1}{Z_n(x)} \sum_{i=1}^{n} 1_{X_i=x} \left( \frac{A_i Y_i^{(1)}}{\hat{\pi}_n(x)} - \frac{(1-A_i)Y_i^{(0)}}{1-\hat{\pi}_n(x)} \right) | \mathbf{X}_{n+m} \right] \\
&\quad + \sum_{x,y \in \mathcal{X}, x \neq y} \mathrm{Cov} \left[ \frac{\hat{p}_{\mathrm{T},m}(x)}{Z_n(x)} \sum_{i=1}^{n} 1_{X_i=x} \left( \frac{A_i Y_i^{(1)}}{\hat{\pi}_n(x)} - \frac{(1-A_i)Y_i^{(0)}}{1-\hat{\pi}_n(x)} \right), \frac{\hat{p}_{\mathrm{T},m}(y)}{Z_n(y)} \sum_{j=1}^{n} 1_{X_j=y} \left( \frac{A_j Y_j^{(1)}}{\hat{\pi}_n(y)} - \frac{(1-A_j)Y_j^{(0)}}{1-\hat{\pi}_n(y)} \right) | \mathbf{X}_{n+m} \right].
\end{aligned}$$

Note that the term

$$\mathrm{Var} \left[ \frac{1}{Z_n(x)} \sum_{i=1}^{n} 1_{X_i=x} \left( \frac{A_i Y_i^{(1)}}{\hat{\pi}_n(x)} - \frac{(1-A_i)Y_i^{(0)}}{1-\hat{\pi}_n(x)} \right) | \mathbf{X}_{n+m} \right]$$

corresponds to the variance of the difference-in-means estimator on the strata $X = x$ (where $n$ is replaced by $Z_n(x)$) and therefore equals

$$V_{\mathrm{DM},n}(x) \mathbf{1}_{Z_n(x)>0}/Z_n(x),$$

where (see Lemma 2),

$$V_{\mathrm{DM}}(x) = \left( \mathbb{E} \left[ \frac{1}{\hat{\pi}} \middle| \hat{\pi} > 0 \right] \mathrm{Var} \left[ Y_i^{(1)} \right] + \mathbb{E} \left[ \frac{1}{1-\hat{\pi}} \middle| \hat{\pi} > 0 \right] \mathrm{Var} \left[ Y_i^{(0)} \right] \right) + \mathcal{O} \left( Z_n(x) \max(\pi, 1-\pi)^n \right).$$

Consequently,

$$\begin{aligned}
& \mathrm{Var}[\hat{\tau}_{n,m} | \mathbf{X}_{n+m}] \\
&= \sum_{x \in \mathcal{X}} \frac{(\hat{p}_{\mathrm{T},m}(x))^2 V_{\mathrm{DM},n}(x) \mathbf{1}_{Z_n(x)>0}}{Z_n(x)} \\
&\quad + \sum_{x,y \in \mathcal{X}, x \neq y} \frac{\hat{p}_{\mathrm{T},m}(x) \hat{p}_{\mathrm{T},m}(y)}{Z_n(x) Z_n(y)} \sum_{i,j} 1_{X_i=x} 1_{X_j=y} \mathrm{Cov} \left[ \left( \frac{A_i Y_i^{(1)}}{\hat{\pi}_n(x)} - \frac{(1-A_i)Y_i^{(0)}}{1-\hat{\pi}_n(x)} \right) \cdot \left( \frac{A_j Y_j^{(1)}}{\hat{\pi}_n(y)} - \frac{(1-A_j)Y_j^{(0)}}{1-\hat{\pi}_n(y)} \right) \middle| \mathbf{X}_{n+m} \right].
\end{aligned}$$

Note that for $x \neq y$, $\hat{\pi}_n(x) \perp \hat{\pi}_n(y)$. Consequently, for $i \neq j$,

$$\left( \frac{A_i Y_i^{(1)}}{\hat{\pi}_n(x)} - \frac{(1-A_i)Y_i^{(0)}}{1-\hat{\pi}_n(x)} \right) \perp \left( \frac{A_j Y_j^{(1)}}{\hat{\pi}_n(x)} - \frac{(1-A_j)Y_j^{(0)}}{1-\hat{\pi}_n(x)} \right).$$

Consequently,

$$\mathrm{Var}[\hat{\tau}_{n,m} | \mathbf{X}_{n+m}] = \sum_{x \in \mathcal{X}} \frac{(\hat{p}_{\mathrm{T},m}(x))^2 V_{\mathrm{DM},n}(x) \mathbf{1}_{Z_n(x)>0}}{Z_n(x)},$$
and, taking the expectation with respect to $\mathbf{X}_{n+m}$, we have

$$ 
\begin{aligned}
\mathbb{E}[\mathrm{Var}[\hat{\tau}_{n,m} | \mathbf{X}_{n+m}]] &= \sum_{x \in \mathcal{X}} \mathbb{E}[(\hat{p}_{T,m}(x))^2] \mathbb{E}\left[\frac{1_{Z_n(x)>0}}{Z_n(x)}\right] V_{\mathrm{DM},n}(x) \\
&= \sum_{x \in \mathcal{X}} \left(\frac{p_T(x)(1-p_T(x))}{m} + p_T^2(x)\right) \mathbb{E}\left[\frac{1_{Z_n(x)>0}}{Z_n(x)}\right] V_{\mathrm{DM},n}(x).
\end{aligned}
\quad (56) $$

Gathering (55) and (56), we finally obtain,

$$ 
\begin{aligned}
\mathrm{Var}[\hat{\tau}_{n,m}] &= \frac{1}{m} \mathrm{Var}[\tau(X) - C_n(X)] + \left(1 - \frac{1}{m}\right) \mathrm{Var}[\mathbb{E}[C_n(X)|\mathbf{X}_n]] \\
&\quad + \sum_{x \in \mathcal{X}} \left(\frac{p_T(x)(1-p_T(x))}{m} + p_T^2(x)\right) \mathbb{E}\left[\frac{1_{Z_n(x)>0}}{Z_n(x)}\right] V_{\mathrm{DM},n}(x),
\end{aligned}
$$

where

$$ C_n(X) = \mathbb{E}[Y^{(1)} | X] (1 - \pi(X))^{Z_n(X)} - \mathbb{E}[Y^{(0)} | X] \pi(X)^{Z_n(X)}. $$

Note that, by Jensen's inequality,

$$ 
\begin{aligned}
\mathrm{Var}[\mathbb{E}[C_n(X)|\mathbf{X}_n]] & \\
&\le \mathbb{E}[C_n(X)^2] \\
&\le 2\mathbb{E}\left[\mathbb{E}[Y^{(1)} | X]^2 (1 - \pi(X))^{2Z_n(X)}\right] + 2\mathbb{E}\left[\mathbb{E}[Y^{(0)} | X]^2 \pi(X)^{2Z_n(X)}\right] \\
&\le 2\mathbb{E}\left[\mathbb{E}[Y^{(1)} | X]^2 \mathbb{E}\left[(1 - \pi(X))^{2Z_n(X)} | X\right]\right] + 2\mathbb{E}\left[\mathbb{E}[Y^{(0)} | X]^2 \mathbb{E}\left[\pi(X)^{2Z_n(X)} | X\right]\right] \\
&\le 2\mathbb{E}\left[\mathbb{E}[Y^{(1)} | X]^2 (1 - (1 - \pi(X)^2) p_R(X))^n\right] + 2\mathbb{E}\left[\mathbb{E}[Y^{(0)} | X]^2 (1 - (1 - (1 - \pi(X))^2) p_R(X))^n\right] \\
&\le 2 \left(1 - \min_x \left((1 - \tilde{\pi}(x)^2) p_R(x)\right)\right)^n \mathbb{E}\left[(Y^{(1)})^2 + (Y^{(0)})^2\right],
\end{aligned}
$$

where $\tilde{\pi}(x) = \max(\pi(x), 1 - \pi(x))$, and we have used the fact that

$$ 
\begin{aligned}
\mathbb{E}[\pi(X)^{2Z_n(X)} | X] &= (\pi(X)^2 p_R(X) + 1 - p_R(X))^n \\
&= (1 - (1 - \pi(X)^2) p_R(X))^n.
\end{aligned}
$$

Besides, we have

$$ \mathrm{Var}[\tau(X) - C_n(X)] \le \mathrm{Var}_T[\tau(X)] + 2(\mathrm{Var}_T[\tau(X)] \mathrm{Var}_T[C_n(X)])^{1/2} + \mathrm{Var}_T[C_n(X)], $$

where

$$ 
\begin{aligned}
\mathrm{Var}_T[C_n(X)] &\le \mathbb{E}[C_n(X)^2] \\
&\le 2 \left(1 - \min_x \left((1 - \tilde{\pi}(x)^2) p_R(x)\right)\right)^n \mathbb{E}\left[(Y^{(1)})^2 + (Y^{(0)})^2\right].
\end{aligned}
$$

Consequently,

$$ 
\begin{aligned}
\mathrm{Var}[\tau(X) - C_n(X)] &\le \mathrm{Var}_T[\tau(X)] + 4 \left(1 - \min_x \left((1 - \tilde{\pi}(x)^2) p_R(x)\right)\right)^{n/2} \mathbb{E}\left[(Y^{(1)})^2 + (Y^{(0)})^2\right] \\
&\quad + 2 \left(1 - \min_x \left((1 - \tilde{\pi}(x)^2) p_R(x)\right)\right)^n \mathbb{E}\left[(Y^{(1)})^2 + (Y^{(0)})^2\right] \\
&\le \mathrm{Var}_T[\tau(X)] + 6 \left(1 - \min_x \left((1 - \tilde{\pi}(x)^2) p_R(x)\right)\right)^{n/2} \mathbb{E}\left[(Y^{(1)})^2 + (Y^{(0)})^2\right].
\end{aligned}
$$

Finally,

$$ 
\begin{aligned}
\mathrm{Var}[\hat{\tau}_{n,m}] &\le \frac{2}{n+1} \mathbb{E}_R \left[ \left( \frac{p_T(X)}{p_R(X)} \right)^2 V_{\mathrm{DM}}(X) \right] + \frac{\mathrm{Var}[\tau(X)]}{m} + \frac{2}{(n+1)m} \mathbb{E}_R \left[ \frac{p_T(X)(1-p_T(X))}{p_R(X)^2} V_{\mathrm{DM},n}(X) \right] \\
&\quad + 2 \left(1 + \frac{3}{m}\right) \left(1 - \min_x \left((1 - \tilde{\pi}(x)^2) p_R(x)\right)\right)^{n/2} \mathbb{E}\left[(Y^{(1)})^2 + (Y^{(0)})^2\right].
\end{aligned}
$$

□
### A.4.2 Proof of Corollary 3

*Proof.* The proof follows exactly the same structure as that of the proof of Corollary 2.

*Proof.* We recall the explicit expression of the variance of $\hat{\tau}_{n,m}$,

$$ 
\begin{aligned}
\mathrm{Var}[\hat{\tau}_{n,m}] \\
&= \frac{1}{m} \mathrm{Var}[\tau(X) - C_n(X)] + \left(1 - \frac{1}{m}\right) \mathrm{Var}[\mathbb{E}[C_n(X)|\mathbf{X}_n]] \\
&\quad + \sum_{x \in \mathcal{X}} \left( \frac{p_{\mathrm{T}}(x)(1 - p_{\mathrm{T}}(x))}{m} + p_{\mathrm{T}}^2(x) \right) \mathbb{E}\left[ \frac{1_{Z_n(x)>0}}{Z_n(x)} \right] V_{\mathrm{DM}}(x),
\end{aligned}
$$

where

$$ C_n(X) = \mathbb{E}[Y^{(1)} | X] (1 - \pi(X))^{Z_n(X)} - \mathbb{E}[Y^{(0)} | X] \pi(X)^{Z_n(X)}. $$

Recall that using (37) and (38), one has

$$ \lim_{n \to \infty} \mathbb{E} \left[ \frac{1_{Z_n(x)>0}}{Z_n(x)/n} \right] = \frac{1}{p_R(x)}, $$

and we also have

$$ \lim_{n \to \infty} \mathrm{Var}_{\mathrm{T}}[\tau(X) - C_n(X)] = \mathrm{Var}_{\mathrm{T}}[\tau(X)] = \mathrm{Var}[\tau(X)]. $$

Finally, note that the term $\mathrm{Var}[\mathbb{E}[C_n(X)|\mathbf{X}_n]]$ can be bounded by a term proportional to $(1 - \min(\pi, 1 - \pi))^n$, so that the convergence toward 0 it at an exponential pace with $n$.

Multiplying the explicit variance by $\min(n, m)$ one has,

$$ 
\begin{aligned}
\min(n, m) \mathrm{Var}[\hat{\tau}_{n,m}] \\
&= \frac{\min(n, m)}{m} \mathrm{Var}[\tau(X) - C_n(X)] + \min(n, m) \left(1 - \frac{1}{m}\right) \mathrm{Var}[\mathbb{E}[C_n(X)|\mathbf{X}_n]] \\
&\quad + \frac{\min(n, m)}{n} \sum_{x \in \mathcal{X}} \left( \frac{p_{\mathrm{T}}(x)(1 - p_{\mathrm{T}}(x))}{m} + p_{\mathrm{T}}^2(x) \right) \mathbb{E}\left[ \frac{1_{Z_n(x)>0}}{Z_n(x)/n} \right] V_{\mathrm{DM}}(x).
\end{aligned}
$$

Now, we study an asymptotic regime where $n$ and $m$ can grow toward infinity but at different paces. Let $\lim_{n,m \to \infty} \frac{m}{n} = \lambda \in [0, \infty]$, where $\lambda$ characterizes the regime.

**Case 1:** If $\lambda \in [1, \infty]$, one can replace $\min(n, m)$ by $n$, so that

$$ 
\begin{aligned}
\min(n, m) \mathrm{Var}[\hat{\tau}_{n,m}] &= n \mathrm{Var}[\hat{\tau}_{n,m}] \\
&= \frac{1}{\lambda} \mathrm{Var}[\tau(X) - C_n(X)] + \left(n - \frac{1}{\lambda}\right) \mathrm{Var}[\mathbb{E}[C_n(X)|\mathbf{X}_n]] \\
&\quad + \sum_{x \in \mathcal{X}} \left( \frac{p_{\mathrm{T}}(x)(1 - p_{\mathrm{T}}(x))}{m} + p_{\mathrm{T}}^2(x) \right) \mathbb{E}\left[ \frac{1_{Z_n(x)>0}}{Z_n(x)} \right] V_{\mathrm{DM}}(x),
\end{aligned}
$$

such that

$$ \lim_{n,m \to \infty} n \mathrm{Var}[\hat{\tau}_{n,m}] = \frac{\mathrm{Var}[\tau(X)]}{\lambda} + \tilde{V}_{so}, $$

where

$$ \tilde{V}_{so} := \mathbb{E}_{\mathrm{R}} \left[ \left( \frac{p_{\mathrm{T}}(X)}{p_{\mathrm{R}}(X)} \right)^2 V_{\mathrm{DM}, \infty}(X) \right]. $$

**Case 2:** If $\lambda \in [0, 1]$, one can replace $\min(n, m)$ by $m$, so that,

$$ 
\begin{aligned}
\min(n, m) \mathrm{Var}[\hat{\tau}_{n,m}] &= m \mathrm{Var}[\hat{\tau}_{n,m}] \\
&= \mathrm{Var}[\tau(X) - C_n(X)] + m \left(1 - \frac{1}{m}\right) \mathrm{Var}[\mathbb{E}[C_n(X)|\mathbf{X}_n]] \\
&\quad + \lambda \sum_{x \in \mathcal{X}} \left( \frac{p_{\mathrm{T}}(x)(1 - p_{\mathrm{T}}(x))}{m} + p_{\mathrm{T}}^2(x) \right) \mathbb{E}\left[ \frac{1_{Z_n(x)>0}}{Z_n(x)/n} \right] V_{\mathrm{DM}}(x).
\end{aligned}
$$
Because $m \le n$, then

$$m \left(1 - \frac{1}{m}\right) \mathrm{Var} \left[ \mathbb{E} \left[ C_n(X) | \mathbf{X}_n \right] \right] \le n \left(1 - \frac{1}{m}\right) \mathrm{Var} \left[ \mathbb{E} \left[ C_n(X) | \mathbf{X}_n \right] \right],$$

so that

$$\lim_{n,m \to \infty} m \left(1 - \frac{1}{m}\right) \mathrm{Var} \left[ \mathbb{E} \left[ C_n(X) | \mathbf{X}_n \right] \right] \le \lim_{n,m \to \infty} n \left(1 - \frac{1}{m}\right) \mathrm{Var} \left[ \mathbb{E} \left[ C_n(X) | \mathbf{X}_n \right] \right] = 0.$$

Finally,

$$\lim_{n,m \to \infty} m \mathrm{Var} \left[ \hat{\tau}_{n,m} \right] = \mathrm{Var} \left[ \tau(X) \right] + \lambda \tilde{V}_{so}.$$

□

□

### A.4.3 Proof of Theorem 4

*Proof.* According to Proposition 3, the bias of the IPSW estimator with estimated $\hat{\pi}_n$ can be upper bounded via

$$\begin{aligned} |\mathbb{E}[\hat{\tau}_{n,m}] - \tau| &\le \sum_{x \in \mathbf{X}} p_T(x) |\mathbb{E}[Y^{(0)} | X = x]| (1 - p_R(x)(1 - \pi(x)))^n \\ &\quad + \sum_{x \in \mathbf{X}} p_T(x) |\mathbb{E}[Y^{(1)} | X = x]| (1 - p_R(x)\pi(x))^n \\ &\le (1 - \min_x ((1 - \tilde{\pi}(x))p_R(x)))^n \mathbb{E}_T \left[ |\mathbb{E}[Y^{(1)} | X]| + |\mathbb{E}[Y^{(0)} | X]| \right]. \end{aligned}$$

Therefore, the risk of the (estimated) IPSW estimate with estimated $\hat{\pi}_n$ satisfies,

$$\begin{aligned} & \mathbb{E} \left[ (\hat{\tau}_{n,m} - \tau)^2 \right] \\ &\le \left(1 - \min_x \left( (1 - \tilde{\pi}(x))p_R(x) \right) \right)^{2n} \mathbb{E}_T \left[ \left| \mathbb{E} \left[ Y^{(1)} | X \right] \right| + \left| \mathbb{E} \left[ Y^{(0)} | X \right] \right| \right]^2 + \frac{2}{n+1} \mathbb{E}_R \left[ \left( \frac{p_T(X)}{p_R(X)} \right)^2 V_{\mathrm{DM}}(X) \right] \\ &\quad + \frac{\mathrm{Var}[\tau(X)]}{m} + \frac{2}{(n+1)m} \mathbb{E}_R \left[ \frac{p_T(X)(1-p_T(X))}{p_R(X)^2} V_{\mathrm{DM}}(X) \right] \\ &\quad + 2 \left(1 + \frac{3}{m}\right) \left(1 - \min_x \left( (1 - \tilde{\pi}(x))^2 p_R(x) \right) \right)^{n/2} \mathbb{E} \left[ (Y^{(1)})^2 + (Y^{(0)})^2 \right] \\ &\le \frac{2}{n+1} \mathbb{E}_R \left[ \left( \frac{p_T(X)}{p_R(X)} \right)^2 V_{\mathrm{DM}}(X) \right] + \frac{\mathrm{Var}[\tau(X)]}{m} + \frac{2}{m(n+1)} \mathbb{E}_R \left[ \frac{p_T(X)(1-p_T(X))}{p_R(X)^2} V_{\mathrm{DM}}(X) \right] \\ &\quad + 2 \left(2 + \frac{3}{m}\right) \left(1 - \min_x \left( (1 - \tilde{\pi}(x))p_R(x) \right) \right)^{n/2} \mathbb{E} \left[ (Y^{(1)})^2 + (Y^{(0)})^2 \right]. \end{aligned}$$

□

## B Extended adjustment set

### B.1 Proof of Corollary 4

*Proof.* According to Corollary 1, we have

$$\lim_{n \to \infty} n \mathrm{Var} \left[ \hat{\tau}_{T,n}^*(X) \right] = V_{so}, \qquad (57)$$

where

$$V_{so} := \mathbb{E}_R \left[ \left( \frac{p_T(X)}{p_R(X)} \right)^2 V_{HT}(X) \right],$$

with

$$V_{HT}(x) = \mathbb{E}_R \left[ \frac{(Y^{(1)})^2}{\pi} | X = x \right] + \mathbb{E}_R \left[ \frac{(Y^{(0)})^2}{1 - \pi} | X = x \right] - \tau(x)^2.$$
Since, by assumption, $V$ is composed of covariates that are not treatment effect modifiers, using Definition 11, we have, for all $(x, v)$,

$$V_{HT}(x, v) = V_{HT}(x). \qquad (58)$$

Now, considering the set $(X, V)$ instead of $X$ in the expression (57) leads to

$$
\begin{align*}
\lim_{n \to \infty} n \operatorname{Var}_R [\hat{\tau}_{T,n}^*(X, V)] &= \mathbb{E}_R \left[ \left( \frac{p_T(X, V)}{p_R(X, V)} \right)^2 V_{HT}(X, V) \right] \\
&= \sum_{x,v \in \mathcal{X}, \mathcal{V}} \frac{p_T^2(x, v)}{p_R(x, v)} V_{HT}(x, v) && \text{Equation. (58)} \\
&= \sum_{x,v \in \mathcal{X}, \mathcal{V}} \frac{p_T^2(x, v)}{p_R(x, v)} V_{HT}(x) && V \perp X \\
&= \sum_{x,v \in \mathcal{X}, \mathcal{V}} \frac{p_T^2(x) p_T^2(v)}{p_R(x) p_R(v)} V_{HT}(x) \\
&= \left( \sum_{v \in \mathcal{V}} \frac{p_T(v)^2}{p_R(v)} \right) \sum_{x \in \mathcal{X}} \frac{p_T^2(x)}{p_R(x)} V_{HT}(x) \\
&= \left( \sum_{v \in \mathcal{V}} \frac{p_T(v)^2}{p_R(v)} \right) \lim_{n \to \infty} n \operatorname{Var}_R [\hat{\tau}_{T,n}^*(X)],
\end{align*}
$$

Now, note that

$$
\begin{align*}
\sum_{v \in \mathcal{V}} \frac{p_T(v)^2}{p_R(v)} &= \mathbb{E}_R \left[ \frac{p_T(V)^2}{p_R(V)^2} \right] \\
&\geq \left( \mathbb{E}_R \left[ \frac{p_T(V)}{p_R(V)} \right] \right)^2 \\
&\geq \left( \sum_{v \in \mathcal{V}} p_T(v) \right)^2 \\
&\geq 1,
\end{align*}
$$

where the first inequality results from Jensen's inequality. Consequently,

$$\lim_{n \to \infty} n \operatorname{Var}_R [\hat{\tau}_{T,n}^*(X, V)] \geq \lim_{n \to \infty} n \operatorname{Var}_R [\hat{\tau}_{T,n}^*(X)]. \quad \square$$

## B.2 Proof of Corollary 5

*Proof.* By the law of total variance, we have, for all $x$,

$$V_{DM}(x) = \mathbb{E}[V_{DM}(x, V)] + \operatorname{Var}[\tau(x, V)]. \qquad (59)$$

Indeed, according to the law of total variance, for all random variables $Z, X_1, X_2$, we have, a.s.,

$$\operatorname{Var}[Z | X_1] = \mathbb{E}[\operatorname{Var}[Z | X_1, X_2] | X_1] + \operatorname{Var}[\mathbb{E}[Z | X_1, X_2] | X_1].$$
Letting $X_1 = X, X_2 = V$ and $Z = (YA/\pi) - (Y(1-A)/\pi)$ yields equation (59). Now, we can write

$$ 
\begin{align*}
\lim_{n \to \infty} n \operatorname{Var}_R [\hat{\tau}_{T,n}^*(X, V)] &= \mathbb{E}_R \left[ \left( \frac{p_T(X, V)}{p_R(X, V)} \right)^2 V_{DM}(X, V) \right] \\
&= \sum_{x,v \in \mathcal{X}, v \in \mathcal{V}} \frac{p_T^2(x, v)}{p_R(x, v)} V_{DM}(x, v) \\
&= \sum_{x,v \in \mathcal{X}, v \in \mathcal{V}} \frac{p_T^2(x) p_R^2(v)}{p_R(x) p_R(v)} V_{DM}(x, v) && V \perp X \\
&= \sum_{x \in \mathcal{X}} \frac{p_T^2(x)}{p_R(x)} \sum_{v \in \mathcal{V}} \frac{p_T^2(v)}{p_R(v)} V_{DM}(x, v) \\
&= \sum_{x \in \mathcal{X}} \frac{p_T^2(x)}{p_R(x)} \sum_{v \in \mathcal{V}} p_T(v) V_{HT}(x, v) && \text{by Definition 12} \\
&= \sum_{x \in \mathcal{X}} \frac{p_T^2(x)}{p_R(x)} (V_{DM}(x) - \operatorname{Var}[\tau(x, V)]) && \text{Equation (59)} \\
&= \lim_{n \to \infty} n \operatorname{Var}_R [\hat{\tau}_{T,n}^*(X)] - \mathbb{E}_R \left[ \frac{p_T(X)}{p_R(X)} \operatorname{Var}[\tau(X, V) | X] \right],
\end{align*}
$$

which concludes the proof. □

# C Semi-synthetic simulation's data preparation

## C.1 Context

The semi-synthetic simulation is made of real world data, a trial called CRASH-3 (Dewan et al., 2012; CRASH-3, 2019) and an observational data base called Traumabase. The covariates of both data sources are used to generate the true distribution from which the simulated data are generated. This part details the pre-treatment performed on the covariates, which is contained in the R notebook entitled Prepare-semi-synthetic-simulation.Rmd. As explained in the main document, in this semi-synthetic simulation we only consider six baseline covariates:

* Glasgow Coma Scale score<fnref n="7" /> (GCS) (categorical);

* Gender (categorical);

* Pupil reactivity (categorical);

* Age (continuous);

* Systolic blood pressure (continuous);

* Time-to-treatment (continuous), being the time between the trauma and the administration of the treatment.

As three covariates out of 6 are continuous, we categorize them to obtain a completely categorical data. The time-to-treatment is categorized in 4 levels, systolic blood pressure in 3 levels, and age in 3 levels. To further reduce the number of categories, and follow the CRASH-3 trial stratification, the Glasgow score is also gathered in 3 levels, from severe to moderately injured individuals, based on their Glasgow score.

**CRASH-3 trial** The CRASH-3 trial data contains information on 12,737 individuals. Over the six covariates of interest and the 12,737 individuals, 108 values are missing. We imputed them using the R package missRanger.

**Traumabase observational data** The complete Traumabase data contains 20,037 observations, but when keeping only the individuals suffering from Traumatic Brain Injury (TBI) as it is the case in the CRASH-3 trial, only 8,289 observations could be kept. Many data are missing, in particular 2,660 missing values for 8,289 individuals and along 5 baseline covariates considered. We impute them with the R package missRanger, using 35 other available baseline covariates. Because the time to treatment is not observed in the Traumabase this covariate is generated following a beta law, and considering a shifted distribution compared to the trial, in particular toward lower time-to-treatment values than in the trial.

<footnote n="7">⁷The GCS is a neurological scale which aims to assess a person's consciousness. The lower the score, the higher the severity of the trauma.</footnote>
**Ensuring overlap** When binding the two data sets, we had to ensure that the support inclusion assumption (Assumption 4) was verified. Out of the 586 modalities present in the target data, only 192 are also present in the trial data. Therefore only these observations are kept, such that the observational sample finally contains 8,058 observations (8,289 at the beginning). All the observations in the trial are kept as there is no restriction for the trial to contain a larger support as presented in Assumption 4.

### C.1.1 Covariate shift vizualization

For each of the six baseline and categorical considered, visualization of the covariate shift between the two data source is represented on Figures 10, 11, 12, 13, 14, and 15.

<figure><img src="image_12.png" /><figcaption>Figure 10: Bar plot of categorized age in the semi-synthetic simulation</figcaption></figure>

<figure><img src="image_13.png" /><figcaption>Figure 11: Bar plot of categorized systolic blood pressure in the semi-synthetic simulation</figcaption></figure>

## C.2 Synthetic outcome model

As detailed above, for now the covariate support reflects a true situation, where only the time-to-treatment covariate was created as it is missing in the target population sample (Colnet et al., 2021).

For the purpose of simulation, the outcome model is completely synthetic, and for each strata a number is affected, from 1 to the number of strata, starting to the lowest category (for example youngest strata, or lowest Glasgow score, or lower systolic blood pressure), to the highest one.

Doing so, the outcome model considered is such as,

$$Y = 10 - \text{Glasgow} + (\text{if Girl:} - 5 \text{ else:}0) + A(15(6 - \text{TTT}) + 3 * (\text{Systolic.blood.pressure} - 1)^2) + \varepsilon_{\text{TTT}},$$
<figure><img src="image_14.png" /><figcaption>Figure 12: Bar plot of gender in the semi-synthetic simulation</figcaption></figure>

<figure><img src="image_15.png" /><figcaption>Figure 13: Bar plot of the glasgow score in the semi-synthetic simulation</figcaption></figure>

<figure><img src="image_16.png" /><figcaption>Figure 14: Bar plot of pupil reactivity (−1 encoding not able to measure) in the semi-synthetic simulation</figcaption></figure>

where $\varepsilon_{TTT}$ is a random Gaussian noise with a standard deviation depending on the value of the covariate TTT. In particular if the treatment is given later, then the noise is stronger.
<figure><img src="image_17.png" /><figcaption>Figure 15: Bar plot of categorized time-to-treatment in the semi-synthetic simulation</figcaption></figure>

# D Useful results about RCTs under a Bernoulli design

Here we recall the definition of a Bernoulli trial (see Definition 13) and results such as variance expression of the Horvitz-Thomson and difference-in-means estimators under this design. We also provide details about variance inequality between the variance of the Horvitz-Thomson compared to the variance of the difference-in-means. In the literature we have not found detailed derivations about the finite sample bias and variance of the difference-in-means under a Bernoulli design. Extensively detailed derivations are available in Chapter two of Imbens and Rubin (2015), but for a completely randomized design. Also note that in this work we assume a superpopulation framework, and a large part of the existing literature focuses on inference on a finite population. Indeed, when considering a finite sample, bias and variance of the Horvitz-Thomson and difference-in-means are not the same as when inferring the superpopulation treatment effect (Splawa-Neyman et al., 1990; Imbens, 2011; Miratrix et al., 2013; Harshaw et al., 2021).

Note that all the results in this section considers one population, and not two populations with two distributions (target and randomized), therefore no index is placed on the expectation. When the following results on RCTs are used in the main paper and/or in the proofs, we use the index $R$ in the expectation as the trial in the main paper is sample according to $P_R$.

## D.1 Bernoulli trial

A Bernoulli trial is a trial where the treatment assignment vector, being $\mathbf{A} = (A_1, \dots, A_n)$ follows a Bernoulli law with a constant probability. More formally,

**Definition 13** (Assignment mechanism for a Bernoulli Trial). If the assignment mechanism is a Bernoulli trial with a probability $\pi$, then

$$ \forall i, \mathbb{P}[A_i] = \pi, $$

and considering a sample for $n$ units,

$$ \mathbb{P}[\mathbf{A} \mid i \in \mathcal{R}] = \prod_{i=1}^{n} \left[ \pi^{A_i} \cdot (1-\pi)^{1-A_i} \right], $$

where $\mathbf{A}$ denotes the vector of treatment allocation for the trial sample $\mathcal{R}$.

In this design the treatment allocation is independent of all other treatment allocations. A disadvantage of such design is the fact that there is always a small probability that all units receive the treatment or no treatment. This is why other designs are possible, such as the so-called completely randomized design, where the number of treated units is selected prior to treatment allocation (usually $n/2$ units are given treatment). The interest is to ensure a balanced group of treated and controls, and avoid a possible pathological case of high unbalance between the number of treated and control individuals.

Mathematically, treating the situation of a completely randomized design is different than a Bernoulli design, as in the former the probability of treatment is not independent between units, for example

$$ \forall i, j \in \mathcal{R}, \mathbb{P}_{\text{Comp. rand.}}[A_i = 1 | A_j = 1] \neq \mathbb{P}_{\text{Comp. rand.}}[A_i = 1] = \pi, $$
## D.2 Horvitz-Thomson's

The Horvitz-Thomson estimator is unbiased and has an explicit finite sample variance.

**Lemma 1** (Finite sample bias and variance of the Horvitz-Thomson estimator). Assuming trial internal validity (Assumption 2), then

$$ \forall n, \quad \mathbb{E}[\hat{\tau}_{HT}] - \tau = 0, $$

and

$$ \forall n, \quad n \operatorname{Var}[\hat{\tau}_{HT,n}] = \mathbb{E}\left[\frac{(Y^{(1)})^2}{\pi}\right] + \mathbb{E}\left[\frac{(Y^{(0)})^2}{1-\pi}\right] - \tau^2. $$

Note that the following proof can be extended to any $\pi(x)$ depending on baseline covariates, and therefore extends to the oracle IPW in the causal inference literature.

### Proof. Bias

$$
\begin{align*}
\mathbb{E}[\hat{\tau}_{HT}] &= \frac{\mathbb{E}[A_i Y_i^{(1)}]}{\pi} - \frac{\mathbb{E}[(1-A_i)Y_i^{(0)}]}{1-\pi} & \text{Linearity & SUTVA} \\
&= \frac{\mathbb{E}[A_i] \mathbb{E}[Y_i^{(1)}]}{\pi} - \frac{\mathbb{E}[(1-A_i)] \mathbb{E}[Y_i^{(0)}]}{1-\pi} & \text{Randomization} \\
&= \frac{\pi \mathbb{E}[Y_i^{(1)}]}{\pi} - \frac{(1-\pi) \mathbb{E}[Y_i^{(0)}]}{1-\pi} & \text{Def. of } \pi \text{ - Bernoulli design} \\
&= \tau, & \text{Linearity.}
\end{align*}
$$

### Variance

$$
\begin{align*}
\operatorname{Var}[\hat{\tau}_{HT,n}] &= \operatorname{Var}\left[\frac{1}{n} \sum_{i=1}^{n} \frac{A_i Y_i}{\pi} - \frac{(1-A_i)Y_i}{1-\pi}\right] \\
&= \frac{1}{n^2} \operatorname{Var}\left[\sum_{i=1}^{n} \frac{A_i Y_i^{(1)}}{\pi} - \frac{(1-A_i)Y_i^{(0)}}{1-e}\right] & \text{Assumption 2} \\
&= \frac{1}{n} \operatorname{Var}\left[\frac{AY_i^{(1)}}{\pi} - \frac{(1-A)Y_i^{(0)}}{1-\pi}\right]. & \text{iid}
\end{align*}
$$

Then,

$$ \operatorname{Var}[\hat{\tau}_{HT,n}] = \frac{1}{n} \left( \operatorname{Var}\left[\frac{AY_i^{(1)}}{\pi}\right] + \operatorname{Var}\left[\frac{(1-A)Y_i^{(0)}}{1-\pi}\right] - 2 \operatorname{Cov}\left[\frac{AY_i^{(1)}}{\pi}, \frac{(1-A)Y_i^{(0)}}{1-\pi}\right] \right). \quad (60) $$

The first two terms can be simplified, noting that

$$
\begin{align*}
\mathbb{E}\left[\left(\frac{AY^{(1)}}{\pi}\right)^2\right] &= \mathbb{E}\left[1_{\{A_i=1\}}\left(\frac{Y^{(1)}}{\pi}\right)^2\right] & \text{A is binary} \\
&= \mathbb{E}\left[\frac{(Y^{(1)})^2}{\pi^2}\right] \mathbb{E}_R\left[1_{\{A_i=1\}}\right] & \text{Randomization of trial} \\
&= \mathbb{E}\left[\frac{(Y^{(1)})^2}{\pi}\right] & \text{Definition of } \pi
\end{align*}
$$

Similarly,

$$ \mathbb{E}\left[\left(\frac{(1-A)Y^{(0)}}{1-\pi}\right)^2\right] = \mathbb{E}\left[\frac{(Y^{(0)})^2}{1-\pi}\right]. $$

So,
$$
\begin{align*}
\mathrm{Var}\left[\frac{AY^{(1)}}{\pi}\right] &= \mathrm{E}\left[\left(\frac{AY^{(1)}}{\pi}\right)^2\right] - \mathrm{E}\left[\frac{AY^{(1)}}{\pi}\right]^2 \\
&= \mathrm{E}\left[\frac{(Y^{(1)})^2}{\pi}\right] - \mathrm{E}\left[Y^{(1)}\right]^2.
\end{align*}
$$

Similarly,

$$
\mathrm{Var}\left[\frac{(1-A)Y^{(0)}}{1-\pi}\right] = \mathrm{E}\left[\left(\frac{Y^{(0)}}{1-\pi}\right)^2\right] - \mathrm{E}\left[Y^{(0)}\right]^2.
$$

The third term in equation (60) can also be decomposed, so that,

$$
\begin{align*}
\mathrm{Cov}\left[\frac{AY^{(1)}}{\pi}, \frac{(1-A)Y^{(0)}}{1-\pi}\right] &= \mathrm{E}_R\left[\left(\frac{AY^{(1)}}{\pi} - \mathrm{E}[Y^{(1)}]\right)\left(\frac{(1-A)Y^{(0)}}{1-\pi} - \mathrm{E}_R[Y^{(0)}]\right)\right] \\
&= \mathrm{E}_R\left[\underbrace{\frac{AY^{(1)}}{\pi} \frac{(1-A)Y^{(0)}}{1-\pi}}_{=0}\right] - \mathrm{E}_R[Y^{(0)}] \mathrm{E}_R[Y^{(1)}].
\end{align*}
$$

Finally,

$$
n \mathrm{Var}[\hat{\tau}_{\mathrm{HT},n}] = \mathrm{E}_{\mathrm{R}}\left[\frac{(Y^{(1)})^2}{\pi}\right] + \mathrm{E}_{\mathrm{R}}\left[\frac{(Y^{(0)})^2}{1-\pi}\right] - \tau^2 := V_{\mathrm{HT}}.
$$

<figure><img src="image_18.png" /></figure>

D.3 General results about the Difference-in-means

First, note that the Difference-in-Means estimator (in Definition 2) can be re-written as,

$$
\hat{\tau}_{\text{DM},n} = \frac{1}{n} \sum_{i=1}^{n} \frac{A_i Y_i}{\sum_{i=1}^{n} A_i} - \frac{1}{n} \sum_{i=1}^{n} \frac{(1-A_i) Y_i}{\sum_{i=1}^{n} (1-A_i)}
$$

which corresponds to the Horvitz-Thomson where the probability to be treated is estimated with the data.
This estimator is always defined, even if due to the Bernoulli design it possible that all observations were
allocated treatment or control. For example, if all units are given control, then

$$
\sum_{i=1}^{n} A_{i}=0,
$$

and because for all i, A_i = 0, the ratio 1/n Σ_{i=1}^n A_i / Σ_{i=1}^n (1-A_i) is defined and equal to 0/0 = 0 by convention.

**Lemma 2** (Finite sample and large sample properties of the difference-in-means estimator). *Assuming trial internal validity (Assumption 2), then*

$$
\forall n, \quad \mathbb{E}[\hat{\tau}_{DM,n}] - \tau = \pi^n \mathbb{E}[Y_i^{(0)}] - (1-\pi)^n \mathbb{E}[Y_i^{(1)}],
$$

and

$$
\forall n, \quad \mathrm{Var}[\hat{\tau}_{DM,n}] = \frac{1}{n} \left( \mathrm{E} \left[ \frac{1_{\hat{\pi}>0}}{\hat{\pi}} \right] \mathrm{Var}[Y_i^{(1)}] + \mathrm{E} \left[ \frac{1_{(1-\hat{\pi})>0}}{1-\hat{\pi}} \right] \mathrm{Var}[Y_i^{(0)}] \right) + D_n,
$$

$$
\text{where } D_n = \mathbb{E}[Y_i^{(1)}]^2 (1-\pi)^n + \mathbb{E}[Y_i^{(0)}]^2 \pi^n - \left(\mathbb{E}[Y_i^{(1)}](1-\pi)^n + \mathbb{E}[Y_i^{(0)}]\pi^n\right)^2.
$$

Asymptotically, the difference-in-means is unbiased

$$
\lim_{n \to \infty} \mathbb{E}[\hat{\tau}_{DM,n}] = \tau,
$$

and has the following variance

$$
\lim_{n \to \infty} n \mathrm{Var}[\hat{\tau}_{DM,n}] = \frac{\mathrm{Var}[Y^{(1)}]}{\pi} + \frac{\mathrm{Var}[Y^{(0)}]}{1-\pi} := V_{DM,\infty}.
$$
The difference-in-means under a Bernoulli design has a finite sample bias due to the possibility of a sample where everyone receive treatments or control. But the bias is exponentially decreasing with $n$. Also note that,

$$D_n = \mathcal{O}(\max(\pi, 1 - \pi)^n)$$

The asymptotic variance of the difference-in-means is the variance usually reported in textbooks, and corresponds to the finite sample of the Difference-in-Means estimator under a completely randomized trial. Note that we could also show that the Difference-in-Means is asymptotically normally distributed, for example using M-estimation techniques (Stefanski and Boos, 2002). As this result is not used in this paper, we do not detail the proof.

Note that for a completely randomized design, the difference-in-means is unbiased and its finite sample variance is,

$$\mathrm{Var}[\hat{\tau}_{\mathrm{DM},n}] = \frac{\mathrm{Var}[Y^{(1)}]}{n_1} + \frac{\mathrm{Var}[Y^{(0)}]}{n_0},$$

where $n_1$ is the number of treated units ($\sim \pi n$) and $n_0$ is the number of control units ($\sim (1 - \pi)n$). This formula is extensively used in the literature, but under a Bernoulli design this formula is true only in large sample as detailed in Lemma 2.

### Proof. Bias

One can use the law of total expectation, conditioning on the treatment assignment vector denoted $\mathbf{A}$,

$$ \begin{aligned} \mathbb{E}[\hat{\tau}_{\mathrm{DM}}] &= \mathbb{E}[\mathbb{E}[\hat{\tau}_{\mathrm{DM}} | \mathbf{A}]] \\ &= \mathbb{E}\left[\frac{1}{n}\sum_{i=1}^{n} A_i \mathbb{E}[Y_i^{(1)} | \mathbf{A}] - \frac{1}{n}\sum_{i=1}^{n} (1-A_i) \mathbb{E}[Y_i^{(0)} | \mathbf{A}]\right] \\ &= \mathbb{E}\left[\frac{1}{n}\sum_{i=1}^{n} A_i \mathbb{E}[Y_i^{(1)}] - \frac{1}{n}\sum_{i=1}^{n} (1-A_i) \mathbb{E}[Y_i^{(0)}]\right] \quad \{Y_i^{(1)}, Y_i^{(0)}\} \perp A_i \\ &= \mathbb{E}\left[\mathbf{1}_{\sum_{i=1}^{n} A_i > 0} \mathbb{E}[Y_i^{(1)}] - \mathbf{1}_{\sum_{i=1}^{n} 1-A_i > 0} \mathbb{E}[Y_i^{(0)}]\right] \\ &= \mathbb{E}[Y_i^{(1)}] \mathbb{E}[\mathbf{1}_{\sum_{i=1}^{n} A_i > 0}] - \mathbb{E}[\mathbf{1}_{\sum_{i=1}^{n} 1-A_i > 0}] \mathbb{E}[Y_i^{(0)}] \\ &= (1 - (1 - \pi)^n) \mathbb{E}[Y_i^{(1)}] - (1 - \pi^n) \mathbb{E}[Y_i^{(0)}] \\ &= \mathbb{E}[Y_i^{(1)} - Y_i^{(0)}] - (1 - \pi)^n \mathbb{E}[Y_i^{(1)}] + \pi^n \mathbb{E}[Y_i^{(0)}] \\ &= \tau - (1 - \pi)^n \mathbb{E}[Y_i^{(1)}] + \pi^n \mathbb{E}[Y_i^{(0)}], \end{aligned} $$

where the second row uses linearity of expectation and the conditioning on $\mathbf{A}$. To summarize, the difference-in-means has a finite sample bias,

$$\mathbb{E}[\hat{\tau}_{\mathrm{DM},n}] - \tau = \pi^n \mathbb{E}[Y_i^{(0)}] - (1 - \pi)^n \mathbb{E}[Y_i^{(1)}].$$

### Variance

Using the law of total variance, and conditioning on the treatment assignment vector $\mathbf{A}$, one has

$$\mathrm{Var}[\hat{\tau}_{\mathrm{DM}}] = \mathrm{Var}[\mathbb{E}[\hat{\tau}_{\mathrm{DM}} | \mathbf{A}]] + \mathbb{E}[\mathrm{Var}[\hat{\tau}_{\mathrm{DM}} | \mathbf{A}]].$$

Recall from derivations about the bias that,

$$\mathbb{E}[\hat{\tau}_{\mathrm{DM}} | \mathbf{A}] = \mathbf{1}_{\sum_{i=1}^{n} A_i > 0} \mathbb{E}[Y_i^{(1)}] - \mathbf{1}_{\sum_{i=1}^{n} 1-A_i > 0} \mathbb{E}[Y_i^{(0)}].$$

Note that if the number of treated was fixed, we would have $\mathbb{E}[\hat{\tau}_{\mathrm{DM}} | \mathbf{A}] = \tau$, and therefore, $\mathrm{Var}[\mathbb{E}[\hat{\tau}_{\mathrm{DM}} | \mathbf{A}]] = 0$. Here, one has,

$$ \begin{aligned} \mathrm{Var}[\mathbb{E}[\hat{\tau}_{\mathrm{DM}} | \mathbf{A}]] &= \mathrm{Var}[\mathbf{1}_{\sum_{i=1}^{n} A_i > 0} \mathbb{E}[Y_i^{(1)}] - \mathbf{1}_{\sum_{i=1}^{n} 1-A_i > 0} \mathbb{E}[Y_i^{(0)}]] \\ &= \mathbb{E}[Y_i^{(1)}]^2 \mathrm{Var}[\mathbf{1}_{\sum_{i=1}^{n} A_i > 0}] + \mathbb{E}[Y_i^{(0)}]^2 \mathrm{Var}[\mathbf{1}_{\sum_{i=1}^{n} 1-A_i > 0}] \\ &\quad - 2\mathbb{E}[Y_i^{(1)}] \mathbb{E}[Y_i^{(0)}] \mathrm{Cov}[\mathbf{1}_{\sum_{i=1}^{n} A_i > 0}, \mathbf{1}_{\sum_{i=1}^{n} 1-A_i > 0}]. \end{aligned} $$
Besides,

$$
\begin{align*}
\mathrm{Var}[\mathbf{1}_{\sum_{i=1}^{n} A_i > 0}] &= \mathbb{E}[\mathbf{1}_{\sum_{i=1}^{n} A_i > 0}^2] - \mathbb{E}[\mathbf{1}_{\sum_{i=1}^{n} A_i > 0}]^2 \\
&= (1 - \pi)^n (1 - (1 - \pi)^n),
\end{align*}
$$

and similarly,

$$
\mathrm{Var}[\mathbf{1}_{\sum_{i=1}^{n} 1 - A_i > 0}] = \pi^n (1 - \pi^n).
$$

On the other hand,

$$
\begin{align*}
\mathrm{Cov}[\mathbf{1}_{\sum_{i=1}^n A_i > 0}, \mathbf{1}_{\sum_{i=1}^n 1 - A_i > 0}] &= \mathbb{E}[(\mathbf{1}_{\sum_{i=1}^n A_i > 0} - (1-(1-\pi)^n))(\mathbf{1}_{\sum_{i=1}^n 1-A_i > 0} - 1-\pi^n)] \\
&= \mathbb{E}[\mathbf{1}_{\sum_{i=1}^n A_i > 0}\mathbf{1}_{\sum_{i=1}^n 1-A_i > 0}] - (1-(1-\pi)^n)(1-\pi^n) \\
&= 1-(1-\pi)^n - \pi^n - (1-\pi^n - (1-\pi)^n - \pi^n(1-\pi)^n) \\
&= \pi^n(1-\pi)^n,
\end{align*}
$$

such that,

$$
\begin{align*}
\mathrm{Var}[\mathbb{E}[\hat{\tau}_{\mathrm{DM}} | \mathbf{A}]] &= \mathbb{E}[Y_i^{(1)}]^2 (1-\pi)^n (1-(1-\pi)^n) + \mathbb{E}[Y_i^{(0)}]^2 \pi^n (1-\pi^n) - 2\mathbb{E}[Y_i^{(1)}] \mathbb{E}[Y_i^{(0)}] \pi^n (1-\pi)^n \\
&= \mathbb{E}[Y_i^{(1)}]^2 (1-\pi)^n + \mathbb{E}[Y_i^{(0)}]^2 \pi^n - (\mathbb{E}[Y_i^{(1)}](1-\pi)^n + \mathbb{E}[Y_i^{(0)}]\pi^n)^2 \\
&\le \mathbb{E}[Y_i^{(1)}]^2 (1-\pi)^n + \mathbb{E}[Y_i^{(0)}]^2 \pi^n \\
&\le (\mathbb{E}[Y_i^{(1)}]^2 + \mathbb{E}[Y_i^{(0)}]^2) \max(\pi, 1-\pi)^n.
\end{align*}
$$

Now,

$$
\begin{align*}
\mathrm{Var}[\hat{\tau}_{\mathrm{DM}} | \mathbf{A}] &= \mathrm{Var}\left[\frac{1}{n} \sum_{i=1}^{n} \left( \frac{A_i Y_i^{(1)}}{\hat{\pi}} - \frac{(1-A_i) Y_i^{(0)}}{1-\hat{\pi}} \right) | \mathbf{A}\right] \\
&= \frac{1}{n} \mathrm{Var}\left[ \frac{A_i Y_i^{(1)}}{\hat{\pi}} - \frac{(1-A_i) Y_i^{(0)}}{1-\hat{\pi}} \mid \mathbf{A} \right] \tag*{iid} \\
&= \frac{1}{n} \left( \mathrm{Var}\left[ \frac{A_i Y_i^{(1)}}{\hat{\pi}} \mid \mathbf{A} \right] + \mathrm{Var}\left[ \frac{(1-A_i) Y_i^{(0)}}{1-\hat{\pi}} \mid \mathbf{A} \right] - 2 \mathrm{Cov}\left[ \frac{A_i Y_i^{(1)}}{\hat{\pi}}, \frac{(1-A_i) Y_i^{(0)}}{1-\hat{\pi}} \mid \mathbf{A} \right] \right).
\end{align*}
$$

Now, developing the covariance term, it is possible to show that,

$$
\begin{align*}
\mathrm{Cov}\left[\frac{A_i Y_i^{(1)}}{\hat{\pi}}, \frac{(1-A_i) Y_i^{(0)}}{1-\hat{\pi}} \mid \mathbf{A}\right] &= -\mathrm{E}\left[\frac{(1-A_i) Y_i^{(0)}}{1-\hat{\pi}} \mid \mathbf{A}\right] \mathrm{E}\left[\frac{A_i Y_i^{(1)}}{\hat{\pi}} \mid \mathbf{A}\right] \\
&= -\frac{(1-A_i)\mathrm{E}\left[Y_i^{(0)} \mid \mathbf{A}\right]}{1-\hat{\pi}} \frac{A_i \mathrm{E}\left[Y_i^{(1)} \mid \mathbf{A}\right]}{\hat{\pi}} && \text{Linearity and conditioned on } \mathbf{A} \\
&= 0. && A_i(1-A_i) = 0
\end{align*}
$$

Now, also using linearity of expectation, and the fact that we conditioned on **A**, one has

$$
\begin{align*}
\mathrm{Var}[\hat{\tau}_{\mathrm{DM}} | \mathbf{A}] &= \frac{1}{n} \left( \left( \frac{A_i}{\hat{\pi}} \right)^2 \mathrm{Var}[Y_i^{(1)} | \mathbf{A}] + \left( \frac{1-A_i}{1-\hat{\pi}} \right)^2 \mathrm{Var}[Y_i^{(0)} | \mathbf{A}] \right) \\
&= \frac{1}{n} \left( \left( \frac{A_i}{\hat{\pi}} \right)^2 \mathrm{Var}[Y_i^{(1)}] + \left( \frac{1-A_i}{1-\hat{\pi}} \right)^2 \mathrm{Var}[Y_i^{(0)}] \right), \quad \text{using } \{Y_i^{(1)}, Y_i^{(0)}\} \perp A_i.
\end{align*}
$$

Taking the expectation of the previous term leads to,

$$
\begin{align*}
\mathbb{E}[\mathrm{Var}[\hat{\tau}_{\mathrm{DM}} | \mathbf{A}]] &= \mathbb{E}\left[\frac{1}{n}\left(\left(\frac{A_i}{\hat{\pi}}\right)^2 \mathrm{Var}[Y_i^{(1)}] + \left(\frac{1-A_i}{1-\hat{\pi}}\right)^2 \mathrm{Var}[Y_i^{(0)}]\right)\right] \\
&= \frac{1}{n}\left(\mathbb{E}\left[\left(\frac{A_i}{\hat{\pi}}\right)^2\right] \mathrm{Var}[Y_i^{(1)}] + \frac{1}{n}\mathbb{E}\left[\left(\frac{1-A_i}{1-\hat{\pi}}\right)^2\right] \mathrm{Var}[Y_i^{(0)}]\right), \quad \text{by linearity.}
\end{align*}
$$
Note that,

$$
\begin{align*}
\mathbb{E}\left[\left(\frac{A_i}{\hat{\pi}}\right)^2\right] &= \mathbb{E}\left[\frac{A_i}{(\hat{\pi})^2}\right] \\
&= \frac{1}{n}\left(\mathbb{E}\left[\frac{A_1}{\hat{\pi}^2}\right] + \mathbb{E}\left[\frac{A_2}{\hat{\pi}^2}\right] + \dots + \mathbb{E}\left[\frac{A_n}{\hat{\pi}^2}\right]\right) \\
&= \mathbb{E}\left[\frac{\hat{\pi}}{\hat{\pi}^2}\right] \\
&= \mathbb{E}\left[\frac{1_{\hat{\pi}>0}}{\hat{\pi}}\right],
\end{align*}
$$

so that

$$
\mathbb{E}[\mathrm{Var}[\hat{\tau}_{\mathrm{DM}} | \mathbf{A}]] = \frac{1}{n} \left( \mathbb{E}\left[\frac{1_{\hat{\pi}>0}}{\hat{\pi}}\right] \mathrm{Var}[Y_i^{(1)}] + \mathbb{E}\left[\frac{1_{(1-\hat{\pi})>0}}{1-\hat{\pi}}\right] \mathrm{Var}[Y_i^{(0)}] \right).
$$

Coming back to the law of total variance, one has,

$$
\begin{align*}
\mathrm{Var}[\hat{\tau}_{\mathrm{DM}}] &= \mathrm{Var}[\mathbb{E}[\hat{\tau}_{\mathrm{DM}} | \mathbf{A}]] + \mathbb{E}[\mathrm{Var}[\hat{\tau}_{\mathrm{DM}} | \mathbf{A}]] \\
&= \mathbb{E}\left[Y_i^{(1)}\right]^2 (1-\pi)^n + \mathbb{E}\left[Y_i^{(0)}\right]^2 \pi^n - \left(\mathbb{E}\left[Y_i^{(1)}\right](1-\pi)^n + \mathbb{E}\left[Y_i^{(0)}\right]\pi^n\right)^2 \\
&\quad + \frac{1}{n}\left(\mathbb{E}\left[\frac{1_{\hat{\pi}>0}}{\hat{\pi}}\right]\mathrm{Var}[Y_i^{(1)}] + \mathbb{E}\left[\frac{1_{(1-\hat{\pi})>0}}{1-\hat{\pi}}\right]\mathrm{Var}[Y_i^{(0)}]\right)
\end{align*}
$$

In particular, for any sample size,

$$
\mathrm{Var}[\hat{\tau}_{\mathrm{DM}}] = \frac{1}{n} \left( \mathbb{E}\left[\frac{1_{\hat{\pi}>0}}{\hat{\pi}}\right] \mathrm{Var}[Y_i^{(1)}] + \mathbb{E}\left[\frac{1_{(1-\hat{\pi})>0}}{1-\hat{\pi}}\right] \mathrm{Var}[Y_i^{(0)}] \right) + \mathcal{O}(\max(\pi, 1-\pi)^n),
$$

and more particularly,

$$
\lim_{n \to \infty} n \mathrm{Var}[\hat{\tau}_{\mathrm{DM}}] = \frac{\mathrm{Var}[Y^{(1)}]}{\pi} + \frac{\mathrm{Var}[Y^{(0)}]}{1-\pi} := V_{\mathrm{DM},\infty}.
$$

□

D.4 Variance inequality between a Horvitz-Thomson and difference-in-means

In this work we use an inequality to compare the variance of the Horvitz-Thomson with the variance of the
difference-in-means under a Bernoulli design. We propose two inequalities, one for the finite sample and one
for the asymptotic variance. The result in finite sample depends on another equality on Binomial law, and in
particular ̂π, that we detail in Lemma 3.

**Lemma 3** (Inequality on $\hat{\pi}$). *Consider a Bernoulli trial (Definition 13) and the estimated propensity score $\hat{\pi}$ defined as,*

$$
\hat{\pi} = \frac{\sum_{i=1}^{n} A_i}{n}.
$$

Then, for all $n \ge 1$ and for all $\alpha \in (0, \frac{1}{2})$,

$$
\mathbb{E} \left[ \frac{1_{\hat{\pi} > 0}}{\hat{\pi}} \right] \le \frac{1 + C_{\alpha, \pi} n^{-\alpha}}{\pi},
$$

$$
\text{where } C_{\alpha, \pi} = 1 + 2 \left( \frac{16}{\pi^2 (1-2\alpha)} \right)^{\frac{2}{1-2\alpha}}.
$$

Proof. Let $\varepsilon > 0$. (and later in the proof, we will more precisely posit $\varepsilon = \frac{\pi}{4}n^{-\alpha}$ with $\alpha \in (0, \frac{1}{2})$)
The law of total expectation leads to,

$$
\mathbb{E}\left[\frac{1_{\hat{\pi}>0}}{\hat{\pi}}\right] = \mathbb{E}\left[\frac{1_{\hat{\pi}>0}}{\hat{\pi}} 1_{|\hat{\pi}-\pi|<\varepsilon}\right] + \mathbb{E}\left[\frac{1_{\hat{\pi}>0}}{\hat{\pi}} 1_{|\hat{\pi}-\pi|\ge\varepsilon}\right].
$$

For the first term,