numeric

# CausalMetaR: An R package for performing causally interpretable meta-
analyses

Guanbo Wang Correspondence: Guanbo Wang, CAUSALab, Harvard T.H. Chan School of
Public Health, Boston, MA, 02115, U.S.A. Email<EMAIL_ADDRESS>$\dagger$ Equal contributed author CAUSALab, Harvard T.H. Chan School of
Public Health, Boston, MA, U.S.A  Sean McGrath  Yi Lian  Issa J. Dahabreh
CAUSALab, Harvard T.H. Chan School of Public Health, Boston, MA, U.S.A
Department of Epidemiology, Harvard T.H. Chan School of Public Health, Boston,
MA, U.S.A  Department of Biostatistics, Harvard T.H. Chan School of Public
Health, Boston, MA, U.S.A

###### Abstract

Researchers would often like to leverage data from a collection of sources
(e.g., primary studies in a meta-analysis) to estimate causal effects in a
target population of interest. However, traditional meta-analytic methods do
not produce causally interpretable estimates for a well-defined target
population. In this paper, we present the CausalMetaR R package, which
implements efficient and robust methods to estimate causal effects in a given
internal or external target population using multi-source data. The package
includes estimators of average and subgroup treatment effects for the entire
target population. To produce efficient and robust estimates of causal
effects, the package implements doubly robust and non-parametric efficient
estimators and supports using flexible data-adaptive (e.g., machine learning
techniques) methods and cross-fitting techniques to estimate the nuisance
models (e.g., the treatment model, the outcome model). We describe the key
features of the package and demonstrate how to use the package through an
example.

Keywords— CausalMetaR, meta-analysis, causal inference, transportability, R
package

##  1 Introduction

We consider the setting where one would like to estimate the causal effects of
an intervention in a particular target population. While Average Treatment
Effects (ATEs) are often of interest in causal analyses, treatment effects may
vary based on specific patient characteristics. In such scenarios, estimating
the Subgroup Treatment Effect (STE) can help clinicians tailor treatment
strategies for patients and lay the foundation for generating future
hypotheses.

When data from multiple sources are available, one may naturally consider
pooling the data across sources to estimate such causal effects. As a primary
example, meta-analyses are frequently employed to pool data across several
randomized trials. Other examples include analyses of multi-center trials,
pooled analyses of observational cohorts, and combined trials and
observational cohorts.

Conventional meta-analytic methods pool data across sources by taking a
weighted average of the source-specific estimates of the outcome of interest,
where the weights are related to the precision of the sources. Typically,
meta-analysis practitioners employ random effects models to account for
differences in the source populations. However, the pooled estimate from such
approaches generally does not have a clear causal interpretation because it
does not pertain to a well-defined target population [35].

Several methods have been recently developed to estimate causal effects for
specific target populations when data are available from multiple sources.
Broadly, these methods can be categorized as those that estimate causal
effects in a so-called _internal target population_ (i.e., the population of a
given data source in a collection of source) versus an _external target
population_ (i.e., a population defined by the distribution of baseline
covariates in another data source), where the outcome and treatment
information may be not available. Specifically, Robertson et al. [36] and
Dahabreh et al. [37] developed methods to estimate ATEs in internal and
external target populations, respectively. These methods have subsequently
been extended by Wang et al. [38] to estimate STEs in internal and external
target populations, where the subgroups are defined based on a categorical
effect modifier.

These methods can be challenging to apply for a few reasons. These methods
require fitting a number of models to estimate the so-called _nuisance
parameters_ , such as the conditional outcome mean and the conditional
probability of receiving treatment and the source index. To handle high-
dimensional covariates and help protect against model misspecification, data
analysts may want to use flexible machine methods to estimate the nuisance
parameters. Constructing valid confidence intervals for these estimators when
using machine learning methods requires sample splitting and cross-fitting,
which can be challenging to implement. Consequently, one barrier to applying
these methods in practice is the lack of available software. Additionally,
having these different methods implemented in one software tool can help
researchers easily perform secondary analyses, such as estimating treatment
effects in different target populations and in different subgroups.

In this article, we present the CausalMetaR R package [39] for performing
causally interpretable meta-analyses. The package can be used to estimate ATEs
and STEs in internal and external target populations. Users of the package can
apply a wide range of flexible models to estimate the nuisance parameters. The
package implements sample splitting and cross-fitting procedures, which are
crucial for obtaining valid confidence intervals when using flexible models
for the nuisance parameters. Users can also generate forest plots of the
causal effect estimates in the internal populations. The package requires
individual participant data from the data sources (e.g., observational studies
and/or randomized trials). The package can be downloaded from the
Comprehensive R Archive Network (CRAN) at
https://CRAN.R-project.org/package=CausalMetaR.

In the following section, we describe the statistical methods implemented in
CausalMetaR. We describe how to use the package in Section 3 and illustrate an
example application in Section 4. We conclude with a discussion in Section 5.

##  2 Methods

In this section, we present the methods used by the package. The methods to
estimate the ATEs were developed by Robertson et al. [36] (for an internal
target population) and Dahabreh et al. [37] (for the external target
population). The methods to estimate the STEs were developed by Wang et
al.[38] (for both target populations).

###  2.1 Target parameters and identification

Consider a collection of datasets comprising $m$ distinct datasets, each
containing $n_{j},j=1,\dots,m$ random samples drawn from a unique population
(with total sample size $n=n_{1}+\dots+n_{m}$). Each dataset in this
collection comprises information on the outcome variable $Y$, the data source
index $S\in\mathcal{S}=\\{1,\dots,m\\}$, the binary treatment assignment $A$
($a\in\\{0,1\\}$), and the potential high-dimensional covariate matrix $X$. We
do not require the source of each data is consistent; some data can be
collected from clinical trials, and some data can be collected from
observational cohorts.

Throughout this paper, we use a counterfactual framework [40]. Define the
counterfactual outcome $Y^{a}$ as the outcome had the subject received
treatment $a$. When the target population is the internal target population,
we define the target parameter as the counterfactual means difference in the
target population, denoted by
$\phi_{s}=\operatorname{\textnormal{\mbox{E}}}(Y^{1}-Y^{0}|S=s),\forall
s\in\mathcal{S}$. See the data structures in the left panel of Figure 1.

However, sometimes investigators are interested in a target population that is
not represented by any of the $m$ sources of the dataset, but by an external
source, in which the outcome and treatment information may be missing. In such
cases, we define the target parameter as
$\psi=\operatorname{\textnormal{\mbox{E}}}(Y^{1}-Y^{0}|S=0)$, where $S=0$
indicates the external data. See the data structures in the left panel of
Figure 1.

Figure 1: The left panel represents the data structure required when the
target population is an internal population in the multi-source data. The
right panel represents the data structure required when the target population
is the external target population. Note that when the target population is an
internal target population, only the collection of datasets is required, but
not the external data. In both panels, the shaded dataset represents the
target population.

In both scenarios, we can estimate the STEs. Denote the interested categorical
effect modifier by $\widetilde{X}\subset X$. When the target population is an
internal target population, we define the target parameters as
$\phi_{s}(\widetilde{x})=\operatorname{\textnormal{\mbox{E}}}(Y^{1}-Y^{0}|S=s,\widetilde{X}=\widetilde{x}),\forall
s\in\mathcal{S}$, when the target population is the external population, the
target parameter is
$\psi(\widetilde{x})=\operatorname{\textnormal{\mbox{E}}}(Y^{1}-Y^{0}|S=0,\widetilde{X}=\widetilde{x})$.

The above parameters of interest are based on counterfactual outcomes, which
are not fully observed. We provide sufficient identifying conditions for the
target parameters below.

_A1. Consistency:_ If $A_{i}=a,$ then $Y^{a}_{i}=Y_{i},\forall a\in\\{0,1\\}$
and $i$.

_A2. Exchangeability over $A$:_ $Y^{a}\mathchoice{\mathrel{\hbox
to0.0pt{$\displaystyle\perp$\hss}\mkern
2.0mu{\displaystyle\perp}}}{\mathrel{\hbox
to0.0pt{$\textstyle\perp$\hss}\mkern 2.0mu{\textstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptstyle\perp$\hss}\mkern
2.0mu{\scriptstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptscriptstyle\perp$\hss}\mkern
2.0mu{\scriptscriptstyle\perp}}}A|(X,S=s),\forall
a\in\\{0,1\\},s\in\mathcal{S}$.

_A3. Positivity of the probability of treatment:_ If $f(x,S=s)\neq 0$, then
$\Pr(A=a|X=x,S=s)>0,\forall a\in\\{0,1\\},s\in\mathcal{S}$.

_A4. Exchangeability over $S$:_ $\forall
a\in\\{0,1\\},Y^{a}\mathchoice{\mathrel{\hbox
to0.0pt{$\displaystyle\perp$\hss}\mkern
2.0mu{\displaystyle\perp}}}{\mathrel{\hbox
to0.0pt{$\textstyle\perp$\hss}\mkern 2.0mu{\textstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptstyle\perp$\hss}\mkern
2.0mu{\scriptstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptscriptstyle\perp$\hss}\mkern
2.0mu{\scriptscriptstyle\perp}}}S|X$.

_A5. Positivity of the probability of participation:_ If
$f(x,s\notin\mathcal{S})\neq 0$, then $\Pr(S=s|X=x)>0,\forall
s\in\mathcal{S}$.

It is important to emphasize that the assumptions of exchangeability and
treatment positivity are assumed to hold within each individual data source,
as opposed to being held to other multi-source datasets. These assumptions
must be scrutinized in light of substantive knowledge. While it is not
possible to empirically test assumptions _A2_ and _A4_ , they do imply a
testable condition: $Y\mathchoice{\mathrel{\hbox
to0.0pt{$\displaystyle\perp$\hss}\mkern
2.0mu{\displaystyle\perp}}}{\mathrel{\hbox
to0.0pt{$\textstyle\perp$\hss}\mkern 2.0mu{\textstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptstyle\perp$\hss}\mkern
2.0mu{\scriptstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptscriptstyle\perp$\hss}\mkern
2.0mu{\scriptscriptstyle\perp}}}S|(X,S\in\mathcal{S},A=a)$. For a more
comprehensive discussion of these assumptions and their implications, as well
as potential alternative, less restrictive identifying conditions, interested
readers can refer to Dahabreh et al. [37] and Wang et al. [38]

Through assumptions _A1_ to _A5_ , it can be shown that the target parameters
are identifiable using observed data. For example,
$\operatorname{\textnormal{\mbox{E}}}(Y^{a}|S=s,\widetilde{X}=\widetilde{x})$
can be identified by either the following two functionals $\forall
a\in\\{0,1\\},s\in\mathcal{S}$

$\displaystyle\operatorname{\textnormal{\mbox{E}}}\big{\\{}\operatorname{\textnormal{\mbox{E}}}(Y|A=a,X)|\widetilde{X}=\widetilde{x},S=s\big{\\}},\quad\text{or}\quad\sum_{i=1}^{n}\dfrac{1}{\Pr(\widetilde{X}=\widetilde{x},S=s)}\operatorname{\textnormal{\mbox{E}}}\Big{\\{}\dfrac{I(A=a,\widetilde{X}=\widetilde{x})Y\Pr(S=s|X)}{\Pr(A=a|X)}\Big{\\}},$

and the target parameter $\phi_{s}(\widetilde{x})$ (the STE in an internal
target population) can be identified by
$\operatorname{\textnormal{\mbox{E}}}(Y^{1}|S=s,\widetilde{X}=\widetilde{x})-\operatorname{\textnormal{\mbox{E}}}(Y^{0}|S=s,\widetilde{X}=\widetilde{x})$.
Similar identification results apply to other target parameters. Specifically,
when estimating the STE in the external target population,
$\psi_{s}(\widetilde{x})$ can be identified by the above quantities by
modifying the condition from $S=s$ to $S=0$. When estimating the ATEs, the
condition $\widetilde{X}=\widetilde{x}$ should be deleted from
$\phi_{s}(\widetilde{x})$ and $\psi_{s}(\widetilde{x})$.

###  2.2 Estimation

####  2.2.1 Influence function-based estimator

While one can estimate the target parameters using the above identification
result, when the covariates are high-dimensional, specifying correct
parametric models for the nuisance parameters such as
$\operatorname{\textnormal{\mbox{E}}}(Y|A=1,X)$ may be challenging. Non-
parametrically and efficient estimation of the target parameters can be
proceeded with the aid of influence functions. One can estimate the target
parameters by solving the estimating equations, which equates the empirical
mean of the influence functions of the target parameters to zero.

Such estimators can be presented as linear combinations of the following
possible nuisance parameters:

  1. 1.

Outcome model $\operatorname{\textnormal{\mbox{E}}}(Y|A=a,X)$, the outcome
means conditional on a specific treatment and covariates.

  2. 2.

Source model $\Pr(S=s|X),\forall s\in\mathcal{S}$, the probability of source
indices conditional on covariates in the multi-source data. Note that, in
general, the outcome of this model is a categorical variable. We recommend
users fit a (penalized) multinomial logistic model for it.

  3. 3.

External model $\Pr(S=0|X)$, the probability of a subject is from the external
population conditional on covariates (only applicable when estimating ATEs and
STEs in external target populations)

  4. 4.

Propensity score model $\Pr(A=1|S,X)$, the probability of treatment
conditional on covariates and source index in the multi-source data.

For example,
$\widehat{\operatorname{\textnormal{\mbox{E}}}}(Y^{a}|S=s,\widetilde{X}=\widetilde{x})$
is given by

$\displaystyle\dfrac{1}{n}\sum_{i=1}^{n}\dfrac{1}{\widehat{\Pr}(\widetilde{X}_{i}=\widetilde{x},S_{i}=s)}\Big{[}I(\widetilde{X}_{i}=\widetilde{x}_{i},S_{i}=s)\big{\\{}\widehat{\operatorname{\textnormal{\mbox{E}}}}(Y_{i}|A_{i}=a,X_{i})\big{\\}}$
(1)
$\displaystyle\qquad+I(\widetilde{X}_{i}=\widetilde{x}_{i})\widehat{\Pr}(S_{i}=s|X_{i})\dfrac{A_{i}}{\widehat{\Pr}(A_{i}=a|X_{i})}\big{\\{}Y_{i}-\widehat{\operatorname{\textnormal{\mbox{E}}}}(Y_{i}|A_{i}=a,X_{i})\big{\\}}\Big{]}$

where hats denote estimators of the respective parameter. Then
$\phi_{s}(\widetilde{x})$ can be estimated by
$\widehat{\operatorname{\textnormal{\mbox{E}}}}(Y^{1}|S=s,\widetilde{X}=\widetilde{x})-\widehat{\operatorname{\textnormal{\mbox{E}}}}(Y^{0}|S=s,\widetilde{X}=\widetilde{x})$.
We compute $\widehat{\Pr}(A_{i}=a|X_{i})$ by
$\sum_{s\in\mathcal{S}}\widehat{\Pr}(A_{i}=1|S_{i}=s,X_{i}=x)\widehat{\Pr}(S_{i}=s|X_{i}=x)$.
These are discussed in the following subsection. Similar estimators apply to
the other target parameters.

####  2.2.2 Nuisance parameter estimator

The CausalMetaR package leverages the rich capabilities of the SuperLearner
package [41] to estimate the nuisance parameters described in Section 2.2.1.
Doing so gives users a wide array of flexible and robust approaches to
estimate the nuisance parameters under a unified user interface. Specifically,
users can apply one of the following three broad approaches:

  1. 1.

Users can choose from a range of 41 parametric (e.g., generalized linear
models) and nonparametric models (e.g., neural networks, random forests,
support vector machines) to estimate the nuisance parameters. This can be done
by specifying a single algorithm in the library. The model hyperparameters (if
applicable) can be fit based on cross-validation.

  2. 2.

Users can fit multiple models and combine them using the SuperLearner (SL)
method. Specifically, SL can either (a) choose the best performing model among
the list of candidate models specified by the user, or (b) take an optimally
weighted average of the candidate models. Model selection or model averaging
is performed based on cross-validation.

  3. 3.

In the event that users would like to apply a model that is not implemented in
SuperLearner (e.g., a Classification And Regression Tree (CART) model), the
package allows users to specify their own custom model.

In each of these approaches, SL supports parallel computing.

####  2.2.3 Stratified sample splitting and cross-fitting

Sample splitting and cross-fitting [42] can be used in estimation to allow
users to have a broader choice of data-adaptive (e.g., machine-learning)
methods to specify and estimate the nuisance parameters and gain more
efficiency [43]. Broadly, cross-fitting involves splitting the dataset into
separate subsamples, where the nuisance parameters and the target parameter
are estimated in separate subsamples. The procedure is repeated several
iterations and the results are combined. Figure 2 shows the visualization of
the cross-fit procedure for each replication.

More specifically, the cross-fitting procedure implemented in CausalMetaR is
detailed in Table 1. When the target population is the external population, we
need to estimate one more nuisance parameter–the external model. In such
cases, the data should be split into five sets in Step 1 in Table 1, all other
procedures are the same. Note that because Step 1 requires stratified sample
splitting, the sample size of the multi-source data should be large enough.
For instance, if the data are collected from multiple early-phase trials,
sample splitting and cross-fitting are not recommended.

Table 1: Procedures of cross-fitting for estimating $\phi_{s}(\widetilde{x})$ Step |  Procedure
---|---
0 |  Data input
|  Repeat Steps 1-4, $L$ times, and for each replication $l$: (See Figure 2)
1 |  The data are partitioned into four approximately equal-sized sample splits, denoted by Data $k$. The partition is stratified by source index and effect modifier so that assumption _A1_ is satisfied.
2 |  The outcome, treatment, and source nuisance models are fit in each Data $k$.
3 |  The target parameter estimate $\widehat{\phi}_{s}^{k,l}(\widetilde{x}),\forall k=1,\dots,4$ is obtained by (1) using Data $k$, where the nuisance models are constructed from other data split $\forall k^{\prime}\neq k$. For example, use Data 1 to obtain $\widehat{\phi}_{s}^{1,l}(\widetilde{x})$, where outcome, treatment, and source models are constructed by Data 2, 3, and 4, respectively.
4 |  The target parameter is calculated from the mean of the predictions across all splits, i.e., $\widehat{\phi}_{s}^{l}(\widetilde{x})=\sum_{k=1}^{4}\widehat{\phi}_{s}^{k,l}(\widetilde{x})/4$. The same for the variance estimation.
5 |  The overall point estimate is $\widehat{\phi}_{s}(\widetilde{x})=\mathrm{median}\\{\widehat{\phi}_{s}^{l}(\widetilde{x})\\}$, and the overall estimated variance is estimated by $\mathrm{median}[Var\\{\widehat{\phi}_{s}^{l}(\widetilde{x})\\}+\\{\widehat{\phi}_{s}^{l}(\widetilde{x})-\widehat{\phi}_{s}(\widetilde{x})\\}^{2}]$, $\forall l=1,\dots,L$
Figure 2: The cross-fitting procedure for estimating $\phi_{s}(\widetilde{x})$
in each of the replication.

###  2.3 Inference

####  2.3.1 Properties of estimators

The influence function-based estimators estimated via sample splitting and
cross-fitting have the following properties: 1) parametric doubly robust, if
either the outcome model or the source and treatment model can be correctly
specified using parametric models, then the estimators are consistent, 2) non-
parametrically efficient, the estimators are the most efficient in their non-
parametric class of estimators. When all the nuisance parameters converge at a
quarter rate, the estimators are 3) rate robust, the estimators are
$\sqrt{n}$-consistent, and 4) asymptotically normal. Therefore, we can
construct closed-form confidence intervals for the estimators.

####  2.3.2 Simultaneous confidence intervals

In estimating STEs, when investigators are simultaneously interested in more
than one subgroup, using confidence intervals to assess the uncertainty of the
target parameters may be preservative. This is because multiple subgroups are
being compared simultaneously using the same data. In such cases, simultaneous
confidence bands (also known as uniform bands), which take multiple-comparison
issues into account, are recommended to be used. Our package provides the
construction of simultaneous confidence bands when estimating STEs.

##  3 Software functionality

The CausalMetaR package can be downloaded from CRAN and loaded in R as
follows:

    install.packages("CausalMetaR")
    library("CausalMetaR")

The package has four main functions: (1) `ATE_internal` estimates ATEs in
internal target populations, (2) `ATE_external` estimates the ATE in an
external target population, (3) `STE_internal` estimates STEs in internal
target populations, and (4) `STE_external` estimates STEs in an external
target population. The main arguments used in these functions are summarized
in Table 2.

The following subsections detail how to specify the data and working models
for these functions as well as the output of these functions.

Table 2: Summary of the arguments in the main functions in CausalMetaR.  Argument | Description | Requirements
---|---|---
Data |  |
`Y` | Outcome | Vector
`S` | Source | Categorical vector
`A` | Treatment | Binary vector
`X` | Covariates | Data frame
`EM`a | Effect modifier | Categorical vector
`X_external`b | Covariates in external population | Data frame
`EM_external`c | Effect modifier in external population | Categorical vector
Nuisance models |  |
`outcome_model_args` | Outcome model arguments | List for `SuperLearner`
`source_model` | Source model specification |  `"MN.glmnet"` or `"MN.nnet"`
`source_model_args` | Source model arguments | List for `SuperLearner`
`treatment_model_type` | Treatment model type |  `"joint"` or `"separate"`
`treatment_model_args` | Treatment model arguments | List for `SuperLearner`
`external_model_args`b | External model arguments | List for `SuperLearner`
Cross-fitting options |  |
`cross_fitting` | Use of cross-fitting |  `TRUE` or `FALSE`
`replications` | Number of replications | Integer
aOnly applicable for the STE_internal and STE_external functions
bOnly applicable for the ATE_external and STE_external functions
cOnly applicable for the STE_external function

###  3.1 Data Specification

The main functions in CausalMetaR require users to supply R data frames (or
vectors) containing data on the outcome, source index, treatment, and
covariates. Each of these data frames (or vectors) must contain
$n=\sum_{s=1}^{m}n_{s}$ rows. The argument `Y` specifies the outcome data,
which may be a continuous or binary vector. The data source indicator is
specified by the argument `S`, which can be a vector of characters or
integers. The argument `A` specifies the treatment data, which must be binary
and coded as 0/1. The argument `X` specifies the baseline covariate data,
which may contain continuous, binary, and/or categorical covariates.

There are three additional requirements on the input data sets for some of the
functions in CausalMetaR. First, when estimating STEs, `EM` (and `EM_external`
when using `STE_external`) should be provided as a categorical effect modifier
of interest. Note that `X` should not include this effect modifier. That is,
`X` is defined slightly differently here than the $X$ defined in Section 2
(i.e., $X$={`X`, `EM`}). Second, when estimating treatment effects in an
external target population, users must provide data on the baseline covariates
in the target population, specified by the argument `X_external`. The ordering
of the columns of `X_external` must be the same as that of `X`.

###  3.2 Nuisance models specification

Recall that the CausalMetaR package generally uses SL to estimate the working
models via the SuperLearner R package [41]. The following subsections describe
how to specify the four different working models.

####  3.2.1 Outcome model

The outcome model is specified by the argument `outcome_model_args`, which is
a list that supplies arguments to the SL method (specifically the
`SuperLearner` function in the SuperLearner package). Users should specify the
type of model(s) considered by SL through the `SL.library` component in the
list. For example, setting `SL.library` to `"SL.glm"` includes a generalized
linear model and setting `SL.library` to `"SL.glmnet"` includes penalized
generalized linear models. Users should generally specify whether the outcome
is binary or continuous through the `family` component of the list, where
`gaussian()` indicates a continuous outcome and `binomial()` indicates a
binary outcome.

For example, we can specify fitting a linear regression model with a Lasso
penalty in the `ATE_external` function as follows111Throughout, the inclusion
of ... in the example code denotes the inclusion of all other necessary
arguments to complete the call to the function.:

    ATE_external(...,
            outcome_model_args = list(family = gaussian(), SL.library = "SL.glmnet"))

####  3.2.2 Source model

Recall that the source model has a categorical outcome. Since the current
version of the SuperLearner package (version 2.0-28) does not fully support
multinomial models, the CausalMetaR package has the following two options for
specifying the source model. If users set `source_model` to `"MN.glmnet"`, the
package will fit a (penalized) multinomial logistic regression model based on
the glmnet R package [44, 45]. If users set `source_model` to `"MN.nnet"`
which results in a multinomial log-linear model via neural networks based on
the nnet R package [46].

####  3.2.3 Treatment model

The treatment model is specified by the arguments `treatment_model_args` and
`treatment_model_type`. Users should supply arguments to the SL method through
the argument `treatment_model_type`, similar to the case of the
`outcome_model_args` in the outcome model. Users can specify whether to fit a
treatment model separately in each data source or whether to fit a single
treatment model across all sources through the argument
`treatment_model_type`. Setting `treatment_model_type` to `"separate"` results
in fitting $\Pr(A=1|X,S=s)$ by regressing $A$ on $X$ in a specific data source
$s$. Setting `treatment_model_type` to `"joint"` results in fitting a single
treatment model that includes the source as a categorical predictor, i.e.,
regressing $A$ on $S$ and $X$ in all the data sources.

For example, we can specify fitting a joint treatment model (across all
sources) based on a logistic regression model with a Lasso penalty in the
`ATE_external` function as follows:

    ATE_external(...,
            treatment_model_args = list(family = binomial(), SL.library = "SL.glmnet"),
            treatment_model_type = "joint")

####  3.2.4 External model

Recall that specifying an external model is needed for the `ATE_external` and
`STE_external` functions. The argument `external_model_args` specifies the
external model in the same manner as the treatment and outcome models.

###  3.3 Cross-fitting specification

To allow for the use of data-adaptive methods (e.g., machine learning
techniques) to model the nuisance parameters, sample splitting and cross-
fitting are required in the estimation [43]. The use of sample splitting and
cross-fitting is specified by the arguments `cross_fitting` and `replicates`.
When `cross_fitting` is set to `TRUE`, the package estimates the target
parameters through stratified sample splitting and cross-fitting. The argument
`replications` specifies the number of cross-fitting replications. To achieve
non-sensitive (regarding the sample splitting) results, we recommend users set
`replications` to `100L` [47]. Because cross-fitting can have high
computational cost, we recommend users set `cross_fitting` to `FALSE` when
users opt for parametric models to model the nuisance parameters or when the
sample size of multi-source data is small.

###  3.4 Output

The four main functions in CausalMetaR return lists which include data frames
containing the potential outcome mean estimates (`df_A0` and `df_A1`) and
treatment effect estimates (`df_dif`). These data frames include the point
estimates, standard error (SE) estimates, 95% confidence intervals (CIs), and
95% simultaneous confidence bands (SBCs) when STEs are estimated. Unlike the
CIs which reflect a range of values for each (subgroup) treatment effect
estimate individually, the SCBs reflect a range of values for all STE
estimates simultaneously. Users can also access the fitted working models
through the `fit_outcome`, `fit_source`, `fit_treatment`, and `fit_external`
components of the output. Though those working models are not accessible in
the output when cross-fitting is conducted, users can try fitting models
without cross-fitting to check the working models first.

The output of these functions have corresponding `print` and `summary`
methods. Moreover, the output of the `ATE_internal` and `STE_internal`
functions have corresponding `plot` methods which generate forest plots based
on the metafor package [48]. These functions are illustrated in the complete
example in the following section.

##  4 Example

In this section, we illustrate an application of CausalMetaR to an example
data set in the package.

The multi-source data set, `dat_multisource`, is a data frame consisting of
data from 3 sources with sample sizes of 2,312, 1,147, and 592 respectively.
This data frame has columns for a continuous outcome (`Y`), source indicator
(`S`), binary treatment (`A`), effect modifier with 5 categories (`EM`), and
nine continuous covariates (`X2`, …, `X10`). The external data set,
`dat_external`, is a data frame consisting of the external data in a
population with a sample size of 10,083. It has columns for the effect
modifier (`EM`) and the nine covariates (`X2`, …, `X10`).

We estimate the ATE and STEs in the three internal target populations and the
external target population. We use SL with (penalized) GLMs and neural
networks to estimate the outcome, treatment, and external models. We use
separate (source-specific) treatment models, and we use the default
multinomial logistic regression model for the source model. We conducted
cross-fitting with, for simplicity, 5 replications. Each of the analyses only
takes a few minutes to run on a standard laptop computer (8 GB RAM, 1.1 GHz
Quad-Core Intel Core i5 processor).

We can apply the CausalMetaR package to perform this analysis as follows. We
begin with specifying the working models:

    outcome_model_args <- list(family = gaussian(),
                               SL.library = c("SL.glmnet", "SL.nnet", "SL.glm"))
    treatment_model_args <- list(family = binomial(),
                                 SL.library = c("SL.glmnet", "SL.nnet", "SL.glm"))
    external_model_args = list(family = binomial(),
                               SL.library = c("SL.glmnet", "SL.nnet", "SL.glm"))

Note that we do not explicitly specify the source model here because we will
use the default source model.

The following subsections present the R code and output for estimating the
ATEs and STEs in the internal and external target populations. In the
supporting information, we present additional output from these analyses
(e.g., the potential outcome means).

###  4.1 Estimating the ATE in the external target population

We apply the `ATE_external` function to estimate the ATE in the external
target population. Since cross-validation is used when fitting the working
models (which involves random sampling), we set a random number set for
reproducibility.

    set.seed(1234)
    result_ae <- ATE_external(
      Y = dat_multisource$Y,
      S = dat_multisource$S,
      A = dat_multisource$A,
      X = dat_multisource[, 1:10],
      X_external = dat_external[, 1:10],
      outcome_model_args = outcome_model_args,
      treatment_model_args = treatment_model_args,
      external_model_args = external_model_args,
      cross_fitting = TRUE,
      replications = 5)

The printed output is given below. It reports an ATE estimate of 6.63 [95% CI:
5.94, 7.32] in the target population.

    AVERAGE TREATMENT EFFECT ESTIMATES IN AN EXTERNAL POPULATION

    Treatment effect (mean difference) estimates:
    ---------------------------------------------
     Estimate     SE Lower 95% CI Upper 95% CI
       6.6294 0.1535       5.8616       7.3972

###  4.2 Estimating ATEs in the internal target populations

We can use the `ATE_internal` function to estimate the ATEs in the internal
target populations as follows.

    result_ai <- ATE_internal(
      Y = dat_multisource$Y,
      S = dat_multisource$S,
      A = dat_multisource$A,
      X = dat_multisource[, 1:10],
      outcome_model_args = outcome_model_args,
      treatment_model_args = treatment_model_args,
      cross_fitting = TRUE,
      replications = 5)

The printed output is given below. We estimate an ATE of 6.59 [95% CI: 6.31,
6.88] in the population of source A, 7.76 [95% CI: 7.49, 8.03] in the
population of source B, and 7.25 [95% CI: 6.99, 7.51] in the population of
source 3.

    AVERAGE TREATMENT EFFECT ESTIMATES IN INTERNAL POPULATIONS

    Treatment effect (mean difference) estimates:
    ---------------------------------------------
     Source Estimate     SE Lower 95% CI Upper 95% CI
          A   6.5874 0.1903       6.2145       6.9603
          B   7.7556 0.2577       7.2506       8.2606
          C   7.2916 0.3594       6.5872       7.9960

###  4.3 Estimating STEs in the external target population

Next, we apply the `STE_external` function to estimate the STEs in the
external target population as follows.

    result_se <- STE_external(
      Y = dat_multisource$Y,
      S = dat_multisource$S,
      A = dat_multisource$A,
      X = dat_multisource[, 2:10],
      EM = dat_multisource$EM,
      X_external = dat_external[, 2:10],
      EM_external = dat_external$EM,
      outcome_model_args = outcome_model_args,
      treatment_model_args = treatment_model_args,
      external_model_args = external_model_args,
      cross_fitting = TRUE,
      replications = 5)

The printed output is given below. The STE estimates range from 5.41 [95% CI:
4.83, 6.00] (in subgroup e) to 7.58 [95% CI: 6.99, 8.17] (in subgroup c).

    SUBGROUP TREATMENT EFFECT ESTIMATES IN AN EXTERNAL POPULATION

    Treatment effect (mean difference) estimates:
    ---------------------------------------------
     Subgroup Estimate     SE Lower 95% CI Upper 95% CI Lower 95% SCB Upper 95% SCB
            a   7.0787 0.3563       5.9088       8.2485        5.5453        8.6121
            b   5.5207 0.2321       4.5764       6.4650        4.2830        6.7585
            c   7.5709 0.1805       6.7382       8.4037        6.4794        8.6625
            d   6.5748 0.2253       5.6446       7.5051        5.3556        7.7941
            e   5.3741 0.3382       4.2343       6.5139        3.8802        6.8681

###  4.4 Estimating STEs in the internal target populations

Last, we estimate the STEs in the internal target populations by using the
`STE_internal` function.

    result_si <- STE_internal(
      Y = dat_multisource$Y,
      S = dat_multisource$S,
      A = dat_multisource$A,
      X = dat_multisource[, 2:10],
      EM = dat_multisource$EM,
      outcome_model_args = outcome_model_args,
      treatment_model_args = treatment_model_args,
      cross_fitting = TRUE,
      replications = 5)

The printed output for the STE estimates is given below.

    SUBGROUP TREATMENT EFFECT ESTIMATES IN INTERNAL POPULATIONS

    Treatment effect (mean difference) estimates:
    ---------------------------------------------
     Source Subgroup Estimate     SE Lower 95% CI Upper 95% CI Lower 95% SCB Upper 95% SCB
          A        a   6.9197 0.5001       5.9395       7.8999        5.6345        8.2050
                   b   5.4340 0.3681       4.7126       6.1555        4.4880        6.3801
                   c   7.5452 0.3097       6.9383       8.1522        6.7493        8.3411
                   d   6.5053 0.3630       5.7939       7.2168        5.5724        7.4382
                   e   5.4595 0.5215       4.4373       6.4816        4.1192        6.7998
          B        a   8.2134 0.7554       6.7328       9.6939        6.2720       10.1547
                   b   6.8396 0.5381       5.7850       7.8942        5.4567        8.2225
                   c   8.7995 0.4232       7.9699       9.6290        7.7118        9.8872
                   d   7.7098 0.4529       6.8223       8.5974        6.5460        8.8737
                   e   6.4405 0.6975       5.0734       7.8076        4.6479        8.2332
          C        a   8.0544 1.2049       5.6929      10.4159        4.9579       11.1509
                   b   6.2151 0.6711       4.8998       7.5304        4.4904        7.9398
                   c   8.2620 0.6426       7.0026       9.5215        6.6106        9.9135
                   d   7.1427 0.6538       5.8612       8.4242        5.4624        8.8231
                   e   6.0910 0.8718       4.3823       7.7997        3.8504        8.3316

To generate a forest plot of the STEs in the internal target populations, we
can run the command `plot(result_si)` which produces Figure 3. Users can set
the argument `use_scb` to `TRUE` to illustrate SCBs instead of CIs in the
forest plot. Further options for customizing the forest plot are detailed in
the package help file for `plot.STE_internal`.

Figure 3: Forest plot of the STEs in the internal target populations.

##  5 Discussion

The CausalMetaR package implements approaches to estimate causal effects in
internal and external target populations from multi-source data. The
estimators implemented in the package are (i) efficient in the sense that they
attain the smallest possible asymptotic variance under some mild regularity
conditions, and (ii) doubly robust in the sense that the estimators can still
be consistent and asymptotically normally distributed even if some of the
working models are not correctly specified. Users of the package can employ a
number of different modelling approaches to estimate the working models,
ranging from parametric approaches such as generalized linear models to highly
flexible machine learning approaches such as neural networks.

The package implements the methods developed by Dahabreh et al. [35],
Robertson et al. [36] and Wang et al.[38]. Such causally-interpretable meta-
analyses can be easily adapted to solve many real-world problems, such as
estimating causal effects when hybrid or external control is used in drug
evaluation [49]. Other approaches for performing causally interpretable meta-
analyses have been proposed. Vo et al. [50, 51] developed estimators of
average treatment effects in internal source populations for individual
participant data (IPD) meta-analyses with case-mix heterogeneity. However,
these approaches are not doubly robust and do not consider external target
populations. Moreover, IPD network meta-analysis approaches have been
developed to estimate a global treatment importance metric and heterogeneous
treatment effects in the entire multi-source population [52, 53, 54]. These
approaches are not directly comparable to those implemented in CausalMetaR
because they do not pertain to the same target populations.

In this work, users must designate a categorical effect modifier of interest.
This applies to cases where the users have strong a priori knowledge of which
variables are the effect modifiers and are interested in certain of them. When
the effect modifiers are unknown, one can use data-driven methods to explore
the effect modifier and proceed with the analysis [55, 56, 57]. Furthermore,
The assumption A4 is untestable and may be too strong in some scenarios. Such
an assumption can be replaced by weaker ones, such as the transportability
assumption of relative effect measures [58, 59]. In addition, when
practitioners have prior information about the covariates (such as a variable
is an interaction of other main terms), one can integrate this information
into the nuisance models. Such integration would potentially improve the
estimation accuracy [60, 61, 62, 63, 64][adjust citation when available].

While the current version of CausalMetaR (i.e., version 0.1.1) is stable and
complete, we intend to add several features in future versions of the package.
In particular, we aim to include methods that estimate STEs in internal and
external target populations when the effect modifier ($\widetilde{X}$) is
continuous [65, 66]. Additionally, we would like to include methods that
estimate quantile treatment effects in internal and external target
populations [67, 68]. However, methodological work establishing such methods
is needed first.

## Authours contribution

GW, SM, YL: Conceptualization, Methodology, Investigation, Software,
Validation, Visualization, Project administration, Drafting. IJD:
Conceptualization, Methodology. All authors approved the final version for
publication.

## Acknowledgements

GW and IJD was supported by the Patient-Centered Outcomes Research Institute
(PCORI) awards ME-2021C2-22365. SM was supported by the National Science
Foundation Graduate Research Fellowship Program under Grant No. DGE2140743.
Any opinions, findings, conclusions, or recommendations expressed in this
material are those of the authors and do not necessarily reflect the views of
the above funding agencies.

## Supporting Information

Additional supporting information can be found online in the Supporting
Information section at the end of this article.

## Conflict of interest

The authors declare no potential conflict of interest.

## Data availability statement

The source code of the software and data presented in this paper are publicly
available on GitHub (https://github.com/ly129/CausalMetaR).

## Highlights

What is already known

  * •

Several methods have been recently developed to estimate causal effects in
well-defined target populations from multi-source data (e.g., primary studies
in a meta-analysis).

  * •

There are no existing software tools implementing these methods.

What is new

  * •

We present the free, open-source CausalMetaR package for estimating well-
defined causal effects from multi-source data.

  * •

CausalMetaR facilitates estimating average and subgroup treatment effects in
internal target populations and external target populations.

  * •

CausalMetaR allows users to use machine-learning methods and cross-fitting to
estimate the target parameters, and the estimators are doubly robust and non-
parametrically efficient.

Potential impact for Research Synthesis Methods readers

  * •

CausalMetaR can help evidence synthesis practitioners perform more rigorous
causal analyses

## References

  * [1] Issa J Dahabreh et al.  “Towards causally interpretable meta-analysis: transporting inferences from multiple randomized trials to a new target population”  In _Epidemiology (Cambridge, Mass.)_ 31.3 NIH Public Access, 2020, pp. 334
  * [2] Sarah E Robertson et al.  “Center-specific causal inference with multicenter trials: reinterpreting trial evidence in the context of each participating center”  In _arXiv preprint arXiv:2104.05905_ , 2021
  * [3] Issa J Dahabreh et al.  “Efficient and robust methods for causally interpretable meta-analysis: Transporting inferences from multiple randomized trials to a target population”  In _Biometrics_ Wiley Online Library, 2023
  * [4] Guanbo Wang, Alexander Levis, Jon Steingrimsson and Issa Dahabreh  “Efficient estimation of subgroup treatment effects using multi-source data”  In _arXiv preprint arXiv:2402.02684_ , 2024  URL: https://arxiv.org/abs/2402.02684
  * [5] Yi Lian, Guanbo Wang, Sean McGrath and Issa Dahabreh  “CausalMetaR: Causally Interpretable Meta-Analysis” R package version 0.1.1, 2024  URL: https://CRAN.R-project.org/package=CausalMetaR
  * [6] James M Robins and Sander Greenland  “Causal inference without counterfactuals: comment”  In _Journal of the American Statistical Association_ 95.450 JSTOR, 2000, pp. 431–435
  * [7] Eric Polley, Erin LeDell, Chris Kennedy and Mark van der Laan  “SuperLearner: Super Learner Prediction” R package version 2.0-28, 2021  URL: https://CRAN.R-project.org/package=SuperLearner
  * [8] Victor Chernozhukov et al.  “Double/debiased machine learning for treatment and structural parameters”  In _The Econometrics Journal_ 21.1, 2018, pp. C1–C68  DOI: 10.1111/ectj.12097
  * [9] Paul N Zivich and Alexander Breskin  “Machine learning for causal inference: on the use of cross-fit estimators”  In _Epidemiology (Cambridge, Mass.)_ 32.3 NIH Public Access, 2021, pp. 393
  * [10] Jerome Friedman, Robert Tibshirani and Trevor Hastie  “Regularization Paths for Generalized Linear Models via Coordinate Descent”  In _Journal of Statistical Software_ 33.1, 2010, pp. 1–22  DOI: 10.18637/jss.v033.i01
  * [11] J. Tay, Balasubramanian Narasimhan and Trevor Hastie  “Elastic Net Regularization Paths for All Generalized Linear Models”  In _Journal of Statistical Software_ 106.1, 2023, pp. 1–31  DOI: 10.18637/jss.v106.i01
  * [12] W.. Venables and B.. Ripley  “Modern Applied Statistics with S” ISBN 0-387-95457-0  New York: Springer, 2002  URL: https://www.stats.ox.ac.uk/pub/MASS4/
  * [13] Victor Chernozhukov et al.  “Double/debiased machine learning for treatment and structural parameters”  In _The Econometrics Journal_ 21.1 Wiley Online Library, 2018, pp. C1–C68
  * [14] Wolfgang Viechtbauer  “Conducting meta-analyses in R with the metafor package”  In _Journal of Statistical Software_ 36.3, 2010, pp. 1–48  DOI: 10.18637/jss.v036.i03
  * [15] Guanbo Wang et al.  “Evaluating hybrid controls methodology in early-phase oncology trials: A simulation study based on the MORPHEUS-UC trial”  In _Pharmaceutical Statistics_ n/a.n/a, 2023  DOI: https://doi.org/10.1002/pst.2336
  * [16] Tat-Thang Vo, Raphael Porcher, Anna Chaimani and Stijn Vansteelandt  “A novel approach for identifying and addressing case-mix heterogeneity in individual participant data meta-analysis”  In _Research synthesis methods_ 10.4 Wiley Online Library, 2019, pp. 582–596
  * [17] Tat-Thang Vo, Raphaël Porcher and Stijn Vansteelandt  “Assessing the impact of case-mix heterogeneity in individual participant data meta-analysis: Novel use of I 2 statistic and prediction interval”  In _Research Methods in Medicine & Health Sciences_ 2.1 SAGE Publications Sage UK: London, England, 2021, pp. 12–30
  * [18] Guanbo Wang et al.  “Estimating treatment importance in multidrug-resistant tuberculosis using Targeted Learning: An observational individual patient data network meta-analysis”  In _Biometrics_ 76.3 Wiley Online Library, 2020, pp. 1007–1016
  * [19] Yan Liu et al.  “Modeling treatment effect modification in multidrug-resistant tuberculosis in an individual patient data meta-analysis”  In _Statistical methods in medical research_ 31.4 SAGE Publications Sage UK: London, England, 2022, pp. 689–705
  * [20] Arman Alam Siddique et al.  “Causal inference with multiple concurrent medications: A comparison of methods and an application in multidrug-resistant tuberculosis”  In _Statistical methods in medical research_ 28.12 SAGE Publications Sage UK: London, England, 2019, pp. 3534–3549
  * [21] Falco J Bargagli-Stoffi, Riccardo Cadei, Kwonsang Lee and Francesca Dominici  “Causal Rule Ensemble: Interpretable Discovery and Inference of Heterogeneous Causal Effects”  In _arXiv preprint arXiv:2009.09036_ , 2020
  * [22] Che Ngufor et al.  “Identifying treatment heterogeneity in atrial fibrillation using a novel causal machine learning method”  In _American heart journal_ 260 Elsevier, 2023, pp. 124–140
  * [23] Ajmery Jaman et al.  “Penalized G-estimation for effect modifier selection in the structural nested mean models for repeated outcomes”  In _arXiv preprint arXiv:2402.00154_ , 2024  URL: https://arxiv.org/abs/2402.00154
  * [24] Issa J Dahabreh, Sarah E Robertson and Jon A Steingrimsson  “Learning about treatment effects in a new target population under transportability assumptions for relative effect measures”  In _arXiv preprint arXiv:2202.11622_ , 2022
  * [25] Guanbo Wang, Alexander Levis, Jon Steingrimsson and Issa Dahabreh  “Causal inference under transportability assumptions for conditional relative effect measures”  In _arXiv preprint arXiv:2402.02702_ , 2024  URL: https://arxiv.org/abs/2402.02702
  * [26] Guanbo Wang et al.  “A general framework for formulating structured variable selection”  In _Transactions on Machine Learning Research_ , 2024  URL: https://openreview.net/forum?id=cvOpIhQQMN
  * [27] Audrey Bouchard et al.  “Predictive Factors of Detectable Viral Load in HIV-Infected Patients”  In _AIDS Research and Human Retroviruses_ 38.7 Mary Ann Liebert, Inc., publishers 140 Huguenot Street, 3rd Floor New …, 2022, pp. 552–560
  * [28] Guanbo Wang et al.  “Integrating complex selection rules into the latent overlapping group Lasso for constructing coherent prediction models”  In _arXiv preprint arXiv:2206.05337_ , 2024  URL: https://arxiv.org/abs/2206.05337
  * [29] Guanbo Wang  “Review 1:” Antibiotic Prescribing in Remote Versus Face-to-Face Consultations for Acute Respiratory Infections in English Primary Care: An Observational Study Using TMLE””  In _Rapid Reviews Infectious Diseases_ The MIT Press, 2023
  * [30] Guanbo Wang et al.  “Structured Learning in Time-dependent Cox Models”  In _arXiv preprint arXiv:2306.12528_ , 2023
  * [31] Sören R Künzel, Jasjeet S Sekhon, Peter J Bickel and Bin Yu  “Metalearners for estimating heterogeneous treatment effects using machine learning”  In _Proceedings of the national academy of sciences_ 116.10 National Acad Sciences, 2019, pp. 4156–4165
  * [32] Guanbo Wang, Siyi Liu and Shu Yang  “Continuous-time structural failure time model for intermittent treatment”  In _arXiv preprint arXiv:2401.15806_ , 2024  URL: https://arxiv.org/abs/2401.15806
  * [33] Sergio Firpo  “Efficient semiparametric estimation of quantile treatment effects”  In _Econometrica_ 75.1 Wiley Online Library, 2007, pp. 259–276
  * [34] Shuo Sun, Erica EM Moodie and Johanna G Nešlehová  “Causal inference for quantile treatment effects”  In _Environmetrics_ 32.4 Wiley Online Library, 2021, pp. e2668

## References

  * [35] Issa J Dahabreh et al.  “Towards causally interpretable meta-analysis: transporting inferences from multiple randomized trials to a new target population”  In _Epidemiology (Cambridge, Mass.)_ 31.3 NIH Public Access, 2020, pp. 334
  * [36] Sarah E Robertson et al.  “Center-specific causal inference with multicenter trials: reinterpreting trial evidence in the context of each participating center”  In _arXiv preprint arXiv:2104.05905_ , 2021
  * [37] Issa J Dahabreh et al.  “Efficient and robust methods for causally interpretable meta-analysis: Transporting inferences from multiple randomized trials to a target population”  In _Biometrics_ Wiley Online Library, 2023
  * [38] Guanbo Wang, Alexander Levis, Jon Steingrimsson and Issa Dahabreh  “Efficient estimation of subgroup treatment effects using multi-source data”  In _arXiv preprint arXiv:2402.02684_ , 2024  URL: https://arxiv.org/abs/2402.02684
  * [39] Yi Lian, Guanbo Wang, Sean McGrath and Issa Dahabreh  “CausalMetaR: Causally Interpretable Meta-Analysis” R package version 0.1.1, 2024  URL: https://CRAN.R-project.org/package=CausalMetaR
  * [40] James M Robins and Sander Greenland  “Causal inference without counterfactuals: comment”  In _Journal of the American Statistical Association_ 95.450 JSTOR, 2000, pp. 431–435
  * [41] Eric Polley, Erin LeDell, Chris Kennedy and Mark van der Laan  “SuperLearner: Super Learner Prediction” R package version 2.0-28, 2021  URL: https://CRAN.R-project.org/package=SuperLearner
  * [42] Victor Chernozhukov et al.  “Double/debiased machine learning for treatment and structural parameters”  In _The Econometrics Journal_ 21.1, 2018, pp. C1–C68  DOI: 10.1111/ectj.12097
  * [43] Paul N Zivich and Alexander Breskin  “Machine learning for causal inference: on the use of cross-fit estimators”  In _Epidemiology (Cambridge, Mass.)_ 32.3 NIH Public Access, 2021, pp. 393
  * [44] Jerome Friedman, Robert Tibshirani and Trevor Hastie  “Regularization Paths for Generalized Linear Models via Coordinate Descent”  In _Journal of Statistical Software_ 33.1, 2010, pp. 1–22  DOI: 10.18637/jss.v033.i01
  * [45] J. Tay, Balasubramanian Narasimhan and Trevor Hastie  “Elastic Net Regularization Paths for All Generalized Linear Models”  In _Journal of Statistical Software_ 106.1, 2023, pp. 1–31  DOI: 10.18637/jss.v106.i01
  * [46] W.. Venables and B.. Ripley  “Modern Applied Statistics with S” ISBN 0-387-95457-0  New York: Springer, 2002  URL: https://www.stats.ox.ac.uk/pub/MASS4/
  * [47] Victor Chernozhukov et al.  “Double/debiased machine learning for treatment and structural parameters”  In _The Econometrics Journal_ 21.1 Wiley Online Library, 2018, pp. C1–C68
  * [48] Wolfgang Viechtbauer  “Conducting meta-analyses in R with the metafor package”  In _Journal of Statistical Software_ 36.3, 2010, pp. 1–48  DOI: 10.18637/jss.v036.i03
  * [49] Guanbo Wang et al.  “Evaluating hybrid controls methodology in early-phase oncology trials: A simulation study based on the MORPHEUS-UC trial”  In _Pharmaceutical Statistics_ n/a.n/a, 2023  DOI: https://doi.org/10.1002/pst.2336
  * [50] Tat-Thang Vo, Raphael Porcher, Anna Chaimani and Stijn Vansteelandt  “A novel approach for identifying and addressing case-mix heterogeneity in individual participant data meta-analysis”  In _Research synthesis methods_ 10.4 Wiley Online Library, 2019, pp. 582–596
  * [51] Tat-Thang Vo, Raphaël Porcher and Stijn Vansteelandt  “Assessing the impact of case-mix heterogeneity in individual participant data meta-analysis: Novel use of I 2 statistic and prediction interval”  In _Research Methods in Medicine & Health Sciences_ 2.1 SAGE Publications Sage UK: London, England, 2021, pp. 12–30
  * [52] Guanbo Wang et al.  “Estimating treatment importance in multidrug-resistant tuberculosis using Targeted Learning: An observational individual patient data network meta-analysis”  In _Biometrics_ 76.3 Wiley Online Library, 2020, pp. 1007–1016
  * [53] Yan Liu et al.  “Modeling treatment effect modification in multidrug-resistant tuberculosis in an individual patient data meta-analysis”  In _Statistical methods in medical research_ 31.4 SAGE Publications Sage UK: London, England, 2022, pp. 689–705
  * [54] Arman Alam Siddique et al.  “Causal inference with multiple concurrent medications: A comparison of methods and an application in multidrug-resistant tuberculosis”  In _Statistical methods in medical research_ 28.12 SAGE Publications Sage UK: London, England, 2019, pp. 3534–3549
  * [55] Falco J Bargagli-Stoffi, Riccardo Cadei, Kwonsang Lee and Francesca Dominici  “Causal Rule Ensemble: Interpretable Discovery and Inference of Heterogeneous Causal Effects”  In _arXiv preprint arXiv:2009.09036_ , 2020
  * [56] Che Ngufor et al.  “Identifying treatment heterogeneity in atrial fibrillation using a novel causal machine learning method”  In _American heart journal_ 260 Elsevier, 2023, pp. 124–140
  * [57] Ajmery Jaman et al.  “Penalized G-estimation for effect modifier selection in the structural nested mean models for repeated outcomes”  In _arXiv preprint arXiv:2402.00154_ , 2024  URL: https://arxiv.org/abs/2402.00154
  * [58] Issa J Dahabreh, Sarah E Robertson and Jon A Steingrimsson  “Learning about treatment effects in a new target population under transportability assumptions for relative effect measures”  In _arXiv preprint arXiv:2202.11622_ , 2022
  * [59] Guanbo Wang, Alexander Levis, Jon Steingrimsson and Issa Dahabreh  “Causal inference under transportability assumptions for conditional relative effect measures”  In _arXiv preprint arXiv:2402.02702_ , 2024  URL: https://arxiv.org/abs/2402.02702
  * [60] Guanbo Wang et al.  “A general framework for formulating structured variable selection”  In _Transactions on Machine Learning Research_ , 2024  URL: https://openreview.net/forum?id=cvOpIhQQMN
  * [61] Audrey Bouchard et al.  “Predictive Factors of Detectable Viral Load in HIV-Infected Patients”  In _AIDS Research and Human Retroviruses_ 38.7 Mary Ann Liebert, Inc., publishers 140 Huguenot Street, 3rd Floor New …, 2022, pp. 552–560
  * [62] Guanbo Wang et al.  “Integrating complex selection rules into the latent overlapping group Lasso for constructing coherent prediction models”  In _arXiv preprint arXiv:2206.05337_ , 2024  URL: https://arxiv.org/abs/2206.05337
  * [63] Guanbo Wang  “Review 1:” Antibiotic Prescribing in Remote Versus Face-to-Face Consultations for Acute Respiratory Infections in English Primary Care: An Observational Study Using TMLE””  In _Rapid Reviews Infectious Diseases_ The MIT Press, 2023
  * [64] Guanbo Wang et al.  “Structured Learning in Time-dependent Cox Models”  In _arXiv preprint arXiv:2306.12528_ , 2023
  * [65] Sören R Künzel, Jasjeet S Sekhon, Peter J Bickel and Bin Yu  “Metalearners for estimating heterogeneous treatment effects using machine learning”  In _Proceedings of the national academy of sciences_ 116.10 National Acad Sciences, 2019, pp. 4156–4165
  * [66] Guanbo Wang, Siyi Liu and Shu Yang  “Continuous-time structural failure time model for intermittent treatment”  In _arXiv preprint arXiv:2401.15806_ , 2024  URL: https://arxiv.org/abs/2401.15806
  * [67] Sergio Firpo  “Efficient semiparametric estimation of quantile treatment effects”  In _Econometrica_ 75.1 Wiley Online Library, 2007, pp. 259–276
  * [68] Shuo Sun, Erica EM Moodie and Johanna G Nešlehová  “Causal inference for quantile treatment effects”  In _Environmetrics_ 32.4 Wiley Online Library, 2021, pp. e2668

Supporting Information

## Additional results from the example

In this section, we present additional results from the analyses described in
Section 4 of the main text. Specifically, we illustrate the summary— methods
corresponding to the

Recall from Section 4 in the main text that the outputs of the

### Estimating the ATE in the external target population

Running

    AVERAGE TREATMENT EFFECT ESTIMATES IN AN EXTERNAL POPULATION

    Treatment effect (mean difference) estimates:
    ---------------------------------------------
     Estimate     SE Lower 95% CI Upper 95% CI
       6.6294 0.1535       5.8616       7.3972

    Potential outcome mean estimates under A = 0:
    ---------------------------------------------
     Estimate     SE Lower 95% CI Upper 95% CI
      19.2657 0.0934      18.6665      19.8648

    Potential outcome mean estimates under A = 1:
    ---------------------------------------------
     Estimate     SE Lower 95% CI Upper 95% CI
      25.8961 0.1214      25.2132      26.5790

    SuperLearner libraries used:
    ----------------------------
    Outcome model: SL.glmnet, SL.nnet, SL.glm
    Treatment model: SL.glmnet, SL.nnet, SL.glm
    Source model: NA (model fit via MN.glmnet)
    External model: SL.glmnet, SL.nnet, SL.glm

### Estimating ATEs in the internal target populations

Running

    AVERAGE TREATMENT EFFECT ESTIMATES IN INTERNAL POPULATIONS

    Treatment effect (mean difference) estimates:
    ---------------------------------------------
     Source Estimate     SE Lower 95% CI Upper 95% CI
          A   6.5874 0.1903       6.2145       6.9603
          B   7.7556 0.2577       7.2506       8.2606
          C   7.2916 0.3594       6.5872       7.9960

    Potential outcome mean estimates under A = 0:
    ---------------------------------------------
     Source Estimate     SE Lower 95% CI Upper 95% CI
          A  19.2107 0.1072      19.0005      19.4209
          B  20.8918 0.1457      20.6062      21.1774
          C  20.2309 0.2191      19.8014      20.6603

    Potential outcome mean estimates under A = 1:
    ---------------------------------------------
     Source Estimate     SE Lower 95% CI Upper 95% CI
          A  25.8043 0.1576      25.4955      26.1131
          B  28.6467 0.2121      28.2310      29.0625
          C  27.5024 0.2784      26.9567      28.0482

    SuperLearner libraries used:
    ----------------------------
    Outcome model: SL.glmnet, SL.nnet, SL.glm
    Treatment model: SL.glmnet, SL.nnet, SL.glm
    Source model: NA (model fit via MN.glmnet)

### Estimating STEs in the external target population

Running

    SUBGROUP TREATMENT EFFECT ESTIMATES IN AN EXTERNAL POPULATION

    Treatment effect (mean difference) estimates:
    ---------------------------------------------
     Subgroup Estimate     SE Lower 95% CI Upper 95% CI Lower 95% SCB Upper 95% SCB
            a   7.0787 0.3563       5.9088       8.2485        5.5453        8.6121
            b   5.5207 0.2321       4.5764       6.4650        4.2830        6.7585
            c   7.5709 0.1805       6.7382       8.4037        6.4794        8.6625
            d   6.5748 0.2253       5.6446       7.5051        5.3556        7.7941
            e   5.3741 0.3382       4.2343       6.5139        3.8802        6.8681

    Potential outcome mean estimates under A = 0:
    ---------------------------------------------
     Subgroup Estimate     SE Lower 95% CI Upper 95% CI Lower 95% SCB Upper 95% SCB
            a  17.3465 0.2519      16.3627      18.3302       16.0571       18.6359
            b  18.3945 0.1641      17.6004      19.1886       17.3537       19.4353
            c  19.2442 0.1277      18.5439      19.9444       18.3263       20.1620
            d  20.3001 0.1593      19.5179      21.0823       19.2748       21.3254
            e  21.2464 0.2391      20.2879      22.2048       19.9901       22.5026

    Potential outcome mean estimates under A = 1:
    ---------------------------------------------
     Subgroup Estimate     SE Lower 95% CI Upper 95% CI Lower 95% SCB Upper 95% SCB
            a  24.4198 0.2972      23.3514      25.4882       23.0194       25.8202
            b  23.9372 0.2205      23.0169      24.8575       22.7310       25.1435
            c  26.8304 0.1749      26.0108      27.6501       25.7561       27.9048
            d  26.8700 0.2141      25.9631      27.7769       25.6813       28.0587
            e  26.6380 0.3242      25.5219      27.7540       25.1751       28.1008

    SuperLearner libraries used:
    ----------------------------
    Outcome model: SL.glmnet, SL.nnet, SL.glm
    Treatment model: SL.glmnet, SL.nnet, SL.glm
    Source model: NA (model fit via MN.glmnet)
    External model: SL.glmnet, SL.nnet, SL.glm

### Estimating STEs in the internal target populations

Running

    SUBGROUP TREATMENT EFFECT ESTIMATES IN INTERNAL POPULATIONS

    Treatment effect (mean difference) estimates:
    ---------------------------------------------
     Source Subgroup Estimate     SE Lower 95% CI Upper 95% CI Lower 95% SCB Upper 95% SCB
          A        a   6.9197 0.5001       5.9395       7.8999        5.6345        8.2050
                   b   5.4340 0.3681       4.7126       6.1555        4.4880        6.3801
                   c   7.5452 0.3097       6.9383       8.1522        6.7493        8.3411
                   d   6.5053 0.3630       5.7939       7.2168        5.5724        7.4382
                   e   5.4595 0.5215       4.4373       6.4816        4.1192        6.7998
          B        a   8.2134 0.7554       6.7328       9.6939        6.2720       10.1547
                   b   6.8396 0.5381       5.7850       7.8942        5.4567        8.2225
                   c   8.7995 0.4232       7.9699       9.6290        7.7118        9.8872
                   d   7.7098 0.4529       6.8223       8.5974        6.5460        8.8737
                   e   6.4405 0.6975       5.0734       7.8076        4.6479        8.2332
          C        a   8.0544 1.2049       5.6929      10.4159        4.9579       11.1509
                   b   6.2151 0.6711       4.8998       7.5304        4.4904        7.9398
                   c   8.2620 0.6426       7.0026       9.5215        6.6106        9.9135
                   d   7.1427 0.6538       5.8612       8.4242        5.4624        8.8231
                   e   6.0910 0.8718       4.3823       7.7997        3.8504        8.3316

    Potential outcome mean estimates under A = 0:
    ---------------------------------------------
     Source Subgroup Estimate     SE Lower 95% CI Upper 95% CI Lower 95% SCB Upper 95% SCB
          A        a  17.4385 0.2571      16.9346      17.9425       16.7777       18.0993
                   b  18.1922 0.1923      17.8152      18.5691       17.6979       18.6864
                   c  19.1656 0.1634      18.8454      19.4859       18.7457       19.5856
                   d  20.1789 0.1905      19.8056      20.5522       19.6894       20.6684
                   e  21.2993 0.2669      20.7762      21.8224       20.6133       21.9853
          B        a  18.7137 0.3794      17.9701      19.4573       17.7387       19.6888
                   b  19.7522 0.2782      19.2070      20.2974       19.0373       20.4671
                   c  20.8026 0.2231      20.3653      21.2400       20.2291       21.3761
                   d  21.6868 0.2306      21.2348      22.1388       21.0941       22.2795
                   e  22.4874 0.3657      21.7706      23.2043       21.5475       23.4274
          C        a  18.4840 0.6568      17.1967      19.7712       16.7961       20.1719
                   b  19.1254 0.3505      18.4385      19.8123       18.2247       20.0261
                   c  19.9303 0.3330      19.2777      20.5830       19.0745       20.7861
                   d  20.8959 0.3365      20.2364      21.5555       20.0311       21.7608
                   e  22.1366 0.4907      21.1748      23.0984       20.8754       23.3978

    Potential outcome mean estimates under A = 1:
    ---------------------------------------------
     Source Subgroup Estimate     SE Lower 95% CI Upper 95% CI Lower 95% SCB Upper 95% SCB
          A        a  24.3761 0.4201      23.5528      25.1994       23.2965       25.4556
                   b  23.6288 0.3126      23.0161      24.2414       22.8254       24.4321
                   c  26.7039 0.2630      26.1883      27.2194       26.0278       27.3799
                   d  26.6744 0.3081      26.0706      27.2782       25.8827       27.4662
                   e  26.7377 0.4499      25.8559      27.6194       25.5814       27.8939
          B        a  27.0322 0.6572      25.7440      28.3203       25.3431       28.7212
                   b  26.5918 0.4625      25.6853      27.4983       25.4032       27.7804
                   c  29.6127 0.3570      28.9131      30.3123       28.6953       30.5301
                   d  29.3991 0.3866      28.6413      30.1569       28.4055       30.3928
                   e  28.9304 0.5916      27.7708      30.0899       27.4099       30.4509
          C        a  26.5474 0.9752      24.6360      28.4587       24.0411       29.0537
                   b  25.3291 0.5673      24.2173      26.4409       23.8712       26.7869
                   c  28.2184 0.5442      27.1518      29.2851       26.8198       29.6171
                   d  28.0628 0.5617      26.9619      29.1638       26.6192       29.5064
                   e  28.2276 0.7459      26.7656      29.6896       26.3106       30.1447

    SuperLearner libraries used:
    ----------------------------
    Outcome model: SL.glmnet, SL.nnet, SL.glm
    Treatment model: SL.glmnet, SL.nnet, SL.glm
    Source model: NA (model fit via MN.glmnet)


* Abbasi-Yadkori et al. (2011) Yasin Abbasi-Yadkori, Dávid Pál, and Casaba Szepesvári.  Improved algorithms for linear stochastic bandits.  _Advances in Neural Information Processing Systems_ , pages 2312–2320, 2011.
  * Abbasi-Yadkori et al. (2012) Yasin Abbasi-Yadkori, Dávid Pál, and Casaba Szepesvári.  Online-to-confidence-set conversions and application to sparse stochastic bandits.  _AISTATS_ , pages 1–9, 2012.
  * Abe et al. (2003) Naoki Abe, Alan W. Biermann, and Philip M. Long.  Reinforcement learning with immediate rewards and linear hypotheses.  _Algorithmica_ , 37(4):236–293, 2003.
  * Audibert et al. (2007) Jean-Yves Audibert, Alexandre B Tsybakov, et al.  Fast learning rates for plug-in classifiers.  _The Annals of statistics_ , 35:608–633, 2007.
  * Auer (2003) Peter Auer.  Using confidence bounds for exploitation-exploration trade-offs.  _Journal of Machine Learning Research_ , pages 397–422, 2003.
  * Auer et al. (2002a) Peter Auer, Nicolò Cesa-Bianchi, and Paul Fischer.  Finite-time analysis of the multiarmed bandit problem.  _Machine Learning_ , 47(2-3):235–256, 2002a.
  * Bastani and Bayati (2019) Hamsa Bastani and Mohsen Bayati.  Online decision making with high-dimensional covariates.  _Operations Research_ , 68(1):276–294, 2019.
  * Bühlmann and Geer (2011) Peter Bühlmann and Sara Van De Geer.  _Statistics for high-dimensional data: methods, theory and applications_.  Springer Science & Business Media, 2011.
  * Candes and Tao (2005) Emmanuel Candes and Terence Tao.  Decoding by linear programming.  _IEEE Transactions on Information Theory_ , 51(12):4203–4215, 2005.
  * Chu et al. (2011) Wei Chu, Lihong Li, Lev Reyzin, and Robert E Schapire.  Contextual bandits with linear payoff functions.  _AISTATS_ , pages 208–214, 2011.
  * Consortium (2009) International Warfarin Pharmacogenetics Consortium.  Estimation of the warfarin dose with clinical and pharmacogenetic data.  _New England Journal of Medicine_ , 360(8):753, 2009.
  * Dani et al. (2008) Varsha Dani, Thomas P. Hayes, and Sham M. Kakade.  Stochastic linear optimization under bandit feedback.  _Conference On Learning Theory_ , pages 355–366, 2008.
  * Fan and Li (2001) Jianqing Fan and Runze Li.  Variable selection via nonconcave penalized likelihood and its oracle properties.  _Journal of the American statistical Association_ , 96:1348–1360, 2001.
  * Goldenshluger and Zeevi (2009) Alexander Goldenshluger and Assaf Zeevi.  Woodroofe’s one-armed bandit problem revisited.  _The Annals of Applied Probability_ , 19(4):1603 – 1633, 2009.
  * Goldenshluger and Zeevi (2013) Alexander Goldenshluger and Assaf Zeevi.  A linear response bandit problem.  _Stochastic Systems_ , 3(1):230 – 261, 2013.
  * Kim and Paik (2019) Gi-Soo Kim and Myunghee Cho Paik.  Doubly-robust lasso bandit.  In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, _Advances in Neural Information Processing Systems_ , volume 32. Curran Associates, Inc., 2019.
  * Oliveira (2016) Roberto Imbuzeiro Oliveira.  The lower tail of random quadratic forms, with applications to ordinary least squares and restricted eigenvalue properties.  _Probability Theory and Related Fields_ , 166(3):1175–1194, 2016.
  * Rudelson and Zhou (2013) Mark Rudelson and Shuheng Zhou.  Reconstruction from anisotropic random measurements.  _IEEE Transactions on Information Theory_ , 59(6):3434–3447, 2013.
  * Rusmevichientong and Tsitsiklis (2010) Paat Rusmevichientong and John N. Tsitsiklis.  Linearly parameterized bandits.  _Mathematics of Operations Research_ , 35(2):395–411, 2010.
  * Tibshirani (1996) Robert Tibshirani.  Regression shrinkage and selection via the lasso.  _Journal of the Royal Statistical Society. Series B (Methodological)_ , pages 267–288, 1996.
  * Vershynin (2012) Roman Vershynin.  Introduction to the non-asymptotic analysis of random matrices.  In Yonina C. Eldar and GittaEditors Kutyniok, editors, _Compressed Sensing: Theory and Applications_ , pages 210–268. Cambridge University Press, 2012.
  * Wainwright (2019) Martin J. Wainwright.  _High-Dimensional Statistics: A Non-Asymptotic Viewpoint_.  Cambridge University Press, 2019.
  * Wang et al. (2018) Xue Wang, Mingcheng Wei, and Tao Yao.  Minimax concave penalized multi-armed bandit model with high-dimensional covariates.  In _Proceedings of the 35th International Conference on Machine Learning_ , volume 80 of _Proceedings of Machine Learning Research_ , pages 5200–5208. PMLR, 10–15 Jul 2018.
  * Zhang et al. (2010) Cun-Hui Zhang et al.  Nearly unbiased variable selection under minimax concave penalty.  _The Annals of statistics_ , 38:894–942, 2010.