{'fraction_non_alphanumeric': 0.043886671294689344, 'fraction_numerical': 0.01323325234293648, 'mean_word_length': 4.64153714355648, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 0, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Causal mediation with instrumental variables

Mediation analysis is a strategy for understanding the mechanisms by which treatments or interventions affect later outcomes. Mediation analysis is frequently applied in randomized trial settings, but typically assumes: a) that randomized assignment is the exposure of interest as opposed to actual take-up of the intervention, and b) no unobserved confounding of the mediator-outcome relationship. In contrast to the rich literature on instrumental variable (IV) methods to estimate a total effect of a non-randomized exposure, there has been almost no research into using IV as an identification strategy in the presence of both exposure-outcome and mediator-outcome unobserved confounding. In response, we define and identify novel estimands -- complier interventional direct and indirect effects (i.e., IV mediational effects) in two scenarios: 1) with a single IV for the exposure, and 2) with two IVs, one for the exposure and another for the mediator, that may be related. We propose nonparametric, robust, efficient estimators, and apply them to a housing voucher experiment.


Introduction
Mediation analysis is a strategy for understanding the mechanisms by which treatments or interventions affect later outcomes. Such treatments or interventions may be randomly assigned, as in randomized controlled trials. Mediation has been examined in many different types of trial settings; e.g., in examining the extent to which a randomized behavioral intervention works to reduce adolescent suicide behavior through improving family functioning (Pineda and Dadds, 2013), quantifying the extent to randomized reductions in air pollution via air purifiers affects cardiovascular biomarkers through DNA hypomethylation (Chen et al., 2016), and understanding how receiving a low-income housing voucher affects later adolescent mental health outcomes by operating through the changes in the school and neighborhood environments (Rudolph et al., 2018). Please see Vo et al. (2020) for a review of mediation analyses in the context of randomized trials.
We use one of the above settings as the motivating example throughout this paper. Specifically, we consider a mediation scenario from the Moving to Opportunity (MTO) study, which was a large-scale trial in which families were randomized to receive a Section 8 housing voucher (the most common form of federal housing assistance in the United States) that they could use to move out of public housing and, instead, rent on the private market (Kling et al., 2007;Sanbonmatsu et al., 2011). We are interested in the effect of moving with the voucher on risk of developing a psychiatric mood disorder during adolescence, possibly operating through the mediator of neighborhood poverty.
Current methods for causal mediation analyses in trial settings are generally limited in at least two aspects. First, current methods typically assume that randomized assignment is the exposure of interest as opposed to actual take-up of the treatment/intervention. Second, they rely on a no-unobserved confounders assumption in terms of the relationship between the mediators and outcome.
Current methods typically consider the following observed data scenario: a vector of random variables O = (W, A, M, Y ) is observed for n individuals, where W represents covariates, A represents randomized assignment, M represents mediators, and Y represents the outcome. In the absence of perfect compliance, the effects of randomized treatment assignment (the intentto-treat effects) may be different from the effects of the treatment actually taken (the as-treated effects) (Hernán and Robins, 2006). For example, in MTO motivating example, noncompliance was relatively common, with between 18-32% of families who received a housing voucher not using it to move, depending on the city (e.g., because of difficulty finding landlords willing to accept the vouchers and other logistical challenges.) Thus, in many cases, like the MTO exampled described above, observed data is more accurately represented by O = (W, A, Z, M, Y ), where Z represents treatment actually taken, which is frequently the exposure of scientific interest. This motivates use of instrumental variable (IV) methods. In the case of non-mediated total effects, one can use an instrumental variable A (which needs to adhere to several assumptions-e.g., randomized conditional on observables, monotonicity, and the exclusion restriction) to identify the effect of the treatment actually taken Z (not randomly assigned) on an outcome Y , where the effect otherwise would not be identifiable due to unobserved confounding (Angrist et al., 1996). Such effects are typically called complier average causal effects (Imbens and Rubin, 1997). The literature on identifying causal estimands with instrumental variables and estimating such parameters is vast (e.g., Angrist and Imbens, 1995;Abadie, 2003;Aronow and Carnegie, 2013;Chernozhukov et al., 2020).
In contrast to the rich literature on instrumental variable methods in the case of total effects, there has been almost no development of IV methods for mediational direct and indirect effects. Previous work by Rudolph et al. (2020b) identified and estimated IV mediational effects in the observed data setting O = (W, A, Z, M, Y ). However, this work was limited in terms of only identifying and estimating the complier direct effect, assuming a known stochastic intervention on the mediator, and considering only a single instrument for the exposure, therefore still requiring the assumption of no unobserved confounding of the mediator-outcome relationship.
The limitation of needing to assume no unobserved confounding of the mediator-outcome relationship undercuts the main motivation for using a randomized design/IVs in the first place, which is to identify the effect of the exposure on the outcome (Z on Y ) in the presence of unobserved confounding, and if unobserved confounding is a concern for the Z − Y relationship, it is likely also a concern for the M − Y relationship. To our knowledge, there has been almost no research into using IV as an identification strategy for both Z and M , the exception being the work of Frölich and Huber (2017). In this work, the authors enumerated identification strategies in such a mediation scenario, all of which necessitate an additional instrument-one instrument for Z and another for M . The observed data can then be written O = (W, A, Z, L, M, Y ), where A is the instrument for Z and where L is the instrument for M . Frölich and Huber (2017) proposed an estimator for a case where the instruments A and L are independent from one another, which may occur only rarely in practice. In addition the authors also assume that the mediator is a function of this L, A, W , and exogenous, unobserved factors, U , where U is a continuous variable with strictly increasing cumulative distribution function, and where this function is strictly monotonic in U (Frölich and Huber, 2017).
To summarize, we know of no approach to estimate complier direct and indirect effects in the following general settings: 1) in the case of a single instrument for the exposure but none for the mediator, and 2) in the case of two, non-independent instruments, one for the exposure and one for the mediator(s). We address these gaps here. For each setting, we propose novel estimands, identify them from the observed data, and propose a robust and efficient estimator based on solving the efficient influence function (EIF) estimating equation.
This paper is organized as follows. We give notation in Section 2 and describe the two structural causal models we consider-a single-instrument scenario and a two-related-instrument scenario. In Section 3 we define complier direct and indirect effects in each scenario and give their identification results. In Section 4, we propose an efficient and robust estimator for each estimand using flexible, data-adaptive regression methods. Section 5 details a limited simulation study evaluating the finite sample performance of these estimators under several scenarios. In Section 6, we apply each estimator to the MTO motivating example to estimate the complier direct and indirect effects in both the single-instrument and double-instrument scenarios. These result in different definitions of "compliers" and thus, different estimands. Section 7 concludes.

Notation and structural causal models
We consider two structural causal models (SCMs).

Single instrument for Z
In the first SCM we consider, let O = (W, A, Z, M, Y ) represent the observed data, and let O 1 , . . . , O n denote a sample of n i.i.d. observations of O. Let W denote a vector of observed baseline covariates, W = f (U W ), where U W is unobserved exogenous error on W and where function f is assumed deterministic but unknown (Pearl, 2009). Let A denote a binary instrumental variable (Angrist et al., 1996) of a single, binary exposure variable, Z, where A = f (W, U A ) and Z = f (W, A, U Z ) and U A and U Z are unobserved exogenous errors. Let M denote a set of mediating variables, M = f (W, Z, U M ), that may be multiple, multi-valued, and/or continuous. Finally, let Y denote a continuous or binary outcome, Y = f (W, Z, M, U Y ). Note that there is no direct effect from A to M or from A to Y in this SCM-A only influences subsequent variables through Z.

Related instruments for Z and M
In the second SCM we consider, let O = (W, A, Z, L, M, Y ) represent the observed data, and let O 1 , . . . , O n denote a sample of n i.i.d. observations of O. Define W , A, and Z as in Section 2.1. Let L denote a binary instrumental variable (Angrist et al., 1996) of a single, binary mediator variable, M , where L = f (W, A, Z, U L ) and M = f (W, Z, L, U M ) and U L and U M are unobserved exogenous errors. Define Y as in Section 2.1: Y = f (W, Z, M, U Y ). Note that there is no direct effect from A to M , nor from A to Y , nor from L to Y in this SCM. Thus, we assume A adheres to the exclusion restriction assumption and is an instrument for the total effect of Z on Y , and assume that L adheres to the exclusion restriction assumption and is an instrument for the effect of M on Y . Note that the first SCM could be considered a special case of this second SCM where instrument L is not used.

General notation
We use P to denote the distribution of O, and P c to denote the distribution of (O, U ). We let P be an element of the nonparametric statistical model defined as all continuous densities on O with respect to some dominating measure ν. Let p denote the corresponding probability density function, and W, A, Z, L, M denote the range of the respective random variables. We let E and E c denote corresponding expectation operators, and define Pf = f (o)dP(o) for a given function f (o). We use g(a | w) to denote the probability mass function of A = a conditional on W = w, and e(a | m, w) to denote the probability mass function of A = a conditional on (M, W ) = (m, w). We use µ(m, z, w) to denote the outcome regression function E(Y | M = m, Z = z, W = w) in the single-instrument setting and µ(l, z, w) to denote the outcome regression function E(Y | L = l, Z = z, W = w) in the double-instrument setting. We use q(z | a, w) and r(z | a, m, w) to denote the corresponding conditional densities of Z, p(l | z, w) to denote the conditional density of L, and c(m | l, z, w) to denote the conditional density of M under the second SCM.
We define counterfactual variables in terms of interventions on the nonparametric structural equation model (NPSEM). For simplicity of notation, we will use the random variable with its corresponding intervention in the index to denote the counterfactual. For example, Y Z=1 denotes the random variable f Y (W, 1, M, U Y ). For any variable X, we let G X=x denote a random draw from the distribution of the counterfactual M X=x conditional on W . For example, G Z=z is a random draw from the distribution of f M (W, Z = z, U M ) conditional on W . In this paper we consider interventions that set the mediator equal to such a random draw. This has been referred to as a stochastic intervention on the mediator in the literature (Petersen et al., 2006;van der Laan and Petersen, 2008;Zheng and van der Laan, 2012;VanderWeele et al., 2014;Rudolph et al., 2017). In what follows, we drop the random variable from the index of the counterfactual whenever the variable that is being intervened on is clear from context. For example, we simply use Y a,m to denote Y A=a,M =m , and M a to denote M A=a .

Definition and identification of (in)direct effects
We consider a class of mediational effects called population interventional direct and indirect effects, which have been described previously (VanderWeele et al., 2014;VanderWeele and Tchetgen Tchetgen, 2017). We now provide some background on this type of effect. Population interventional total effects can be decomposed into the interventional direct effect and the interventional indirect effect in terms of a contrast between two user-given values z , z ∈ Z (Díaz et al., 2019): .
Interventional direct and indirect effects target a population-level path from Z to Y through M for the indirect effect and not through M for the direct effect. If there is no post-instrument exposure, and the assumption M 0 ⊥ Y 1,m | W holds, the identification formula (and consequently estimators) of the interventional and natural direct and indirect effects are the same (VanderWeele and Tchetgen Tchetgen, 2017). In what follows we develop a framework for the definition, identification, and estimation of the complier counterparts to these interventional direct and indirect effects.

Single instrument for Z
Under the single-instrument SCM, we have three causal quantities of interest: the complier interventional direct effect (CIDE), the complier interventional indirect effect (CIIE), and the complier interventional total effect (CITE). These are defined as: where C Z = Z A=1 − Z A=0 , and C Z = 1 denotes compliers in this SCM, i.e., those who would adhere to the treatment if randomized to receive the treatment and would adhere to "no" treatment if randomized to not receive treatment. In words, the interventional direct effect among compliers is the average difference in expected outcomes if Z had been set to 1 versus 0 and stochastically drawing M from the counterfactual joint distribution of mediator values, conditional on W , in a hypothetical world in which Z = 0, among compliers. The interventional indirect effect among compliers would analogously be the average difference in expected outcomes setting Z = 1 and stochastically drawing M from the counterfactual joint distribution of mediator values, conditional on W , in a hypothetical world in which Z = 1 versus Z = 0, among those who would comply with the intervention. Each of the above causal quantities is identified by a statistical parameter that maps a probability distribution P in the statistical model to a real number. For example, under the following theorem, ψ c CIDE is identified by the statistical parameter ψ CIDE = ψ IDE /ψ F S , where ψ IDE is the statistical parameter for the interventional direct effect of A on Y not through M , and where ψ F S is the statistical parameter for the first-stage (FS) effect of instrument A on Z.
Theorem 1. Under the following assumptions, we can identify the complier interventional direct and indirect effects as follows.
A1 (Exclusion restriction). Assume the exclusion restriction of the NPSEM in which there is no direct effect of A on M and no direct effect of A on Y .
A4 (Positivity of instrument and mediator mechanisms). Assume A5 (Non-zero average effect of the instrument on the treatment). Assume E c (Z A=1 − Z A=0 ) = 0.
We can identify the complier interventional direct effect, ψ c CIDE , as We can identify the complier interventional total effect, ψ c CIT E , as The complier interventional indirect effect may be obtained by subtraction.
The proof for the identification result is given in the Supplementary Materials. Note that we do not assume outcome exchangeability in terms of treatment taken/adherence, Z, and therefore allow for unmeasured common causes of Z and Y . We also do not require that the instrument is randomized, only that it satisfies exchangeability with respect to the outcome and mediator conditional on W .

Related instruments for Z and M
Under the double-instrument SCM, we have two analogous causal quantities of interest: the double complier interventional direct effect (DCIDE) and the double complier interventional indirect effect (DCIIE). These are defined as: where C Z = Z A=1 − Z A=0 = 1 denotes compliers for the instrument for Z and C M = M L=1 − M L=0 = 1 denotes compliers for the instrument for M . The statistical parameters corresponding to each of these causal quantities can be defined analogously to the definitions in Section 3.1. For example, under the following theorem, ψ c DCIDE is identified by the statistical parameter ψ DCIDE = ψ T IIDE /ψ JF S , where ψ T IIDE is the statistical parameter for the two-instrument scenario interventional direct effect (TIIDE) of A on Y not through M , and where ψ JF S is the statistical parameter for the joint first-stage (JFS) effects of instrument A on Z and instrument L on M .
Theorem 2. Under the following assumptions, we can identify the double complier interventional direct and indirect effects as follows. (Compared to Theorem 1, we update the exclusion restriction, monotonicity, nonzero average effect of instruments, sequential randomization, and positivity assumptions to relate to both instruments A and L.) A6 (Exclusion restriction). Assume the exclusion restrictions of the NPSEM in which there is no direct effect of A on M , no direct effect of A on Y , and no direct effect of L on Y .
A7 (Monotonicity of treatment and mediator instrumentation). Assume P(C Z = C M ≥ 0) = 1. We note that one could test this assumption in the observed data.
A9 (Positivity of instrument and mediator mechanisms). Assume Define the sequential regression parameters Note that φ(a, l) can be rewritten: .
The proof for the identification result of ψ c DCIIE is given in the Supplementary Materials. Note that the above identification allows for the decomposition of the double complier interventional total effect (DCITE) into the double complier interventional direct effect (DCIDE) and the double complier interventional indirect effect (DCIIE). If we do not need the decomposition, and only the DCIDE is of interest, we can weaken the identification assumptions as in the following theorem.

Estimation
We now describe a proposed estimation approach for the complier and double complier interventional direct effects and complier and double complier interventional indirect effects under each of the two SCMs we consider. Under this estimation approach, we estimate the numerator and denominator separately such that we have a ratio of so-called "one-step" estimators that each solves its respective EIF estimating equation in one step (Bickel et al., 1997).

Single instrument for Z
We first consider the one-instrument scenario represented by observed data O = (W, A, Z, M, Y ), and the ψ CIDE statistical parameter. We describe how to estimate ψ CIDE by using a one-step estimator of the numerator, ψ IDE , and denominator, ψ F S , separately. An R package to implement this estimator is included: https://github.com/nt-williams/iv_mediation/tree/main/ single The EIFs for ψ IDE and ψ F S have been derived in Díaz et al. (2019) and Hahn (1998), respectively. We provide the formula for each in the Supplementary Materials. Consequently, we can write the EIF for ψ CIDE , denoted D CIDE (O, P), using the delta method: Let η = (q, g, µ, r, e). Letη denote an estimator of η.
For our estimator of ψ CIDE , we estimate the numerator and denominator separately, where each is the solution to their respective EIF estimating equation, and then take the ratio of the two.
Note that g(a|w) and q(z|a, w) appear in both D F S (O, P) and D IDE (O, P), so for compatability, we use the same estimated distribution. We also use a cross-fitted version of this estimator. Cross-fitting is a data-splitting technique recently proposed for causal inference with the goal of waeakening some of the technical assumptions required for asymptotic normality of the resulting estimators (Klaassen, 1987;Zheng and van der Laan, 2011;Chernozhukov et al., 2016). We perform crossfitting for estimation of all the components of η as follows. Let V 1 , . . . , V J denote a random partition of data with indices i ∈ {1, . . . , n} into J prediction sets of approximately the same size such that J j=1 V j = {1, . . . , n}. For each j, the training sample is given by T j = {1, . . . , n} \ V j .η j denotes the estimator of η, obtained by training the corresponding prediction algorithm using only data in the sample T j , and j(i) denotes the index of the validation set which contains observation i. We then use these fits,η j(i) (O i ) in computing each efficient influence function, i.e., we compute D(O i ,η j(i) ).
This estimator of ψ CIDE can be calculated in the following steps: 1. Let the components of η be defined as above. Each can be estimated by fitting a regression of the dependent variable on the independent variables and generating predicted probabilities (if the dependent variable is binary) or predicted values (if the dependent variable is numerical), setting the values of independent variables where indicated. For example,ĝ(a | w) can be estimated by fitting a logistic regression model of A on W and generating predicted probabilities that A = a for all observed w. One could also use machine learning in model fitting, which is what we do in the simulations and data analysis.
2. The function u(z, w) can be estimated by regressing the quantity µ(Z, M, W ) × h(Z, M, W ) on Z, W and getting predicted values, setting (z, w) = (Z, W ). The function v(w) can be estimated by marginalizing out z from µ(z, m, w) using q(z | a , w) as predicted probabilities for each z, and then regressing the resulting quantity on A, W and predicting values setting (a * , w) = (A, W ).
3. The estimate of the numerator, ψ IDE , is given by solving 1 where the components ofη j(i) are estimated as described in Step 1.
4. The estimate of the denominator, ψ F S , is given by solving 1 n n i=1 D F S (O i ,ĝ j(i) ,q j(i) ) = 0, whereĝ j(i) andq j(i) are estimated as described in Step 1.
5. The ratio of these two estimates gives the one-step estimate of ψ CIDE , which we denote witĥ ψ CIDE .
6. The variance ofψ CIDE can be estimated as the sample variance of D CIDE (O i ;η j(i) ).
The complier total interventional effect can be estimated analogously, and the complier interventional indirect effect can then be estimated by subtracting the indirect effect from the total effect.
Lemma 1 implies that it is possible to construct consistent estimators for ψ CIDE under consistent estimation of the nuisance parameters in η in the configurations described therein. The robustness conditions result from the intersection of robustness of the numerator and robustness of the denominator, which follow from results given in Díaz et al. (2019) and Hahn (1998).
Asymptotic normality and efficiency ofψ IDE andψ F S has been previously established (Zheng and van der Laan, 2011;Díaz et al., 2019). The conditions for asymptotic normality include convergence of all the componentsη in L 2 (P) norm to their true counterparts at n −1/4 -rate or faster. A straightforward application of the Delta method yields asymptotic normality ofψ CIDE , with asymptotic variance equal to the variance of D CIDE (O; η). This licenses the construction of the Wald-type confidence intervals that we use in our simulation studies and illustrative application.

Instruments for Z and M
We next consider the two, possibly related, instrument scenario represented by observed data O = (W, A, Z, L, M, Y ), and the double complier interventional direct effect target parameter, ψ DCIDE . We describe how to estimate ψ DCIDE by using a one-step estimator of the numerator, ψ T IIDE , and denominator, ψ JF S , separately. An R package to implement this estimator is included: https://github.com/nt-williams/iv_mediation/tree/main/double Recall from Section 3.2 that ψ T IIDE can be written as ϑ(1, 0) − ϑ(0, 0). Similarly, the EIF for ψ T IIDE can be denoted where D a ,a ϑ (O; P) is the EIF for ϑ(a , a ) (for a given (a , a ) ∈ {(1, 1), (1, 0), (0, 0)}). Since ϑ(a , a ) is a particular case of the parameter discussed in Díaz et al. (2019), its EIF is also a particular case of the EIF in that reference, namely: whereμ and where γ can be rewritten as The EIF for ψ JF S , denoted D JF S (O; P), is the same as for a longitudinal intervention with two treatment nodes, A and L, and time-varying covariate, Z, which has been derived by van der Laan and Gruber (2012).
We can write the EIF for ψ DCIDE , denoted D DCIDE (O; P), using the delta method. where and where Note that g(a|w), q(z|a, w), p(l|z, a, w), and c(m|l, z, w) appear in both D JF S (O, P) and D T IIDE (O, P), so for compatability, we use the same estimated distribution. We also use a crossfitted version of this estimator (Klaassen, 1987;Zheng and van der Laan, 2011;Chernozhukov et al., 2016), performing crossfitting in all fits, as described in Section 4.1.
This estimator of ψ DCIDE can be computed in the following steps: 1. Let the components of κ be defined as above. Each can be estimated by fitting a regression of the dependent variable on the independent variables where indicated. For example, p(l | Z, A, W ) can estimated by fitting a logistic regression model of L on (Z, A, W ) and generating predicted probabilities that L = l . One could also use machine learning in model fitting, which is what we do in the simulations and data analysis.
2. The functionμ Z (l, a , w) can be estimated by first fitting the quantity µ(l, z, w), and integrating out z, which adds dependence on a . The random variableμ Z (M, a , W ) can be constructed by evaluatingμ Z (l, a , w) at (l, w) = (M, W ). The function γ(m | a , w) can be estimated by first fitting the quantity c(m | l, z, w), and integrating out l with respect tô p(l|z, a , w), and then integrating out z with respect toq(z|a , W ), which adds dependence on a . We then compute γ(L | a , W ) by evaluating this function at (m, w) = (L, W ). The functionμ L (z, a , w) can be estimated by first fitting the quantity µ(l, z, w), and integrating out L, using γ(l | a , w) which adds dependence on a .

The estimate of ψ JF S is given by solving
,ĉ j(i) ) = 0, wherê g j(i) ,q j(i) ,p j(i) ,ĉ j(i) are estimated as described in Step 1 and using cross-fitting.
5. The ratio of these two estimates gives the one-step estimate of ψ DCIDE , which we denote withψ DCIDE .
6. The variance can be estimated as the sample variance of D DCIDE (O i ;κ j(i) ).
The double complier interventional indirect effect and double complier interventional total effect can then be estimated analogously.
Lemma 2 implies that it is possible to construct consistent estimators for ψ DCIDE under consistent estimation of the nuisance parameters in κ in the configurations described therein. The robustness conditions result from the intersection of robustness of the numerator and robustness of the denominator. As in the single instrument case,ψ DCIDE is asymptotically normal under conditions which include the convergence of each component ofκ j(i) to its true value at n 1/4 -rate in L(P) norm.

Simulation
We conducted a limited simulation study to illustrate the properties of the one-step estimators in the single-instrument setting and double-instrument setting. However, we acknowledge that these simulations are not informative of general estimator performance. We consider estimator performance in terms of absolute bias, absolute bias scaled by √ n, mean squared error relative to the efficiency bound scaled by n and 95% confidence interval (CI) coverage. We conducted 1000 simulations for sample sizes n ∈ {500, 1000, 2000, 5000}. We also consider several specifications of η and κ.

Single-instrument setting
In the single-instrument setting, we consider the following data-generating mechanism (DGM). All variables are Bernoulli distributed with probabilities given by P (W 1 = 1) = 0.6 P (W 2 = 1) = 0.3 P (W 3 = 1 | W 1 , W 2 ) = 0.2 + (W 1 + W 2 )/3 P (A = 1) = 0.5 P (Z = 1 | A, W ) = expit(− log(1.1) * (W 1 + W 2 + W 3 )/3 + 3A) A is randomly assigned and adheres to the exclusion restriction (Angrist et al., 1996), aligned with its role as an instrumental variable. We consider three model specifications: one with all the components of η correctly specified, one with µ inconsistently estimated, and with (r, e) inconsistently estimated. For correct specifications of (q, r, e), we fit nuisance parameters using 1regularized logistic regression including all interactions (Benkeser and van der Laan, 2016; van der Laan, 2017); g was correctly specified using an intercept-only model and µ with a main-effects generalized linear model. Inconsistent nuisance parameters are fit using intercept-only models. Figure 1 shows the results of our simulation study for the one-step estimator in a singleinstrument setting. When all nuisance parameters are correctly specified, the scaled mean squared error converges to the efficiency bound ( Figure 1c) and confidence interval coverage is close to 95% ( Figure 1b). As predicted by Lemma 1, we observe consistent estimates for all specifications in Figure 1. Contrary to what is expected, close to nominal confidence interval coverage was ob-served in some of the misspecified simulation scenarios. This should not be expected in general other than when all nuisance parameters are consistently estimated. Figure 1: Performance of one-step estimator in a single-instrument setting across different model specifications, in terms of (a) scaled bias, (b) 95% CI coverage, and (c) efficiency compared to the efficiency bound.

Double-instrument setting
In the double-instrument setting, we consider the following DGM. All variables are Bernoulli distributed with probabilities given by Similar to the single-instrument setting, A is randomly assigned and adheres to the exclusion restriction (Angrist et al., 1996) definition of an instrumental variable. We consider five model specifications: one with all the components of κ correctly specified, and where each of (µ, p, c, q) are inconsistently estimated. For correct specifications, we fit nuisance parameters using 1 -regularized logistic regression including all interactions (Benkeser and van der Laan, 2016;van der Laan, 2017), except for g which used an intercept-only model. Incorrect nuisance parameter specifications are fit using an intercept-only model. Figure 2 shows the results of our simulation study for the one-step estimator in a doubleinstrument setting. As expected, when all nuisance parameters are correctly specified, the scaled mean squared error converges to the efficiency bound ( Figure 2c) and confidence interval coverage is close to 95% (Figure 2b). Given the results of Lemma 2, we observe consistent estimates for all specifications in Figure 2. Similarly to the single-instrument simulation, close to 95% confidence interval coverage was observed in many of the simulation scenarios. Once again, this should not be expected other than when all nuisance parameters are consistently estimated.

Empirical Illustration
We now apply our proposed one-step estimators to two scenarios from the Moving to Opportunity (MTO) study-one that assumes the presence of a single instrument and one that assumes the presence of two instruments.

Background and Sample
MTO was a longitudinal, randomized trial where families living in public housing in five US cities were randomized to receive a Section 8 housing voucher that they could then use to move out of public housing and rent on the private market (Kling et al., 2007). Aligned with prior analyses estimating direct and indirect effects in MTO (Rudolph et al., 2021, 2018, our sample includes adolescents participating in MTO who were 12-17 years old at the final outcome assessment. We exclude the Baltimore site, as Section 8 voucher receipt did not increase a family's likelihood of moving to a low-poverty neighborhood, which differs from other sites and from the intention of the intervention. We conducted analyses among boys only, as previous work documented qualitatively and quantitatively different intervention effects between girls and boys (Orr et al., 2003;Clampet-Lundquist et al., 2011), with boys experiencing unintended harmful total effects of the MTO intervention on mental health outcomes (Kling et al., 2007;Sanbonmatsu et al., 2011;Kessler et al., 2014). Identifying contributing mediation mechanisms can help shed light on why and how such harmful total effects exist (Rudolph et al., 2021; Smith and Schwartz, 2021).

Data
In both the single and double instrument scenarios, the instrument, A, for the exposure of using the voucher to move out of public housing, is a binary variable defined as randomization to receive a Section 8 housing voucher that one can then use to rent on the private market. The exposure, Z, is a binary variable defined as adherence to the intervention-using the housing voucher, if one received it, to move out of public housing. The outcome, Y , is another binary variable defined as presence of a psychiatric mood disorder (major depressive disorder or an anxiety disorder, defined based on the Diagnostic Statistical Manual, version IV (DSM-IV)) in the past-year, as measured by the CIDI-SF instrument (Kessler et al., 1998). We include numerous baseline covariates related to the individual, the individual's family, and characteristics of the individual's neighborhood at baseline, W . A full list is available in the Supplementary Materials. In the single instrument scenario, we have observed data O = (W, A, Z, M, Y ). Variables W, A, Z, Y are defined as above. The mediator, M , is defined as neighborhood poverty (proportion of neighborhood residents living under the poverty line) after randomization and prior to outcome ascertainment, duration weighted (bounded [0, 1]).
In the double instrument scenario, we have observed data O = (W, A, Z, L, M, Y ). Variables W, A, Z, Y are defined as above. The instrument for the mediator, L, is a binary variable defined as changing school districts after randomization. The mediator, M , is a binary variable defined as living in low-poverty neighborhoods during follow-up (defined as <30% neighborhood residents living under the poverty line after randomization and prior to outcome ascertainment, duration weighted).
For the purposes of this illustrative example, we use one imputed dataset to address missingness in W, L, M, and Y . Variables A and Z have no missingness.

Estimand
In the example we consider here, the complier interventional direct effect is the direct effect of using the housing voucher to move out of public housing on risk of developing a DSM-IV mood disorder in adolescence, not mediated by subsequent neighborhood poverty, among those who would comply with the intervention. The complier interventional indirect effect is the effect of using the housing voucher to move out of public housing on risk of developing a DSM-IV mood disorder in adolescence, mediated by subsequent neighborhood poverty, among those who would comply with the intervention. We consider both the single-instrument and double-instrument complier interventional direct and indirect effects. In addition, we also consider the standard intent-totreat interventional direct and indirect effects of being randomized to receive the housing voucher (i.e., non-IV estimands). The intent-to-treat interventional direct effect is the direct effect of being randomized to receive a housing voucher on risk of developing a DSM-IV mood disorder in adolescence, not mediated by subsequent neighborhood poverty. The intent-to-treat interventional indirect effect is the effect of being randomized to receive a housing voucher on risk of developing a DSM-IV mood disorder in adolescence, mediated by subsequent neighborhood poverty. Similar intent-to-treat interventional direct and indirect effects have been considered previously in MTO (Rudolph et al., 2021).

Analysis
We use the estimators developed herein to estimate each of the above complier and double complier interventional direct and indirect effects. We use previously developed estimators (Díaz et al., 2019) to estimate each of the intent-to-treat interventional direct and indirect effects. We use data-adaptive methods for fitting the nuisance parameters, using the Super Learner ensembling procedure, which is the convex combination of user-supplied algorithms that minimizes the 10-fold cross-validated prediction error ( Van der Laan et al., 2007). These algorithms included generalized linear models, intercept-only models, lasso (Tibshirani, 1996), and multivariate adaptive regression splines (Friedman et al., 1991). Standard errors are estimated using the sample variance of the influence curve. Columbia University determined this analysis of deidentified data to be nonhuman subjects research. Figure 3a shows the complier interventional direct and indirect effect estimates and 95% CIs (labeled "complier effect of moving") and the intent-to-treat interventional direct and indirect effects and 95% CIs (labeled "effect of randomization") in the single-instrument scenario. Figure 3b shows the double complier interventional direct and indirect effect estimates and 95% CIs (labeled "complier effect of moving") and the intent-to-treat interventional direct and indirect effects and 95% CIs (labeled "effect of randomization") in the double-instrument scenario. Figure 3: Estimates (and 95% confidence intervals) of the 1) interventional direct effect of randomized voucher receipt on long-term risk of developing a DSM-IV mood disorder in adolescence, not operating through the mediator neighborhood poverty, and the 2) interventional indirect effect operating through neighborhood poverty; and the 3) complier interventional direct effect of moving with the voucher on long-term risk of developing a DSM-IV mood disorder in adolescence, not operating through the mediator neighborhood poverty, and the 4) complier interventional indirect effect operating through neighborhood poverty. All results were approved for release by the U.S. Census Bureau, authorization number CBDRB-FY22-CES018-004. In general, we see smaller, more precise effects in the single-instrument setting (Figure 3a). Corroborating previous work (Rudolph et al., 2021), we see a small, harmful indirect effect of being randomized to receive a voucher on risk of developing a mood disorder among boys that operates through neighborhood poverty as well as a harmful direct effect that does not operate through neighborhood poverty. Also as expected the complier direct and indirect effects of moving with the voucher on risk of developing a mood disorder are slightly larger than their intent-to-treat counterparts (complier interventional direct effect (risk difference): 0.127, 95% CI: 0.093-0.161; complier interventional indirect effect: 0.017, 95% CI: 0.014-0.020). We would expect complier average effects to be larger than their total intent-to-treat counterparts, because the complier point estimate is calculated by dividing the intent-to-treat estimate by the probability (a number between 0 and 1) of being a complier (i.e., the "first-stage" effect of A on Z). Estimating effects among the smaller number of compliers could also result in the complier effects having less precision in some cases (Jo, 2002;Angrist and Pischke, 2008).
The double instrument setting addresses unobserved confounding of the M − Y relationship, but at the expense of precision in terms of both the measure of the mediator (binarized neighborhood poverty) and the resulting estimates (Figure 3b), and, relatedly, at the expense of having a more limited group of double compliers (Angrist and Pischke, 2008). We again see a harmful indirect effect of being randomized to receive a voucher on risk of developing a mood disorder among boys that operates through neighborhood poverty as well as a harmful direct effect that does not operate through neighborhood poverty. These effect estimates are very similar to those in Figure 3a, as expected in the absence of strong unmeasured confounding of the mediator-outcome relationship, as the only difference is whether M is treated as a continuous or binary variable. As in the single-instrument case, the double complier interventional direct and indirect effects of moving with the voucher on risk of developing a mood disorder are also larger and much less precise than the intent-to-treat counterparts (double complier interventional direct effect (risk difference): 0.313, 95% CI: 0.130-0.496; double complier interventional indirect effect: 0.007, 95% CI: -0.002-0.017). In this setting, "double compliers" are defined as those who 1) were randomized to receive the voucher and moved with it as well as 2) changed school districts, and that change involved a move to a lower poverty neighborhood. The joint additive effect of the two instruments on the exposure and mediator is (0.104, 95% CI: 0.080-0.128). In other words, being randomized to receive a voucher and changing school districts (conditional on moving, receiving the voucher, and covariates) increases risk of moving with a voucher to a lower-poverty neighborhood by 10.4 percentage points.

Conclusion
In this paper, we defined and identified complier interventional direct and indirect effects (i.e., IV mediational effects) in two scenarios: 1) one where there is a single instrument of the exposure of interest, but relies on the assumption of no unobserved confounders of the mediator-outcome relationship, and 2) where there are two instruments, one for the exposure and another for the mediator, that may be related to each other, and thus, no longer relies on an unobserved confounding assumption. We proposed nonparametric, robust, and efficient estimators of each effect, based on solving the EIF estimating equation, described their robustness properties, and evaluated their finite sample performance in a limited simulation study.
The effects and estimators we propose are widely applicable. Anytime a mediation question is asked in the context of a randomized trial with possible noncompliance, in the context of treatment discontinuities, or in the context of Mendellian randomization, these causal effects and estimators may apply. To facilitate implementation, we provide an easy-to-use R package and step-by-step instructions https://github.com/nt-williams/iv_mediation.
In numerical studies, the performance of our proposed estimators deteriorated in small samples, e.g., N=500. This is not surprising. Estimators of mediational direct and indirect effects are more sensitive to smaller sample sizes than total effect estimators (Rudolph et al., 2020a). Estimators of complier total effects (e.g., complier average causal effects) are more sensitive to smaller sample sizes that average treatment effect estimators (Jo, 2002). Given that we consider both mediational and complier estimators here, we would expect finite sample performance to be challenged even further. It reassuring, however, that performance was acceptable in the N=1,000 sample size tested in our simulations.
Future work could focus on making several improvements to our estimators, including: developing an estimator in the targeted minimum loss-based framework that targets each ratio directly instead separately estimating the numerator and denominator, and incorporating the monotonicity assumption into the estimation process.
Supplementary Materials for Causal mediation with instrumental variables S1 Identification proofs S1 Identification of the complier interventional direct effect Note that: Using the above result, we can continue the proof from above: using the result from above by assumptions A4 and A5 we have that the above is defined.

S2 Identification of the double complier interventional indirect effect
Proof Assume C Z = C M (as in A7) and note that: Using this result, we can continue the proof from above: The numerator can be identified as follows: The denominator can be identified following the identification for a two-timepoint longitudinal intervention: Note that: Using the above result, we can continue the proof from above: using the result from above The numerator can be identified as follows: The denominator can be identified as follows: by assumptions A9 and A5 we have that the above is defined.

S2 Efficient influence functions derived by others
The EIF for ψ F S was derived in Hahn (1998).
The EIF for ψ IDE was derived in Díaz et al. (2019).
S3 Baseline covariates used in the empirical illustration • Adolescent characteristics: site (Boston, Chicago, LA, NYC), age, race/ethnicity (categorized as black, latino/Hispanic, white, other), number of family members (categorized as 2, 3, or 4+), someone from school asked to discuss problems the child had with schoolwork or behavior during the 2 years prior to baseline, child enrolled in special class for gifted and talented students.
• Adult household head characteristics included: high school graduate, marital status (never vs ever married), whether had been a teen parent, work status, receipt of AFDC/TANF, whether any family member has a disability.
• Neighborhood characteristics: felt neighborhood streets were unsafe at night; very dissatisfied with neighborhood; poverty level of neighborhood.
• Reported reasons for participating in MTO: to have access to better schools.
• Moving-related characteristics: moved more then 3 times during the 5 years prior to baseline, previous application for Section 8 voucher.