# Sensitivity analysis for bias due to a misclassfied confounding variable in
marginal structural models

Original Research Article

Linda Nab  Department of Clinical Epidemiology, Leiden University Medical
Center, Leiden, the Netherlands  Corresponding author: Postzone C7-P, P.O. Box
9600, 2300 RC Leiden, the Netherlands<EMAIL_ADDRESS>tel: +31 71 526 5640
Running head: Sensitivity analysis for bias due to a misclassified confounding
variable Conflicts of interest: Non declared Funding: LN, RHHG and MvS were
supported by grants from the Netherlands Organization for Scientific Research
(ZonMW-Vidi project 917.16.430) and Leiden University Medical Center, RHK was
supported by a Medical Research Council Methodology Fellowship (MR/M014827/1)
and a UK Research and Innovation Future Leaders Fellowship (MR/S017968/1).
Data and code availability: The data and code used for the simulation study
and sensitivity analysis have been made publicly and can be accessed via
www.github.com/LindaNab/memsm. Acknowledgements: We acknowledge support from
Stichting Jo Kolk Studiefonds and Leids Universiteits Fonds in the form of a
travel grant.  Rolf H.H. Groenwold  Department of Clinical Epidemiology,
Leiden University Medical Center, Leiden, the Netherlands  Department of
Biomedical Data Sciences, Leiden University Medical Center, Leiden, the
Netherlands  Maarten van Smeden  Department of Clinical Epidemiology, Leiden
University Medical Center, Leiden, the Netherlands  Ruth H. Keogh  Department
of Medical Statistics, London School of Hygiene and Tropical Medicine, London,
United Kingdom

###### Abstract

In observational research treatment effects, the average treatment effect
(ATE) estimator may be biased if a confounding variable is misclassified. We
discuss the impact of classification error in a dichotomous confounding
variable in analyses using marginal structural models estimated using inverse
probability weighting (MSMs-IPW) and compare this with its impact in
conditional regression models, focusing on a point-treatment study with a
continuous outcome. Expressions were derived for the bias in the ATE estimator
from a MSM-IPW and conditional model by using the potential outcome framework.
Based on these expressions, we propose a sensitivity analysis to investigate
and quantify the bias due to classification error in a confounding variable in
MSMs-IPW. Compared to bias in the ATE estimator from a conditional model, the
bias in MSM-IPW can be dissimilar in magnitude but the bias will always be
equal in sign. A simulation study was conducted to study the finite sample
performance of MSMs-IPW and conditional models if a confounding variable is
misclassified. Simulation results showed that confidence intervals of the
treatment effect obtained from MSM-IPW are generally wider and coverage of the
true treatment effect is higher compared to a conditional model, ranging from
over coverage if there is no classification error to smaller under coverage
when there is classification error. The use of the bias expressions to inform
a sensitivity analysis was demonstrated in a study of blood pressure lowering
therapy. It is important to consider the potential impact of classification
error in a confounding variable in studies of treatment effects and a
sensitivity analysis provides an opportunity to quantify the impact of such
errors on causal conclusions. An online tool for sensitivity analyses was
developed: https://lindanab.shinyapps.io/SensitivityAnalysis.

(Keywords: marginal structural models, inverse probability weighting,
misclassification, point-treatment study, sensitivity analysis)

##  1 Introduction

The aim of many observational epidemiologic studies is to estimate a causal
relation between an exposure and an outcome. One of the fundamental challenges
in making inference about causal effects from observational data is adequately
dealing with confounding. In the case of a point-treatment, that is estimating
the effect of a treatment at a single time point on a subsequent outcome, many
methods exist that aim to estimate average treatment effects (ATEs). These
include traditional conditional regression analysis as well as marginal
structural models estimated using inverse probability weighting (MSMs-IPW) [1,
2]. Unlike conditional regression, MSMs extend more easily to longitudinal
settings with time-dependent confounding.

To obtain valid inference, MSMs-IPW, like other methods to correct for
confounding, assume that confounding variables are measured without error, an
assumption that is hardly ever warranted in observational epidemiologic
research [3, 4, 5, 6]. For instance, CD4 count is known to be error-prone [7],
but used as a time-dependent confounder in one of the introductory papers of
MSMs, studying the effect of zidovudine therapy on mean CD4 count in HIV-
infected men [1]. Another example of the use of an error-prone confounding
variable is $\gamma$-glutamyltransferase in investigating the relationship
between Hepatitus C virus treatment and progression of liver disease [8]. In
both examples, the assumption of measurement error-free confounding variables
is possibly violated and may lead to bias in the treatment effect estimator.

There is a substantial literature on bias due to measurement error in
confounding variables in conditional regression analyses [9, 10, 11, 12], but
the impact of measurement error in confounding variables in causal inference
methods, such as MSMs-IPW, has not received much attention. One exception is a
study by Regier et al. that showed by means of a simulation study that
measurement error in continuous confounding variables can introduce bias in
the ATE in a point-treatment study [13]. McCaffrey et al. proposed a weighting
method to restore the treatment effect estimator when covariates are measured
with error [14].

We provide a discussion of when measurement error in a confounding variable is
important for estimating treatment effects and when it is not. In addition, we
derive expressions that quantify the bias in the ATE if a dichotomous
confounding variable is misclassified, focusing on a point-treatment study
with a continuous outcome. These expressions allow us 1) to quantify the bias
due to classification error in a confounding variable in MSMs-IPW, and to
compare this with the bias from a conditional regression analysis and 2) to
inform sensitivity analyses to assess the uncertainty of study results if the
assumption of no classification error in a confounding variable is violated
[15, 16, 17]. Simulation results are used to study the finite sample
performance of a MSM-IPW and compared to that of conditional regression models
if classification error in a confounding variable is present. Finally, we
illustrate our sensitivity analysis in a study of the effect of blood pressure
lowering drugs on blood pressure.

##  2 Settings and impact of measurement error, notation and assumptions

Let $A$ denote the treatment indicator and $Y$ the outcome. Let there be a
variable $L$ that confounds the association between treatment and outcome and
suppose that, instead of confounding variable $L$, the error-prone confounding
variable $L^{*}$ is observed. We consider two settings in which measurement
error in confounding variables may occur and discuss the impact of measurement
error in both settings.

Settings and impact of measurement error. The Directed Acyclic Graph (DAG) in
Figure 1(a) illustrates setting 1. In this setting, treatment initiation is
based on the error-prone confounding variable rather than the underlying
truth. Consider for example a study investigating the effect of zidovudine
therapy ($A$) on mean CD4 count ($Y$) in HIV-infected patients. Past CD4 count
($L$) confounds the relation between zidovudine therapy and future CD4 count
[1], but the observed past CD4 count is prone to measurement error ($L^{*}$)
[7]. Yet, the actual information that the clinician uses to initiate treatment
is the observed error-prone CD4 count ($L^{*}$) instead of true CD4 count
($L$), as depicted in Figure 1(a) (measurement error in the outcome, in our
example also CD4 count, is not depicted here). In setting 1, conditioning on
error-prone confounding variable $L^{*}$ will block the backdoor path from
treatment $A$ to outcome $Y$. Thus, if there is confounding by indication but
the error-prone variable is used for treatment decisions, it is sufficient to
control for the error-prone confounding variable to estimate the causal effect
of treatment on outcome. We recognize this as an important exception since
this means that measurement error in a confounding variable will not always
lead to bias.

The DAG in Figure 1(b) illustrates setting 2, in which treatment initiation is
based on confounding variable $L$, but only a proxy of $L$ is observed
($L^{*}$). An example here might be a study investigating the effect of
influenza vaccination ($A$) on mortality ($Y$) in the elderly population [18].
Frailty ($L$) possibly confounds the association between influenza vaccination
and mortality. Frailty is observed by a clinician and may influence
vaccination probability, but only a proxy of frailty ($L^{*}$) may be
available in patient record data, as depicted in Figure 1(b). In this setting,
conditioning on $L^{*}$ will not fully adjust for confounding by $L$, because
conditioning on $L^{*}$ does not block the backdoor path from $A$ to $Y$ via
$L$.

$L$$L^{*}$$\varepsilon$$A$$Y$ (a) Setting 1: treatment $A$ is initiated based
on the error-prone confounding variable $L^{*}$

$L$$L^{*}$$\varepsilon$$A$$Y$ (b) Setting 2: treatment $A$ is initiated based
on confounding variable $L$

Figure 1: Measurement error $\varepsilon$ in variable $L$ that confounds the
association between treatment $A$ and outcome $Y$ in two settings illustrated
in Directed Acyclic Graphs

Notation and assumptions. The above is a graphical interpretation and we will
now continue investigating the impact of classification error in setting 2, by
focusing on the setting where that $L$ is a dichotomous confounding variable
and $Y$ a continuous outcome. We use the potential outcomes framework [19,
20]. Let $Y^{a=0}$ denote the outcome that a individual would have had if
treatment $A$ was set to $a=0$, and let $Y^{a=1}$ denote the outcome if
treatment $A$ was set to $a=1$. We assume that $L^{*}$ is non-differentially
misclassified with respect to the outcome
($L^{*}\raisebox{0.50003pt}{\rotatebox[origin={c}]{90.0}{$\models$}}Y|L$) and
to the treatment
($L^{*}\raisebox{0.50003pt}{\rotatebox[origin={c}]{90.0}{$\models$}}A|L$) (the
notation $Q\raisebox{0.50003pt}{\rotatebox[origin={c}]{90.0}{$\models$}}R|S$
denotes that a variable $Q$ is independent of another variable $R$ given a
third variable $S$). Let $p_{1}$ denote the sensitivity of $L^{*}$ and
$1-p_{0}$ the specificity of $L^{*}$ (i.e., $P(L^{*}|L=l)=p_{l}$). We also
denote the probability of treatment given the level of $L$ by
$P(A=1|L=l)=\pi_{l}$ and the prevalence of $L$ by $P(L=1)=\lambda$.

We also assume that the following causal assumptions are satisfied to recover
the causal effect of treatment on the outcome. Under the consistency
assumption, we require that we observe $Y=Y^{a=0}$ if the individual is not
exposed, or $Y=Y^{a=1}$ if the individual is exposed [21]. Further, we assume
that the potential outcome $Y^{a}$ for an individual does not depend on
treatments received by other individuals, also referred to as Stable-Unit-
Treatment-Value-Assumption [22]. Additionally, we assume conditional
exchangeability, i.e., given the level of the confounding variable $L$, the
outcome in the untreated would have been the same as the outcome in the
treated had individuals in the untreated group received treatment [21]. In
notation,
$A\raisebox{0.50003pt}{\rotatebox[origin={c}]{90.0}{$\models$}}Y^{a}|L$, for
$a=0,1$. Finally, we assume $\pi_{L}>0$ for $L=0,1$ (positivity) [23].

For causal contrasts, we compare expected potential outcomes (i.e.,
counterfactual outcomes) under the two different treatments. The average
causal effect of the treatment on the outcome is
$\beta=\operatorname{\mathbb{E}}[Y^{a=1}]-\operatorname{\mathbb{E}}[Y^{a=0}]$.
Under the above defined assumptions, the conditional effect of treatment $A$
on outcome $Y$ can be defined through the following linear model:

$\operatorname{\mathbb{E}}[Y^{a}|L]=\operatorname{\mathbb{E}}[Y|A=a,L]=\alpha+\beta
a+\gamma L.$ (1)

Estimates for $\beta$ in the above model can be obtained by fitting a
conditional regression model. Alternatively, the effect of treatment $A$ on
outcome $Y$ may be estimated by fitting a MSM:

$\operatorname{\mathbb{E}}[Y^{a}]=\alpha_{\mathrm{msm}}+\beta
a,\qquad\mathrm{where}\quad\alpha_{\mathrm{msm}}=\alpha+\gamma\operatorname{\mathbb{E}}[L].$
(2)

Estimates for $\beta$ in the above model can be obtained by IPW estimation: by
fitting a linear regression model for $Y$ on $A$ where the contribution of
each individual is weighted by 1 over the probability of that individual’s
observed treatment given the confounding variable $L$ [2], estimating the
marginal treatment effect. Since our focus is on linear models, the
conditional and marginal treatment effect, respectively denoted by $\beta$ in
model (1) and (2), are equal (not generally true for non-linear models [2]).

##  3 Quantification of bias due to classification error in a confounding
variable

Our aim is to study the effect of using the misclassified confounding variable
$L^{*}$ in place of the confounding variable $L$ in the conditional regression
model or in the model for the weights used to fit the MSM on the ATE estimator
in the setting where $L$, not $L^{*}$, influences treatment initiation
(setting 2 above).

Conditional model. By the law of total expectation, the expected value of the
outcome $Y$ given treatment $A$ and misclassified confounding variable $L^{*}$
is (see appendix section A1.1 for further detail),

$\displaystyle\operatorname{\mathbb{E}}[Y|A=a,L^{*}]=\operatorname{\mathbb{E}}_{L|A=a,L^{*}}\big{[}\operatorname{\mathbb{E}}[Y|A=a,L^{*},L]\big{]}$
$\displaystyle=$ $\displaystyle\\{\alpha+\gamma\phi_{00}+\delta u_{0}\\}$
$\displaystyle+$ $\displaystyle\\{\beta+\gamma(\phi_{10}-\phi_{00})+\delta
u_{A}\\}a$ $\displaystyle+$
$\displaystyle\\{\gamma(\phi_{01}-\phi_{00})+\delta u_{L^{*}}\\}L^{*},$

where $\phi_{al^{*}}=P(L=1|A=a,L^{*}=l^{*})$,
$\delta=\operatorname{\mathbb{E}}[Y|A=1,L^{*}=1]=\gamma(\phi_{11}-\phi_{10}-\phi_{01}+\phi_{00})$
and $u_{0},u_{A},u_{L^{*}}$ represent the coefficients of the linear model
$\operatorname{\mathbb{E}}[AL^{*}|A,L^{*}]=u_{0}+u_{A}A+u_{L^{*}}L^{*}$,
modeling the mean of treatment $A$ times the misclassified confouding variable
$L^{*}$ (i.e., $AL^{*}$) given $A$ and $L^{*}$ (see next paragraph for an
explanation of why these appear). The coefficient for treatment $A$ in the
above model is $\beta+\gamma(\phi_{10}-\phi_{00})+\delta u_{A}$, and is
therefore biased for the parameter of interest ($\beta$). By rewriting $u_{A}$
in terms of $\lambda$, $\pi_{0}$, $\pi_{1}$, $p_{0}$ and $p_{1}$ (see appendix
section A1.1), we find that the bias due to classification error in $L^{*}$ in
the ATE in a conditional regression model is,

$\displaystyle\mathrm{Bias}_{\mathrm{cm}}(\beta)=\gamma(\phi_{10}-\phi_{00})\left(1-\ell\times\Big{\\{}\frac{\pi^{*}_{1}(1-\omega)-\pi^{*}_{1}(\pi^{*}_{1}-\pi^{*}_{0})(1-\ell)}{\omega(1-\omega)-(\pi^{*}_{1}-\pi^{*}_{0})^{2}\ell(1-\ell)}\Big{\\}}\right)$
$\displaystyle+\gamma(\phi_{11}-\phi_{01})\left(\ell\times\Big{\\{}\frac{\pi^{*}_{1}(1-\omega)-\pi^{*}_{1}(\pi^{*}_{1}-\pi^{*}_{0})(1-\ell)}{\omega(1-\omega)-(\pi^{*}_{1}-\pi^{*}_{0})^{2}\ell(1-\ell)}\Big{\\}}\right),$
(3)

where $\pi^{*}_{l^{*}}=P(A=1|L^{*}=l^{*})$, $\ell=P(L^{*}=1)$ and
$\omega=P(A=1)$ (see the appendix section A1.1 for a derivation).

We focused above on a model for $Y$ conditional on $A$ and $L^{*}$ which
includes only main effects of $A$ and $L^{*}$, as this is typically what would
be done in practice when replacing $L$ with $L^{*}$. In fact, it can be shown
that when the model for the outcome $Y$ given $A$ and $L$ includes only main
effects of $A$ and $L$, the implied correctly specified model for $Y$ given
$A$ and $L^{*}$ also includes an interaction between $A$ and $L^{*}$,
explaining the appearance of $u_{0},u_{A}$ and $u_{L}$ in the above since the
interaction is not modelled. We refer to the appendix section A1.1 for the
bias in the ATE in a model including an interaction between the treatment and
the misclassified confouding variable.

MSM estimated using IPW. A MSM-IPW proceeds by fitting a linear regression for
outcome $Y$ on treatment $A$ where the contribution of each individual is
weighted by 1 over the probability of that individual’s observed treatment
given misclassified confounding variable $L^{*}$ [2]. An estimator for the ATE
$\beta$ is,

$\displaystyle\hat{\beta}=\frac{\sum_{i=1}^{n}\frac{1}{P(A_{i}|L_{i}^{*})}(Y_{i}-\overline{Y}_{w})(A_{i}-\overline{A}_{w})}{\sum_{i=1}^{n}\frac{1}{P(A_{i}|L_{i}^{*})}(A_{i}-\overline{A}_{w})^{2}}\quad\text{where,}\quad\overline{Y}_{w}$
$\displaystyle=$
$\displaystyle\frac{\sum_{i=1}^{n}Y_{i}/P(A_{i}|L_{i}^{*})}{\sum_{i=1}^{n}1/P(A_{i}|L_{i}^{*})}$
$\displaystyle\text{and,}\quad\overline{A}_{w}$ $\displaystyle=$
$\displaystyle\frac{\sum_{i=1}^{n}A_{i}/P(A_{i}|L_{i}^{*})}{\sum_{i=1}^{n}1/P(A_{i}|L_{i}^{*})}.$

It can be shown that
$\operatorname{\mathbb{E}}[\hat{\beta}]=\beta+\gamma(1-\ell)(\phi_{10}-\phi_{00})+\gamma\ell(\phi_{11}-\phi_{01})$.
Consequently, the bias in the ATE $\beta$ in a MSM estimated using IPW is,

$\mathrm{Bias}_{\mathrm{msm}}(\beta)=\gamma(\phi_{10}-\phi_{00})(1-\ell)+\gamma(\phi_{11}-\phi_{01})\ell.$
(4)

We refer to the appendix section A1.2 for a derivation of the above formula.

###  3.1 Exploration of bias

To study the bias due to misclassification from the conditional model and MSM-
IPW, we analytically and graphically explore bias expressions (3) and (4).

Null-bias. From the bias expressions, it can be seen that there are four
trivial conditions in which the bias in the ATE is null in both the
conditional model and MSM-IPW, in line with general understanding of causal
inference [24]. 1) If there is no classification error in the observed
confounding variable $L^{*}$, i.e., specificity is 1 ($p_{0}=0$) and
sensitivity is 1 ($p_{1}=1$), it follows that the confounding variable $L$
corresponds to the observed variable $L^{*}$, irrespective of treatment level
(i.e., $\phi_{10}=0$, $\phi_{00}=0$, $\phi_{11}=1$ and $\phi_{01}=1$). 2) If
the true relation between variable $L$ and outcome $Y$ is null (i.e., $\gamma$
is zero, thus there is no arrow from $L$ to $Y$ in Figure (1(b))). 3) If the
variable $L$ does not affect the probability of receiving treatment (i.e.,
$\pi_{0}=\pi_{1}$, thus there is no arrow from $L$ to $A$ in Figure (1(b))),
the probability that the variable $L$ is 1 depends on the value of the
misclassified variable $L^{*}$ but no longer on $A$ (i.e.,
$\phi_{00}=\phi_{10}$ and $\phi_{01}=\phi_{11}$). 4) If the prevalence of the
confounding variable $L$ is null or one (i.e., $\lambda=0$ or $\lambda=1$)
bias is null since if $\lambda=0$ then the probability that $L$ is one given
$A=a$ and $L^{*}=l^{*}$ is null (i.e.,
$\phi_{00}=\phi_{01}=\phi_{10}=\phi_{11}=0$) and if $\lambda=1$, then
$\phi_{00}=\phi_{01}=\phi_{10}=\phi_{11}=1$.

Equal biases. In some cases, bias in the ATE from the conditional regression
analysis equal to that from the MSM-IPW. Evidently, biases are identical if
bias in both models is null (see first paragraph of this section).
Additionally, bias formula 3 and 4 show that bias from the two methods is
equal if the term between curly brackets in equation (3) is equal to 1.

Sign and magnitude of bias. Figure LABEL:fig:biasplots illustrates bias in the
ATE in a conditional model and a MSM-IPW, obtained by using the bias
expressions and by varying either the probability of receiving treatment if
the confounding variable is one (i.e., $0<\pi_{1}<1$) or the effect of the
confounding variable on the outcome (i.e., $-5\leq\gamma\leq 5$) or the
prevalence of the confounding variable (i.e., $0\leq\lambda\leq 1$) or 1 minus
the specificity or sensitivity of the error-prone confounding variable (i.e.,
$0\leq p_{0}\leq 1$ and $0\leq p_{1}\leq 1$, respectively) and keeping the
other ones fixed.

Figures LABEL:fig:biasplots:a-LABEL:fig:biasplots:d show that the direction of
the bias depends on whether the effect of the confounding variable on the
outcome is positive or negative (i.e., $\gamma>0$ or $\gamma<0$, respectively)
and whether the probability of receiving treatment given that confounding
variable $L$ is one, is greater, equal or smaller than the probability of
receiving treatment given that $L$ is null ($\pi_{1}:\pi_{0}>1$,
$\pi_{1}=\pi_{0}$ or $\pi_{1}:\pi_{0}<1$, respectively). The lines showing the
bias under the two methods cross at point (1,0) in Figure
LABEL:fig:biasplots:a and LABEL:fig:biasplots:b and at point (0,0) in Figure
LABEL:fig:biasplots:c and LABEL:fig:biasplots:d. This, together with the fact
that the functions are strictly monotonic, show that the bias in a MSM-IPW
cannot be negative if the bias in the conditional model is positive and vice
versa (i.e., the bias will be in the same direction for both models). Figures
LABEL:fig:biasplots:a and LABEL:fig:biasplots:b show that in absolute values
the bias is greatest when $\pi_{0}=$ and $\pi_{1}=1$.

In Figure LABEL:fig:biasplots:e and LABEL:fig:biasplots:f, the prevalence of
the confounding variable $L$ was varied ($\lambda$) while $\pi_{1}$,
$\pi_{0}$, $\gamma$, $p_{1}$ and $p_{0}$ were kept constant. Given these
variables, there is a $\lambda$ for which the bias curve has a maximum (if
bias is greater than zero) or minimum (if bias is smaller than zero). The
specificity and sensitivity of $L^{*}$ were kept constant across Figure
LABEL:fig:biasplots:a-LABEL:fig:biasplots:f, i.e., the specificity was $0.95$
($p_{0}=0.05$) and the sensitivity was $0.90$ ($p_{1}=0.90$). In Figure
LABEL:fig:biasplots:g, 1 minus specificity was varied (i.e., $0\leq p_{0}\leq
1$). Bias is smallest if the specificity is one (i.e., $p_{0}=0$) and is
maximal if the 1 minus specificity equals sensitivity (i.e., $p_{0}=p_{1}$).
In Figure LABEL:fig:biasplots:h, sensitivity was varied (i.e., $0\leq
p_{1}\leq 1$). Bias is smallest if the sensitivity is one (i.e., $p_{1}=1$)
and is maximal if the 1 minus specificity equals sensitivity (i.e.,
$p_{0}=p_{1}$). An online application has been developed which can be used to
obtain bias plots for other combinations of the parameters available at:
https://lindanab.shinyapps.io/SensitivityAnalysis.

###  3.2 Simulation study

A simulation study was conducted to study the finite sample properties of MSMs
estimated using IPW and conditional models if there is classification error in
the confounding variable. Five-thousand data sets were generated with sample
sizes of 1,000 and 100, using the following data generating mechanisms:

$\displaystyle L$ $\displaystyle\sim$
$\displaystyle\operatorname{Bern}\left({\lambda}\right),\quad
A|L\sim\operatorname{Bern}\left({\pi_{0}^{(1-L)}\pi_{1}^{L}}\right),$
$\displaystyle L^{*}|L$ $\displaystyle\sim$
$\displaystyle\operatorname{Bern}\left({p_{0}^{(1-L)}p_{1}^{L}}\right)\quad\text{and}\quad
Y|A,L\sim\mathcal{N}(1+\beta A+\gamma L,1).$

Five different scenarios were studied, of which the parameters values can be
found in Table 1. In all scenarios, the ATE $\beta$ (estimand) is 1 and the
association between the confounding variable $L$ and outcome $Y$ is positive
(i.e., $\gamma=2$). In scenario 0, we assume no classification error. In
scenarios 1-4, we assume that the error-prone variable $L^{*}$ is a
misclassified representation of $L$ with a sensitivity of 0.95 (i.e.,
$p_{0}=0.05$) and a specificity of 0.90 (i.e., $p_{1}=0.9$). In scenario 1,
bias in the ATE $\beta$ is expected to be negative since the probability of
receiving treatment given that $L$ is not present is greater than receiving
treatment given that $L$ is present, and the association between $L$ and $Y$
is positive (i.e., $\pi_{0}>\pi_{1}$ and $\gamma=2$). In contrast, in scenario
2 and 3, bias in the ATE is expected greater than null, since
$\pi_{0}<\pi_{1}$ and $\gamma=2$. Further, after investigation of Figure
LABEL:fig:biasplots, we expect that bias in the ATE estimated in the
conditional model is greater than bias in the ATE in a MSM estimated using IPW
in scenario 2 (and vice versa in scenario 3 and 4). Finally, in scenario 4, we
expect that bias in the ATE from the conditional model is equal to that in a
MSM estimated using IPW.

Model estimation and performance measures. The ATE $\beta$ (estimand) was
obtained by fitting a conditional model using conditional regression and by
fitting a MSM estimated using IPW, both using the misclassified confounding
variable $L^{*}$ instead of the confounding variable $L$ from the data
generating mechanism. For the MSM analysis we used the R package ipw [25]
[26]. Performance of both models was evaluated in terms of the bias, mean
model-based standard error standard error, and mean square error of the
estimated treatment effect, the percentages of 95% confidence intervals that
contain the true value of the estimand (coverage), the empirical standard
deviation of the estimated treatment effects (empSE) and mean model based
standard error of the estimated treatment effect. Robust model based standard
errors of the ATE in a MSM estimated using IPW were estimated using the R
package survey [27]. Monte Carlo standard errors were calculated for all
performance measures [28], using the R package rsimsum [29]. Additionally,
theoretical bias of the ATE in both methods was calculated based on the bias
expressions defined by model (3) and model (4).

Results. Table LABEL:tab:ressim shows the results of the simulation study.
Bias found in the simulation study corresponds to the theoretical bias derived
from the bias expressions. The standard deviation of the ATE estimates (empSE)
from the MSM estimated using IPW is equal to or greater than that from the
conditional model. Yet, in the scenarios where bias in the ATE in the MSM
estimated using IPW was smaller than bias in the conditional model (scenarios
2 and 3), empSE of both methods was equal, and hence, MSE is smaller for one
method if also bias is smaller. Furthermore, the (robust) model based standard
errors of the ATE in a MSM estimated using IPW are conservative and greater
than the empirical standard errors, since the uncertainty in estimating the
treatment weights is not taken into account. Allowing for the estimation of
the weights will shrink the standard errors [2, 30]. Consequently, confidence
intervals of the treatment effect obtained in a MSM estimated using IPW are
generally wider and coverage of the true treatment effect is higher compared
to a conditional model, ranging from over coverage if there is no
classification error to smaller under coverage when there is classification
error.

##  4 Illustration: sensitivity analysis of classification error in a
confounding variable

Sensitivity analyses provide a tool to incorporate uncertainty in study
results due to systematic errors [15, 17]. Using an example study of blood
pressure lowering therapy, we will illustrate how the bias expressions in
section 3 can be used to perform a sensitivity analysis for misclassification
in a confounder.

Application. To illustrate how the bias expressions can be used in a
sensitivity analysis for the ATE, we use data of the National Health And
Nutritional Examination Survey (NHANES) [31, 32]. Specifically, we study the
effect of diuretic use ($A=1$) in comparison to beta blocker use $(A=0$) on
systolic blood pressure ($Y$), adjusted for self-reported categorical body
mass index (BMI) ($L^{*}$). For this illustration, we categorise self-reported
BMI into two distinct categories: underweight/normal weight (BMI $<25$
($L^{*}=0$)) and overweight/obese (BMI $\geq 25$ ($L^{*}=1$)). However, we
stress that one should preferably not categorise BMI in most practical
applications [33].

We assume that blood pressure lowering therapy is initiated based on the true
BMI ($L$) instead of the observed self-reported BMI available in our data
(setting 2, depicted in Figure 1(b)). Further, we consider BMI the only
confounding variable, which is a simplification of reality. Our earlier
results indicate that if we use self-reported measures to adjust for BMI
instead of the true level of BMI, the ATE will be biased. To quantify how
large the bias in the ATE is expected to be due to classification error in
self-reported BMI category, we perform a sensitivity analysis using the bias
expressions presented in section 3.

The NHANES survey consists of questionnaires, followed by a standardized
health examination in specially equipped mobile examination centers. In the
2011-2014 sample 19,151 participants were physically examined. Of the 19,151
physically examined people, 12,185 participants aged over 16 were asked to
fill out a questionnaire, including questions on self-reported weight and
height, used to calculate self-reported BMI. For this illustration, we used
complete data on 585 users of diuretics and 824 users of beta blockers
(excluding non-users and people using both).

Average treatment effect. Table 2 shows the ATE of diuretics use in comparison
to beta blocker use on mean systolic blood pressure, unadjusted and adjusted
for self-reported BMI category. In a MSM estimated using IPW, an ATE (95 % CI)
of $-3.52$ $(-1.21;-5.74)$ was found. In a conditional regression model, the
ATE (95 % CI) was found to be $-3.48$ $(-1.27;-5.76)$.

Sensitivity analysis To inform the bias expressions, we need to make
assumptions on the sensitivity and specificity of the self-reported BMI as
well as that classification errors are non-differential with respect to blood
pressure and treatment. We speculate reasonable ranges for the sensitivity and
specificity of self-reported BMI category of $0.90$ to $0.98$. Reports in the
literature and/or a researcher’s own experience should inform these
parameters. Further, in the NHANES data, it was found that the prevalence of
self-reported overweight/obese was 0.77 ($\ell$), the probability of receiving
treatment given that one self-reports to be underweight/normal weight is 0.32
($\pi^{*}_{0}$), the probability of receiving treatment given that one self-
reports to be overweight/obese is 0.44 ($\pi^{*}_{1}$). The prevalence of
diuretic treatment use was 0.42 ($\omega$).

By uniformly sampling from the range of possible values of $p_{0}$ and $p_{1}$
and applying the bias expressions obtained in section 3, a distribution of
possible biases is obtained (see appendix section A2 for further details).
Figure 2 shows the distribution of bias in a MSM estimated using IPW. Mean
bias is -0.31 and median bias is -0.30 (interquartile range -0.40 to -0.20).
This result suggests that the results in Table 2 are not affected much by the
classification error in self-reported BMI category.

Figure 2: Predicted bias in average treatment effect of diuretics use compared
to beta blocker use on mean systolic blood pressure adjusted for self-reported
BMI category in NHANES, in a MSM estimated using IPW (msm, solid line) and
conditional model (cm, dashed line). The specificity and sensitivity of self-
reported BMI category range from $0.90$ to $0.98$.

BMI measured by trained technicians. In the NHANES, anthropometric measures
were also taken by trained health technicians. By using these measures to
calculate BMI category, we found that the specificity of self-reported BMI
category was $0.94$ ($p_{1}$), and the sensitivity was $0.92$ ($p_{0}=0.08$).
The ATE (CI) of diuretics use in comparison to beta blocker use on mean blood
pressure adjusted for BMI category was -3.59 (-5.84; -1.35) in a MSM estimated
using IPW. The ATE was slightly higher than that found by adjusting for self-
reported BMI category: -3.52 (-5.74;-1.21), Table 2. In conclusion, the bias
due to classification error was minor, a result in accordance with our
sensitivity analysis.

##  5 Discussion

Inverse probability weighting and conditional models are both important and
frequently used tools to adjust for confounding variables in observational
studies. In this article, we investigated the effect of classification error
in a confounding variable in a MSM-IPW in a point-treatment study with a
continuous outcome. We derived expressions for the bias in the ATE in a MSM-
IPW and a conditional model. These expressions can inform sensitivity analyses
for bias due to a misclassified confounding variable.

Sensitivity analysis of misclassified confounding variables is one example of
sensitivity analyses for observational epidemiologic studies. Several
approaches exist to assess sensitivity of causal conclusions to unmeasured
confounding [34, 35, 36], that aim to quantify the impact of violations of the
assumption of no unmeasured confounding, while our approach aims to quantify
the impact of violations of the assumption that all confounding variables are
measured without error. Although this paper discusses classification error in
a dichotomous confounding variable, the same principles apply to measurement
error in a categorical or continuous confounding variable or when multiple
confounding variables are considered. Clearly, in such more complex
situations, more elaborate assumptions about the structure of measurement
error should be made [37].

Several methods have been proposed to adjust for measurement error in
covariates in MSMs estimated using IPW. Pearl developed a general framework
for causal inference in the presence of error-prone covariates, which yields
weighted estimators in the case of a dichotomous confounding variable measured
with error [38]. The framework relies on a joint distribution of the outcome
and the confounding variable. Conversely, the weighting method proposed by
McCaffrey et al. does not require a model for the outcome [14]. Additionally,
regression calibration [39], simulation-extrapolation [8, 40] and multiple
imputation [41] have been proposed for correcting for measurement error in
covariates of MSMs. These previously discussed methods assume that the
measurement error model is known, which may often be unrealistic. In this
context it is also important to mention previous studies of the impact of
measurement error in the exposure or the endpoint in MSMs, which has been
studied by Babanezhad et. al [42] and Shu et. al [43], respectively.

If treatment is allocated based on an error-prone confounding variable, the
treatment effect will not be biased (see DAG in Figure 1(a)). However,
investigators should be careful in concluding that covariate measurement error
will not affect their analysis. Suppose that there is an unmeasured variable
$U$ that acts as a confounder between the error-prone covariate $L^{*}$ and
treatment $A$. Conditioning on $L^{*}$ will then open a path between $A$ and
$L$ via $U$ and thus confound the relation between $A$ and $Y$. Hence
unmeasured variables that would not be problematic if confounding variables
were measured without error can introduce unmeasured confounding when
confounding variables are measured with error.

This paper considered classification error in a dichotomous confounding
variable in a point-treatment study with a continuous outcome. Due to the
collapsibility of the marginal treatment effect and conditional treatment
effect under the identity link function, the marinal and conditional treatment
effect were equal in our study. This is generally not true for models with
non-collapsible measures, such as logistic regression. Future research could
extend this work to settings with a continuous confounding variable, a binary
outcome, multiple confounding variables and to the time-dependent setting with
time varying treatments and confounding variables.

The bias expressions derived in this paper can be used to assess bias due to
classification error in a dichotomous confounding variable. If classification
error in confounding variables is suspected, a sensitivity analysis provides
an opportunity to quantitatively inform readers on the possible impact of such
errors on causal conclusions.

## References

  * [1] MA Hernán, BA Brumback, and JM Robins.  Estimating the causal effect of zidovudine on CD4 count with a marginal structural model for repeated measures.  Stat Med, 21:1689–1709, 2002.
  * [2] JM Robins, MA Hernán, and BA Brumback.  Marginal structural models and causal inference in Epidemiology.  Am J Epidemiol, 11(5):550–560, 2000.
  * [3] DB Rubin.  For objective causal inference, design trumps analysis.  Ann Appl Stat, 2(3):808–840, 2008.
  * [4] PM Steiner, TD Cook, and WR Shadish.  On the Importance of reliable covariate measurement in selection bias adjustments using propensity scores.  J Educ Behav Stat, 36(2):213–236, 2011.
  * [5] KB Michels.  A renaissance for measurement error.  Int J Epidemiol, 30(3):421–422, 2001.
  * [6] M van Smeden, TL Lash, and RHH Groenwold.  Reflection on modern methods: Five myths about measurement error in epidemiologic research.  Int J Epidemiol, forthcoming, 2019.
  * [7] JM Raboud, L Haley, JS Montaner, C Murphy, M Januszewska, and MT Schechter.  Quantification of the variation due to laboratory and physiologic sources in CD4 lymphocyte counts of clinically stable HIV-infected individuals.  J Acquir Immune Defic Syndr Hum Retrovirol, 10(Suppl 2):67–73, 1995\.
  * [8] RP Kyle, EEM Moodie, MB Klein, and M Abrahamowicz.  Correcting for measurement error in time-varying covariates in marginal structural models.  Am J Epidemiol, 184(3):249–258, 2016.
  * [9] JP Buonaccorsi.  Measurement error: Models, methods, and applications.  Chapman & Hall/CRC, Boca Raton, FL, 2010.
  * [10] RJ Carroll, D Ruppert, LA Stefanski, and CM Crainiceanu.  Measurement error in nonlinear models: A modern perspective.  Chapman & Hall/CRC, Boca Raton, FL, 2nd edition, 2006.
  * [11] P Gustafson.  Measurement error and misclassification in statistics and epidemiology: Impacts and Bayesian adjustments. Chapman & Hall/CRC, Boca Raton, FL, 2004.
  * [12] WA Fuller.  Measurement Error Models.  John Wiley & Sons, New York, NY, 1987.
  * [13] MD Regier, EEM Moodie, and RW Platt.  The effect of error-in-confounders on the estimation of the causal parameter when using marginal structural models and inverse probability-of- treatment weights: A simulation study.  Int J Biostat, 10(1):1–15, 2014.
  * [14] DF McCaffrey, JR Lockwood, and CM Setodji.  Inverse probability weighting with error-prone covariates.  Biometrika, 100(3):671–680, 2013.
  * [15] S Greenland.  Basic methods for sensitivity analysis of biases.  Int J Epidemiol, 25(6):1107–1116, 1996.
  * [16] TL Lash, MP Fox, and AK Fink.  Applying quantitative bias analysis to epidemiologic data.  Springer, New York, NY, 2009.
  * [17] TL Lash, MP Fox, RF Maclehose, G Maldonado, LC Mccandless, and S Greenland.  Good practices for quantitative bias analysis.  Int J Epidemiol, 43(6):1969–1985, 2014.
  * [18] LA Jackson, ML Jackson, JC Nelson, KM Neuzil, and NS Weiss.  Evidence of bias in estimates of influenza vaccine effectiveness in seniors.  Int J Epidemiol, 35(2):337–344, 4 2006.
  * [19] DB Rubin.  Estimating causal effects of treatments in randomized and nonrandomized studies.  J Educ Psychol, 66(5):688–701, 1974.
  * [20] DB Rubin.  Formal modes of statistical inference for causal effects.  J Stat Plan Inference, 25:279–292, 1990.
  * [21] MA Hernån and JM Robins.  Causal Inference.  Chapman & Hall/CRC, Boca Raton, forthcoming edition, 2019.
  * [22] DB Rubin.  Randomization analysis of experimental data: The Fisher randomization test comment.  J Am Stat Assoc, 75(371):591–593, 1980.
  * [23] SR Cole and MA Hernán.  Constructing inverse probability weights for marginal structural models.  Am J Epidemiol, 168(6):656–664, 9 2008.
  * [24] PM Steiner and Y Kim.  The mechanics of omitted variable bias: bias amplification and cancellation of offsetting biases.  J Causal Inference, 4(2):20160009, 2016.
  * [25] R Core Team.  R: A language and environment for statistical computing, 2018.
  * [26] WM Van Der Wal and RB Geskus.  ipw: An R package for inverse probability weighting.  J Stat Softw, 43(13):1–23, 2011.
  * [27] T Lumley.  Analysis of complex survey samples.  J Stat Softw, 9(1):1–19, 2004.
  * [28] TP Morris, IR White, and MJ Crowther.  Using simulation studies to evaluate statistical methods.  Stat Med, pages 1–29, 2019.
  * [29] A Gasparini.  rsimsum: Summarise results from Monte Carlo simulation studies.  JOSS, 3(26):739, 6 2018.
  * [30] JM Robins.  Marginal structural models versus structural nested models as tools for causal inference.  In EM Halloran and D Berry, editors, Statistical models in epidemiology, the environment, and clinical trials, chapter 2, pages 95–133. Springer-Verlag, New York, 1 edition, 2000.
  * [31] Centers for Disease Control and Prevention (CDC). National Center for Health Statistics (NCHS). National Health and Nutrition Examination Survey Data. Hyattsville, MD: U.S. Department of Health and Human Services, Centers for Disease Control and Prevention, [2011-2012], [https://wwwn.cdc.gov/nchs/nhanes/continuousnhanes/default.aspx?BeginYear=2011].
  * [32] Centers for Disease Control and Prevention (CDC). National Center for Health Statistics (NCHS). National Health and Nutrition Examination Survey Data. Hyattsville, MD: U.S. Department of Health and Human Services, Centers for Disease Control and Prevention, [2013-2014], [https://wwwn.cdc.gov/nchs/nhanes/continuousnhanes/default.aspx?BeginYear=2013].
  * [33] DG Altman and P Royston.  The cost of dichotomising continuous variables.  BMJ, 332:1080, 2006.
  * [34] RHH Groenwold, DB Nelson, KL Nichol, AW Hoes, and E Hak.  Sensitivity analyses to estimate the potential impact of unmeasured confounding in causal research.  Int J Epidemiol, 39(1):107–117, 2 2010.
  * [35] TJ VanderWeele and OA Arah.  Bias formulas for sensitivity analysis of unmeasured confounding for general outcomes, treatments, and confounders.  Epidemiology, 22(1):42–52, 2011.
  * [36] P Ding and TJ VanderWeele.  Sensitivity analysis without assumptions.  Epidemiology, 27(3):368–377, 2016.
  * [37] RH Keogh and IR White.  A toolkit for measurement error correction, with a focus on nutritional epidemiology.  Stat Med, 33:2137–2155, 2014.
  * [38] J Pearl.  On measurement bias in causal inference.  Technical report, AUAI, Corvallis, OR, 2010.
  * [39] SR Cole, LP Jacobson, PC Tien, L Kingsley, JS Chmiel, and K Anastos.  Using marginal structural measurement-error models to estimate the long-term effect of antiretroviral therapy on incident AIDS or death.  Am J Epidemiol, 171(1):113–122, 2010.
  * [40] JR Lockwood and DF McCaffrey.  Simulation-Extrapolation for estimating means and causal effects with mismeasured covariates.  Obs Stud, 1:241–290, 2015.
  * [41] Y Webb-Vargas, KE Rudolph, D Lenis, P Murakami, and EA Stuart.  An imputation-based solution to using mismeasured covariates in propensity score analysis.  Stat Methods Med Res, 26(4):1824–1837, 2017.
  * [42] M Babanezhad, S Vansteelandt, and E Goetghebeur.  Comparison of causal effect estimators under exposure misclassification.  J Stat Plan Inference, 140:1306–1319, 2010.
  * [43] Di Shu and Grace Y. Yi.  Causal inference with measurement error in outcomes: Bias analysis and estimation methods, 2017.

Table 1: Values of the parameters in the five different simulation scenarios Scenario | $p_{0}$ | $p_{1}$ | $\lambda$ | $\pi_{0}$ | $\pi_{1}$ | $\beta$ | $\gamma$
---|---|---|---|---|---|---|---
0 | 0 | 1 | 0.50 | 0.50 | 0.75 | 1 | 2
1 | 0.05 | 0.90 | 0.50 | 0.90 | 0.45 | 1 | 2
2 | 0.05 | 0.90 | 0.80 | 0.25 | 0.75 | 1 | 2
3 | 0.05 | 0.90 | 0.80 | 0.50 | 0.75 | 1 | 2
4 | 0.05 | 0.90 | 0.45 | 0.50 | 0.75 | 1 | 2
Table 2: Average treatment effect of diuretics use compared to beta blocker
use on mean systolic blood pressure unadjusted and adjusted for self-reported
categorised BMI

Model | Effect size (CI)
---|---
Unadjusted | -4.03 (-6.30; -1.76)
Marginal structural modela | -3.52 (-1.21; -5.74)
Conditional model | -3.48 (-1.27; -5.76)

  * a

estimated using inverse probability weighting

##  Appendix A1 Quantification of bias due to classification error in a
confounding variable

###  A1.1 Conditional model

Under the assumptions in section 2 and by the law of total expectation, the
expected value of the outcome $Y$ given the covariates $A$ and $L^{*}$ is,

$\displaystyle\operatorname{\mathbb{E}}[Y|A=a,L^{*}]=\operatorname{\mathbb{E}}_{L|A=a,L^{*}}[\operatorname{\mathbb{E}}[Y|A=a,L^{*},L]]$
$\displaystyle=$
$\displaystyle\operatorname{\mathbb{E}}_{L|A=a,L^{*}}[\alpha+\beta a+\gamma
L]$ $\displaystyle=$ $\displaystyle\alpha+\beta
a+\gamma\operatorname{\mathbb{E}}[L|A=a,L^{*}]$ $\displaystyle=$
$\displaystyle\alpha+\beta a+\gamma\phi_{aL^{*}}$ $\displaystyle=$
$\displaystyle\\{\alpha+\gamma\phi_{00}\\}+\\{\beta+\gamma(\phi_{10}-\phi_{00})\\}a$
$\displaystyle+$
$\displaystyle\\{\gamma(\phi_{01}-\phi_{00})\\}L^{*}+\gamma(\phi_{11}-\phi_{10}-\phi_{01}+\phi_{00})aL^{*},$

which relies on the assumption that $L^{*}$ is non-differentially
misclassified with respect to the outcome and includes an interaction between
$A$ and $L^{*}$. Further, $\phi_{al^{*}}$ is the probability that confounding
variable $L$ is one, given that treatment $A$ is $a$ and that misclassfied
confounding variable $L^{*}$ is $l^{*}$, or,

$\displaystyle\phi_{al^{*}}$ $\displaystyle=$ $\displaystyle
P(L=1|A=a,L^{*}=l^{*})$ $\displaystyle=$
$\displaystyle\frac{P(A=a|L=1,L^{*}=l^{*})P(L=1|L^{*}=l^{*})}{P(A=a|L^{*}=l^{*})}$
$\displaystyle=$
$\displaystyle\frac{P(A=a|L=1)P(L=1|L^{*}=l^{*})}{P(A=a|L^{*}=l^{*})}$
$\displaystyle=$
$\displaystyle\frac{P(A=a|L=1)\frac{P(L^{*}=l^{*}|L=1)P(L=1)}{P(L^{*}=l^{*})}}{P(A=a|L^{*}=l^{*})}$
$\displaystyle=$
$\displaystyle\frac{P(A=a|L=1)P(L^{*}=l^{*}|L=1)P(L=1)}{P(A=a|L^{*}=l^{*})P(L^{*}=l^{*})}$
$\displaystyle=$
$\displaystyle\frac{\lambda(1-\pi_{1})^{(1-a)}\pi_{1}^{a}(1-p_{1})^{(1-l^{*})}p_{1}^{l^{*}}}{(1-\pi^{*}_{l^{*}})^{(1-a)}{\pi^{*}_{l^{*}}}^{a}(1-\ell)^{(1-l^{*})}\ell^{l^{*}}}.$

Where $\ell=P(L^{*}=l^{*})=p_{0}(1-\lambda)+p_{1}\lambda$ and
$\pi^{*}_{l^{*}}$ is the probability that treatment $A$ is one given that the
misclassified confounding variable $L^{*}=l^{*}$ or,

$\displaystyle\pi^{*}_{l^{*}}$ $\displaystyle=$ $\displaystyle
P(A=1|L^{*}=l^{*})$ $\displaystyle=$
$\displaystyle\Sigma_{l}P(A=1|L^{*}=l^{*},L=l)P(L=l|L^{*}=l^{*})$
$\displaystyle=$ $\displaystyle\Sigma_{l}P(A=1|L=l)P(L=l|L^{*}=l^{*})$
$\displaystyle=$
$\displaystyle\Sigma_{l}P(A=1|L=l)\frac{P(L^{*}=l^{*}|L=l)P(L=l)}{P(L^{*}=l^{*})}$
$\displaystyle=$
$\displaystyle\Sigma_{l}\pi_{l}\frac{(1-p_{l})^{(1-l^{*})}p_{l}^{l^{*}}(1-\lambda)^{1-l}\lambda^{l}}{(1-\ell)^{1-l^{*}}\ell^{l^{*}}}.$

Thus, the bias in the coefficient for $A=a$ is $\gamma(\phi_{10}-\phi_{00})$
if one includes an interaction term between $A$ and $L^{*}$ to model mean $Y$
given $A$ and $L^{*}$. Yet, in this model, the coefficient for $A=a$ now
represents the ATE given that $L^{*}$ is null. Typically, one would only
include main effects of $A$ and $L^{*}$ in a conditional model for $Y$
conditional on $A$ and $L^{*}$:

$\displaystyle\operatorname{\mathbb{E}}[Y|A=a,L^{*}]$ $\displaystyle=$
$\displaystyle\\{\alpha+\gamma\phi_{00}\\}+\\{\beta+\gamma(\phi_{10}-\phi_{00})\\}a+\\{\gamma(\phi_{01}-\phi_{00})\\}L^{*}$
$\displaystyle+$
$\displaystyle\gamma(\phi_{11}-\phi_{10}-\phi_{01}+\phi_{00})aL^{*}$
$\displaystyle=$
$\displaystyle\\{\alpha+\gamma\phi_{00}\\}+\\{\beta+\gamma(\phi_{10}-\phi_{00})\\}a+\\{\gamma(\phi_{01}-\phi_{00})\\}L^{*}$
$\displaystyle+$
$\displaystyle\gamma(\phi_{11}-\phi_{10}-\phi_{01}+\phi_{00})\operatorname{\mathbb{E}}[aL^{*}|A=a,L]$
$\displaystyle=$ $\displaystyle\\{\alpha+\gamma\phi_{00}+\delta
u_{0}\\}+\\{\beta+\gamma(\phi_{10}-\phi_{00})+\delta u_{A}\\}a$
$\displaystyle+$ $\displaystyle\\{\gamma(\phi_{01}-\phi_{00})+\delta
u_{L^{*}}\\}L^{*},$

where $u_{0},u_{A},u_{L^{*}}$ are the coefficients of the linear model
$\operatorname{\mathbb{E}}[AL^{*}|AL]=u_{0}+u_{A}A+u_{L^{*}}L$ and
$\delta=\gamma(\phi_{11}-\phi_{10}-\phi_{01}+\phi_{00})$. Here,

$\displaystyle u_{A}$ $\displaystyle=$
$\displaystyle\frac{\operatorname*{\mathbb{V}ar}(L^{*})\operatorname*{\mathbb{C}ov}(A,AL^{*})-\operatorname*{\mathbb{C}ov}(A,L^{*})\operatorname*{\mathbb{C}ov}(L^{*},AL^{*})}{\operatorname*{\mathbb{V}ar}(L^{*})\operatorname*{\mathbb{V}ar}(A)-\operatorname*{\mathbb{C}ov}(A,L^{*})^{2}},$
$\displaystyle u_{L^{*}}$ $\displaystyle=$
$\displaystyle\frac{\operatorname*{\mathbb{V}ar}(A)\operatorname*{\mathbb{C}ov}(L^{*},AL^{*})-\operatorname*{\mathbb{C}ov}(A,L^{*})\operatorname*{\mathbb{C}ov}(A,AL^{*})}{\operatorname*{\mathbb{V}ar}(L^{*})\operatorname*{\mathbb{V}ar}(A)-\operatorname*{\mathbb{C}ov}(A,L^{*})^{2}},$
$\displaystyle u_{0}$ $\displaystyle=$
$\displaystyle\overline{AL^{*}}-u_{A}\overline{A}-u_{L^{*}}\overline{L^{*}},$

where $\overline{AL^{*}},\overline{A}$ and $\overline{L^{*}}$ denote mean of
$A$ times $L^{*}$, $A$ and $L^{*}$, respectively. Now, we like to express
$u_{A}$ and $u_{L^{*}}$ in terms of $\lambda$, $\pi_{0}$, $\pi_{1}$, $p_{0}$
and $p_{1}$. We can write a linear model for the model of $A$ conditional on
$L^{*}$ using that $P(A=1|L^{*}=l^{*})=\pi^{*}_{l^{*}}$ and use standard
regression theory to get an expression for
$\operatorname*{\mathbb{C}ov}(A,L^{*})$:

$\displaystyle\operatorname{\mathbb{E}}[A|L^{*}]=\pi^{*}_{0}+(\pi^{*}_{1}-\pi^{*}_{0})L^{*},\quad\pi^{*}_{1}-\pi^{*}_{0}=\frac{\operatorname*{\mathbb{C}ov}(A,L^{*})}{\operatorname*{\mathbb{V}ar}(L^{*})},\quad\text{thus}\quad\operatorname*{\mathbb{C}ov}(A,L^{*})=(\pi^{*}_{1}-\pi^{*}_{0})\operatorname*{\mathbb{V}ar}(L^{*}).$

Where, $\operatorname*{\mathbb{V}ar}(L^{*})=\ell(1-\ell)$. Since
$\operatorname{\mathbb{E}}[AL^{*}|L=0]=0$ and
$\operatorname{\mathbb{E}}[AL^{*}|L=1]=\operatorname{\mathbb{E}}[A|L^{*}=1]=\pi^{*}_{1}$,
it follows that,

$\displaystyle\operatorname{\mathbb{E}}[AL^{*}|L^{*}]$ $\displaystyle=$
$\displaystyle\pi^{*}_{1}L^{*},\quad\pi^{*}_{1}=\frac{\operatorname*{\mathbb{C}ov}(AL^{*},L^{*})}{\operatorname*{\mathbb{V}ar}(L^{*})},\quad\text{thus}\quad\operatorname*{\mathbb{C}ov}(AL^{*},L^{*})=\pi^{*}_{1}\operatorname*{\mathbb{V}ar}(L^{*}).$

Equivalently, since $\operatorname{\mathbb{E}}[AL^{*}|A=0]=0$ and
$\operatorname{\mathbb{E}}[AL^{*}|A=1]=\operatorname{\mathbb{E}}[L^{*}|A=1]$,
it follows that,

$\displaystyle\operatorname{\mathbb{E}}[AL^{*}|A]$ $\displaystyle=$
$\displaystyle\operatorname{\mathbb{E}}[L^{*}|A=1]A=\frac{P(A=1|L^{*}=1)P(L^{*}=1)}{P(A=1)}A,$
$\displaystyle\operatorname{\mathbb{E}}[L^{*}|A=1]$ $\displaystyle=$
$\displaystyle\frac{\pi^{*}_{1}\ell}{\omega},\quad\frac{\pi^{*}_{1}\ell}{a}=\frac{\operatorname*{\mathbb{C}ov}(AL^{*},A)}{\operatorname*{\mathbb{V}ar}(A)},\quad\text{thus}\quad\operatorname*{\mathbb{C}ov}(AL^{*},A)=\frac{\pi^{*}_{1}\ell}{\omega}\operatorname*{\mathbb{V}ar}(A).$

Where, $\operatorname*{\mathbb{V}ar}(A)=\omega(1-\omega)$, and
$\omega=P(A=1)=\pi_{0}(1-\lambda)+\pi_{1}\lambda$. To conclude,

$\displaystyle u_{A}$ $\displaystyle=$
$\displaystyle\frac{\pi_{1}^{*}\ell/\omega\operatorname*{\mathbb{V}ar}(A)\operatorname*{\mathbb{V}ar}(L^{*})-\pi_{1}^{*}(\pi^{*}_{1}-\pi^{*}_{0})\operatorname*{\mathbb{V}ar}(L^{*})^{2}}{\operatorname*{\mathbb{V}ar}(A)\operatorname*{\mathbb{V}ar}(L^{*})-(\pi_{1}-\pi_{0})^{2}\operatorname*{\mathbb{V}ar}(L^{*})^{2}}$
$\displaystyle=$
$\displaystyle\frac{\pi_{1}^{*}\ell/\omega\operatorname*{\mathbb{V}ar}(A)-\pi_{1}^{*}(\pi^{*}_{1}-\pi^{*}_{0})\operatorname*{\mathbb{V}ar}(L^{*})}{\operatorname*{\mathbb{V}ar}(A)-(\pi_{1}-\pi_{0})^{2}\operatorname*{\mathbb{V}ar}(L^{*})}$
$\displaystyle=$
$\displaystyle\frac{\pi^{*}_{1}\ell(1-\omega)-\pi^{*}_{1}(\pi^{*}_{1}-\pi^{*}_{0})\ell(1-\ell))}{\omega(1-\omega)-(\pi^{*}_{1}-\pi^{*}_{0})^{2}\ell(1-\ell)}$
$\displaystyle u_{L^{*}}$ $\displaystyle=$
$\displaystyle\frac{\pi^{*}_{1}\operatorname*{\mathbb{V}ar}(A)\operatorname*{\mathbb{V}ar}(L^{*})-\pi^{*}_{1}\ell/\omega(\pi^{*}_{1}-\pi^{*}_{0})\operatorname*{\mathbb{V}ar}(A)\operatorname*{\mathbb{V}ar}(L^{*})}{\operatorname*{\mathbb{V}ar}(L^{*})\operatorname*{\mathbb{V}ar}(A)-((\pi^{*}_{1}-\pi^{*}_{0})\operatorname*{\mathbb{V}ar}(L^{*}))^{2}},$
$\displaystyle u_{0}$ $\displaystyle=$
$\displaystyle\overline{AL^{*}}-u_{A}\overline{A}-u_{L^{*}}\overline{L^{*}}.$

The intercept, the coefficient for $A$ and the coefficient for $L^{*}$ in a
conditional model for $Y$ conditional on $A$ and $L^{*}$ which includes only
main effects of $A$ and $L^{*}$ are, respectively:

$\displaystyle\alpha+\gamma\phi_{00}+\delta u_{0},$
$\displaystyle\beta+\gamma(\phi_{10}-\phi_{00})(1-\frac{\pi^{*}_{1}\ell(1-\omega)-\pi^{*}_{1}(\pi^{*}_{1}-\pi^{*}_{0})\ell(1-\ell))}{\omega(1-\omega)-(\pi^{*}_{1}-\pi^{*}_{0})^{2}\ell(1-\ell)})$
$\displaystyle+\gamma(\phi_{11}-\phi_{01})(\frac{\pi^{*}_{1}\ell(1-\omega)-\pi^{*}_{1}(\pi^{*}_{1}-\pi^{*}_{0})\ell(1-\ell))}{\omega(1-\omega)-(\pi^{*}_{1}-\pi^{*}_{0})^{2}\ell(1-\ell)}),$
$\displaystyle\text{and}\quad\gamma(\phi_{01}-\phi_{00})+\delta u_{L^{*}}.$

###  A1.2 MSM

Under the assumptions in section 2, a MSM under model (2) proceeds by solving
the weighted regression model,

$\displaystyle\sum_{i=1}^{n}\frac{1}{P(A_{i}|L_{i}^{*})}(Y_{i}-\alpha_{\text{msm}}-\beta
A_{i})=0\quad\text{and}\quad\sum_{i=1}^{n}\frac{A_{i}}{P(A_{i}|L_{i}^{*})}(Y_{i}-\alpha_{\text{msm}}-\beta
A_{i})=0.$

Solving these equations for $\alpha_{\text{msm}}$ and $\beta$ result in the
following estimators:

$\displaystyle\hat{\alpha}_{\mathrm{msm}}=\overline{Y}_{w^{*}}-\hat{\beta}_{\mathrm{msm}}\overline{A}_{w^{*}}\quad\text{and}\quad\hat{\beta}=\frac{\sum_{i=1}^{n}\frac{1}{P(A_{i}|L_{i})}(Y_{i}-\overline{Y}_{w^{*}})(A_{i}-\overline{A}_{w^{*}})}{\sum_{i=1}^{n}\frac{1}{P(A_{i}|L_{i})}(A_{i}-\overline{A}_{w^{*}})^{2}}.$

Where,

$\displaystyle\overline{Y}_{w^{*}}=\frac{\sum_{i=1}^{n}Y_{i}/P(A_{i}|L_{i}^{*})}{\sum_{i=1}^{n}1/P(A_{i}|L_{i}^{*})}\quad\text{and}\quad\overline{A}_{w^{*}}=\frac{\sum_{i=1}^{n}A_{i}/P(A_{i}|L_{i}^{*})}{\sum_{i=1}^{n}1/P(A_{i}|L_{i}^{*})}.$

Let $n^{*}_{al}$ be the number of people with $A=a$ and $L^{*}=l^{*}$. In a
population of $n$ people,

$\displaystyle n^{*}_{00}$ $\displaystyle=$ $\displaystyle
nP(A=0,L^{*}=0)=nP(A=0|L^{*}=0)P(L^{*}=0)$ $\displaystyle=$ $\displaystyle
n\sum^{l}P(A=0|L=l,L^{*}=0)P(L=l|L^{*}=0)$ $\displaystyle=$ $\displaystyle
n\sum^{l}P(A=0|L=l)P(L=l|L^{*}=0)P(L^{*}=0)$ $\displaystyle=$ $\displaystyle
n\sum^{l}P(A=0|L=l)P(L=l)P(L^{*}=0|L=l)$ $\displaystyle=$ $\displaystyle
n_{00}(1-p_{0})+n_{01}(1-p_{1}),$ $\displaystyle n^{*}_{01}$ $\displaystyle=$
$\displaystyle n_{00}p_{0}+n_{01}p_{1},\quad
n^{*}_{10}=n_{10}(1-p_{0})+n_{11}(1-p_{1})\quad\text{and}\quad
n^{*}_{11}=n_{10}p_{0}+n_{11}p_{1}.$

Hence,

$\displaystyle\sum_{i=1}^{n}1/P(A_{i}|L_{i}^{*})$ $\displaystyle=$
$\displaystyle\sum_{i=1}^{n}\frac{1}{\sum_{l}[P(A_{i}|L_{i}^{*},L=l)P(L=l|L_{i}^{*})]}$
$\displaystyle=$
$\displaystyle\sum_{i=1}^{n}\frac{1}{\sum_{l}[P(A_{i}|L=l)P(L=l|L_{i}^{*})]}$
$\displaystyle=$
$\displaystyle\sum^{n^{*}_{00}}\frac{1}{\sum_{l}[(1-\pi_{l})P(L=l|L^{*}=0)]}+\sum^{n^{*}_{01}}\frac{1}{\sum_{l}[(1-\pi_{l})P(L=l|L^{*}=1)]}$
$\displaystyle+$
$\displaystyle\sum^{n^{*}_{10}}\frac{1}{\sum_{l}[\pi_{l}P(L=l|L^{*}=0)]}+\sum^{n^{*}_{11}}\frac{1}{\sum_{l}[\pi_{l}P(L=l|L^{*}=1)]}.$

Where,

$\displaystyle\sum^{n^{*}_{00}}\frac{1}{\sum_{l}[(1-\pi_{l})P(L=l|L^{*}=0)]}$
$\displaystyle=$
$\displaystyle\frac{n_{00}(1-p_{0})+n_{01}(1-p_{1})}{(1-\pi_{0})P(L=0|L^{*}=0)+(1-\pi_{1})P(L=1|L^{*}=0)}=$
$\displaystyle=$
$\displaystyle\frac{n_{00}(1-p_{0})+n_{01}(1-p_{1})}{(1-\pi_{0})\frac{P(L^{*}=0|L=0)(1-\lambda)}{P(L^{*}=0)}+(1-\pi_{1})\frac{P(L^{*}=0|L=1)\lambda}{P(L^{*}=0)}}=$
$\displaystyle=$
$\displaystyle\frac{n_{00}(1-p_{0})+n_{01}(1-p_{1})}{\frac{n_{00}}{nP(L^{*}=0)}(1-p_{0})+\frac{n_{01}}{nP(L^{*}=0)}(1-p_{1})}$
$\displaystyle=$ $\displaystyle\frac{1}{1/(nP(L^{*}=0))}$ $\displaystyle=$
$\displaystyle nP(L^{*}=0)=n(1-\ell),$
$\displaystyle\sum^{n^{*}_{01}}\frac{1}{\sum_{l}[(1-\pi_{l})P(L=l|L^{*}=1)]}$
$\displaystyle=$ $\displaystyle nP(L^{*}=1)=n\ell,$
$\displaystyle\sum^{n^{*}_{10}}\frac{1}{\sum_{l}[\pi_{l}P(L=l|L^{*}=0)]}$
$\displaystyle=$ $\displaystyle nP(L^{*}=0)=n(1-\ell),$
$\displaystyle\sum^{n^{*}_{11}}\frac{1}{\sum_{l}[\pi_{l}P(L=l|L^{*}=1)]}$
$\displaystyle=$ $\displaystyle nP(L^{*}=1)=n\ell.$

Frow which it follows that,

$\displaystyle\sum_{i=1}^{n}1/P(A_{i}|L_{i}^{*})=2n(1-\ell)+2n\ell=2n.$

Further,

$\displaystyle\sum_{i=1}^{n}\operatorname{\mathbb{E}}[Y_{i}]/P(A_{i}|L^{*}_{i})$
$\displaystyle=$
$\displaystyle\sum^{n^{*}_{00}}\frac{\operatorname{\mathbb{E}}[Y_{i}]}{\sum_{l}[(1-\pi_{l})P(L=l|L^{*}=0)]}+\sum^{n^{*}_{01}}\frac{\operatorname{\mathbb{E}}[Y_{i}]}{\sum_{l}[(1-\pi_{l})P(L=l|L^{*}=1)]}$
$\displaystyle+$
$\displaystyle\sum^{n^{*}_{10}}\frac{\operatorname{\mathbb{E}}[Y_{i}]}{\sum_{l}[\pi_{l}P(L=l|L^{*}=0)]}+\sum^{n^{*}_{11}}\frac{\operatorname{\mathbb{E}}[Y_{i}]}{\sum_{l}[\pi_{l}P(L=l|L^{*}=1)]}$
$\displaystyle=$ $\displaystyle\sum^{n^{*}_{00}}\frac{\alpha+\gamma
P(L=1|A=0,L^{*}=0)}{\sum_{l}[(1-\pi_{l})P(L=l|L^{*}=0)]}+\sum^{n^{*}_{01}}\frac{\alpha+\gamma
P(L=1|A=0,L^{*}=1)}{\sum_{l}[(1-\pi_{l})P(L=l|L^{*}=1)]}$ $\displaystyle+$
$\displaystyle\sum^{n^{*}_{10}}\frac{\alpha+\beta+\gamma
P(L=1|A=1,L^{*}=0)}{\sum_{l}[\pi_{l}P(L=l|L^{*}=0)]}+\sum^{n^{*}_{11}}\frac{\alpha+\beta+\gamma
P(L=1|A=1,L^{*}=1)}{\sum_{l}[\pi_{l}P(L=l|L^{*}=1)]}$ $\displaystyle=$
$\displaystyle
n\alpha(1-\ell)+n\gamma(1-\ell)\phi_{00}+n\alpha\ell+n\gamma\phi_{01}+n(\alpha+\beta)(1-\ell)+n\gamma(1-\ell)\phi_{10}$
$\displaystyle+$ $\displaystyle n(\alpha+\beta)\ell+n\gamma\phi_{11}$
$\displaystyle=$ $\displaystyle
2n\alpha+n\beta+n\gamma(1-\ell)(\phi_{00}+\phi_{10})+n\gamma\ell(\phi_{01}+\phi_{11})$

And,

$\displaystyle\sum_{i=1}^{n}A_{i}/P(A_{i}|L_{i})$ $\displaystyle=$
$\displaystyle\sum^{n^{*}_{10}}\frac{1}{\sum_{l}[\pi_{l}P(L=l|L^{*}=0)]}+\sum^{n^{*}_{11}}\frac{1}{\sum_{l}[\pi_{l}P(L=l|L^{*}=1)]}$
$\displaystyle=$ $\displaystyle
n(1-p_{0})(1-\lambda)+n(1-p_{1})\lambda+np_{0}(1-\lambda)+np_{1}\lambda=n.$

Thus,

$\displaystyle\operatorname{\mathbb{E}}[\overline{Y}_{w^{*}}]=\alpha+\beta/2+\gamma/2(1-\ell)(\phi_{00}+\phi_{10})+\gamma/2\ell(\phi_{01}+\phi_{11})\quad\text{and}\quad\overline{A}_{w^{*}}=n/2n=1/2.$

And,

$\displaystyle\sum_{i=1}^{n}\frac{(A_{i}-\overline{A}_{w^{*}})^{2}}{P(A_{i}|L^{*}_{i})}$
$\displaystyle=$
$\displaystyle\sum^{n^{*}_{00}}\frac{(-1/2)^{2}}{\sum_{l}[(1-\pi_{l})P(L=l|L^{*}=0)]}$
$\displaystyle+$
$\displaystyle\sum^{n^{*}_{01}}\frac{(-1/2)^{2}}{\sum_{l}[(1-\pi_{l})P(L=l|L^{*}=1)]}$
$\displaystyle+$
$\displaystyle\sum^{n^{*}_{10}}\frac{(1-1/2)^{2}}{\sum_{l}[\pi_{l}P(L=l|L^{*}=0)]}$
$\displaystyle+$
$\displaystyle\sum^{n^{*}_{11}}\frac{(1-1/2)^{2}}{\sum_{l}[\pi_{l}P(L=l|L^{*}=1)]}$
$\displaystyle=$ $\displaystyle
1/4\times\sum_{i=1}^{n}1/P(A_{i}|L_{i}^{*})=n/2.$
$\displaystyle\sum_{i=1}^{n}\frac{\operatorname{\mathbb{E}}[(Y_{i}-\overline{Y}_{w^{*}})](A_{i}-\overline{A}_{\tilde{w}})}{P(A_{i}|L^{*}_{i})}$
$\displaystyle=$
$\displaystyle\sum^{n^{*}_{00}}\frac{\beta/4-\gamma/2\phi_{00}+\gamma/4(1-\ell)(\phi_{00}+\phi_{10})+\gamma/4\ell(\phi_{01}+\phi_{11})}{\sum_{l}[(1-\pi_{l})P(L=l|L^{*}=0)]}$
$\displaystyle+$
$\displaystyle\sum^{n^{*}_{01}}\frac{\beta/4-\gamma/2\phi_{01}+\gamma/4(1-\ell)(\phi_{00}+\phi_{10})+\gamma/4\ell(\phi_{01}+\phi_{11})}{\sum_{l}[(1-\pi_{l})P(L=l|L^{*}=1)]}$
$\displaystyle+$
$\displaystyle\sum^{n^{*}_{10}}\frac{\beta/4+\gamma/2\phi_{10}-\gamma/4(1-\ell)(\phi_{00}+\phi_{10})-\gamma/4\ell(\phi_{01}+\phi_{11})}{\sum_{l}[\pi_{l}P(L=l|L^{*}=0)]}$
$\displaystyle+$
$\displaystyle\sum^{n^{*}_{11}}\frac{\beta/4+\gamma/2\phi_{11}-\gamma/4(1-\ell)(\phi_{00}+\phi_{10})-\gamma/4\ell(\phi_{01}+\phi_{11})}{\sum_{l}[\pi_{l}P(L=l|L^{*}=0)]}$
$\displaystyle=$ $\displaystyle
n(1-\ell)(\beta/4-\gamma/2\phi_{00}+\gamma/4(1-\ell)(\phi_{00}+\phi_{10})+\gamma/4\ell(\phi_{01}+\phi_{11}))$
$\displaystyle+$ $\displaystyle
n\ell(\beta/4-\gamma/2\phi_{01}+\gamma/4(1-\ell)(\phi_{00}+\phi_{10})+\gamma/4\ell(\phi_{01}+\phi_{11}))$
$\displaystyle+$ $\displaystyle
n(1-\ell)(\beta/4+\gamma/2\phi_{10}-\gamma/4(1-\ell)(\phi_{00}+\phi_{10})-\gamma/4\ell(\phi_{01}+\phi_{11}))$
$\displaystyle+$ $\displaystyle
n\ell(\beta/4+\gamma/2\phi_{11}-\gamma/4(1-\ell)(\phi_{00}+\phi_{10})-\gamma/4\ell(\phi_{01}+\phi_{11}))$
$\displaystyle=$ $\displaystyle
n/2(\beta(1-\ell)+\beta\ell-\gamma(1-\ell)\phi_{00}-\gamma\ell\phi_{01}+\gamma(1-\ell)\phi_{10}+\gamma\ell\phi_{11})$
$\displaystyle=$ $\displaystyle
n/2(\beta+\gamma(1-\ell)(\phi_{10}-\phi_{00})+\gamma\ell(\phi_{11}-\phi_{01})$

In conclusion,

$\displaystyle\operatorname{\mathbb{E}}[\hat{\beta}]=\beta+\gamma(\phi_{10}-\phi_{00})(1-\ell)+\gamma(\phi_{11}-\phi_{01})\ell\quad\text{and}\quad\operatorname{\mathbb{E}}[\hat{\alpha}_{\mathrm{msm}}]$
$\displaystyle=$
$\displaystyle\alpha+\gamma/2\times[2(1-\ell)\phi_{00}+2\ell\phi_{01})]$
$\displaystyle=$
$\displaystyle\alpha+\gamma\phi_{00}(1-\ell)+\gamma\phi_{01}\ell.$

##  Appendix A2 Illustration: sensitivity analysis of classification error in
a confounding variable

To inform a sensitivity analysis, one needs to make an informed guess about
the values for $p_{0}$, $p_{1}$. From the data, one can estimate $\ell$,
$\omega$, $\pi^{*}_{0}$ and $\pi^{*}_{1}$. We calculate $\lambda,\pi_{0}$ and
$\pi_{1}$ by using the data and the assumed $p_{0}$ and $p_{1}$. Since,

$\displaystyle\lambda=\frac{\ell-
p_{0}}{p_{1}-p_{0}},\quad\pi_{0}^{*}=\frac{\pi_{0}(1-p_{0})(1-\lambda)+\pi_{1}(1-p_{1})\lambda}{(1-\ell)},\quad\text{and}\quad\pi_{1}^{*}=\frac{\pi_{0}p_{0}(1-\lambda)+\pi_{1}p_{1}\lambda}{\ell},$

it follows that,

$\displaystyle\pi_{0}=\frac{\pi_{0}^{*}(1-\ell)-\pi_{1}(1-p_{1})\lambda}{(1-p_{0})(1-\lambda)},\quad\pi_{1}=\frac{\pi_{1}^{*}\ell-\pi_{0}p_{0}(1-\lambda)}{p_{1}\lambda}.$
(A1)

By rewriting the expression for $\pi_{1}$ by using the expression for
$\pi_{0}$, it follows that,

$\displaystyle\pi_{1}$ $\displaystyle=$
$\displaystyle\frac{\pi_{1}^{*}\ell-\pi_{0}p_{0}(1-\lambda)}{p_{1}\lambda}$
$\displaystyle=$
$\displaystyle\frac{\pi_{1}^{*}\ell-\frac{\pi_{0}^{*}(1-\ell)-\pi_{1}(1-p_{1})\lambda}{(1-p_{0})(1-\lambda)}p_{0}(1-\lambda)}{p_{1}\lambda}$
$\displaystyle=$
$\displaystyle\frac{\pi_{1}^{*}\ell-(\pi_{0}^{*}(1-\ell)-\pi_{1}(1-p_{1})\lambda)\frac{p_{0}}{(1-p_{0})}}{p_{1}\lambda}$
$\displaystyle=$
$\displaystyle\frac{\pi_{1}^{*}\ell-\pi_{0}^{*}(1-\ell)\frac{p_{0}}{(1-p_{0})}+\frac{(1-p_{1})p_{0}}{(1-p_{0})}\lambda\pi_{1}}{p_{1}\lambda}$
$\displaystyle=$
$\displaystyle\frac{\pi_{1}^{*}\ell-\pi_{0}^{*}(1-\ell)\frac{p_{0}}{(1-p_{0})}}{p_{1}\lambda}+\frac{(1-p_{1})p_{0}}{(1-p_{0})p_{1}}\pi_{1}$
$\displaystyle=$
$\displaystyle\frac{\pi_{1}^{*}\ell-\pi_{0}^{*}(1-\ell)\frac{p_{0}}{(1-p_{0})}}{p_{1}\lambda}+\frac{(1-p_{1})p_{0}}{(1-p_{0})p_{1}}\pi_{1}.$

Consequently,

$\displaystyle(1-\frac{(1-p_{1})p_{0}}{(1-p_{0})p_{1}})\pi_{1}$
$\displaystyle=$
$\displaystyle\frac{\pi_{1}^{*}\ell-\pi_{0}^{*}(1-\ell)\frac{p_{0}}{(1-p_{0})}}{p_{1}\lambda},$
$\displaystyle\pi_{1}$ $\displaystyle=$
$\displaystyle\frac{\frac{\pi_{1}^{*}\ell-\pi_{0}^{*}(1-\ell)\frac{p_{0}}{(1-p_{0})}}{p_{1}\lambda}}{\frac{(1-p_{0})p_{1}-(1-p_{1})p_{0}}{(1-p_{0})p_{1}}}$
(A2) $\displaystyle=$
$\displaystyle\frac{\pi_{1}^{*}\ell-\pi_{0}^{*}(1-\ell)\frac{p_{0}}{(1-p_{0})}}{p_{1}\lambda}\times\frac{(1-p_{0})p_{1}}{(1-p_{0})p_{1}-(1-p_{1})p_{0}}.$

From model (A2) we now obtain an value for $\pi_{1}$, which we use to get
obtain a value for $\pi_{0}$ from model (A1). The bias expressions (3) and (4)
can subsequently be used to calculate bias in the ATE.


$\varphi\left(S^{i}\right)\supseteq\varphi\circ\varphi_{i}\left(T_{a}(t,k-1)\right)=T_{a}(t,k-1)$

So $\varphi\left(S^{i}\right)$ solves $T_{a}(t,k-1)$, i.e. $A$. ∎

###### Lemma D.13.

The sequence $\psi\left(S^{b}\right)$, defined by

  1. (1)

$\psi\left(S^{b}\right)_{i+1}=\psi\left(s_{i}^{b}\right)$,

  2. (2)

$\psi\left(S^{b}\right)_{0}=\left[z_{b-2},z_{b-1}\right]$

is a scheme solving $B$. It is not minimal: there is a subsequence of
$\psi\left(S^{b}\right)$, resulting from the removal of
$|B|-\left|B_{0}\right|$ elements from $\psi\left(S^{b}\right)$, which is also
a scheme solving B.

###### Proof.

The fact that $\psi\left(S^{b}\right)$ is a scheme that solves $B$ is similar
as the proof of Lemma D.12.

Let $q$ be an interval in the task $Q$ of the form $\psi_{i}(z)$, but $i\neq
0$. That is, $q$ is in the image of $B$, but not of that portion of $B$ placed
in the partition $B_{0}$. Let $i(q)$ be the index of the leftmost $q_{i}$ in
$q$. Let $W(i)$ be the index of the first element in $S^{b}$ which contains
$q_{i}$ but contains no $q_{j}$ with $j<i$. Since $S$ solves $Q,W(i)$ is
defined. We consider the equation $s_{W(i)}^{b}=s^{\prime}\cup
s^{\prime\prime}$. At least one of $s^{\prime}$ and $s^{\prime\prime}$
contains $q_{i}$; without loss of generality assume it is $s^{\prime}$. By
selection of $W(i),s^{\prime}$ is itself contained in the block containing
$q_{i}$. Because $i$ is not divisible by $a$, the image of this set under
$\psi$ must be the empty set. (It cannot be that this set contains $x_{n-1}$.)
Hence $\psi\left(s_{W(i)}^{b}\right)$ either appeared before in
$\psi\left(S^{b}\right)$ or, because $\psi\left(S^{b}\right)$ is a scheme, it
is a singleton. In either case, we can remove this element from the sequence
$\psi\left(S^{b}\right)$ and it still will be a scheme. After removal, it
still will solve $B$ since that set contains no singletons. ∎

Following (Chazelle and Rosenberg, 1991), a lower bound on the length of $S$
can be derived. Because $\varphi\left(S^{i}\right)$ solves $A$, $r_{i}\geq
t|A|/3,i=0,\ldots,b-1$. Taking the indicated subsequence of
$\psi\left(S^{b}\right)$, we have a scheme of size
$r_{b}+1-|B|+\left|B_{0}\right|$ solving $B$. Therefore, that sum is bound
below by $(t-1)|B|/3$. Recall that each interval in $B_{0}$ ends over one of
$z_{0},\ldots,z_{b-3}$, and conversely, each $z_{0},\ldots,z_{b-3}$ has at
most one interval in $B_{0}$ ending over it. Hence $\left|B_{0}\right|\leq
b-2$. Since $|Q|=b|A|+|B|$

$\displaystyle r$ $\displaystyle=r_{0}+\cdots+r_{b-1}+r_{b}$
$\displaystyle\geq bt|A|/3+(t-1)|B|/3+|B|-\left|B_{0}\right|-1$
$\displaystyle\geq bt|A|/3+(t+2)|B|/3-(b-2)-1$
$\displaystyle=t|Q|/3+(2/3)|B|-b+1$

Because $B=\mathcal{T}_{b}(t-1,a)$ we have $|B|\geq ab/2$. Since $a\geq 3$

$r\geq t|Q|/3+ab/3-b+1>t|Q|/3$

We have completed the verification of the three properties of $T_{n}(t,k)$
listed in Lemma D.11, and the induction step is complete.

Define the function $A(i,j)$ for all $i\geq 1$ and $j\geq 0$ as in (Tarjan,
1975).

$\begin{array}[]{ll}A(1,j)=2^{j},&j\geq 0\\\ A(i,0)=2,&i>1\\\
A(i,j)=A(i-1,A(i,j-1)),&j>0,i>1.\end{array}$

The following two lemmas are proved in (Chazelle and Rosenberg, 1991) relating
$R(i,j)$ and $A(i,j)$.

###### Lemma D.14.

For all $i,j=1,2,\ldots$, we have $R(i+1,j)>A(i,j)$.

###### Lemma D.15.

For all $i,j=1,2,\ldots$, we have $A(i+2,j)>R(i,j)$.

Finally, we proceed as in (Chazelle and Rosenberg, 1991) to finish the
preparation for proving Theorem 6.9. Suppose we are given $m$ and $n$ with
$m\geq n$. Set $k=\lfloor m/n\rfloor$ and let $t$ be the least integer such
that $R(t,k)>n$. We explain why $t\geq 2$. A task cannot repeat a query
interval, so $m\leq n(n-1)/2$, and hence,

$R(1,k)=2k\leq 2\lfloor m/n\rfloor\leq n-1$

By the lower bound lemma, there exists a task $T=T_{n^{\prime}}(t-1,k)$ with

  * •

$n^{\prime}=R(t-1,k)$, and it follows by the definition of $t$ that
$n^{\prime}<n$.

  * •

$T$ has size $|T|$ between $kn^{\prime}/2$ and $kn^{\prime}$.

  * •

Any solution to $T$ has length at least $(t-1)|T|/3$.

Place $\left[n/n^{\prime}\right]$ copies of $T$ side by side. Add extra
variables and queries to correct to form of this resultant task, that is, it
will be over $n$ variables and have $m$ queries. The size of any solution is
bounded from below by:

$\displaystyle(t-1)\left\lfloor n/n^{\prime}\right\rfloor|T|/3$
$\displaystyle\geq(t-1)\left\lfloor n/n^{\prime}\right\rfloor\lfloor
m/n\rfloor n^{\prime}/6$ $\displaystyle\geq m(t-1)/24$ $\displaystyle\geq
mt/48.$

The following chain of inequalities shows that $t+2\geq\alpha(m,n)$,

$A(t+2,k)>R(t,k)>n>\log n$

Because $t\geq 2$, it follows that $t\geq\alpha(m,n)/2$. Therefore the cost of
solving $T$ is at least $m\alpha(m,n)/96$.

Consider now $m$ and $n$ given, where $m<n$. The previous paragraphs shows the
existence of a task $T$ over $m$ variables with $m$ queries which takes time
at least $(m\alpha(m,m))/96$ to solve. If all the variables
$x_{0},\ldots,x_{m-1}$ do not appear in $T$, eliminate the unused variables
and renumber as $x_{0},\ldots,x_{m-1}$. Add variables
$x_{m^{\prime}},\ldots,x_{n-1}$. Find an interval of the form
$\left[i,m^{\prime}-1\right]$ in $T$, as $x_{m^{\prime}-1}$ is used in $T$
such an interval exists, and replace it with the interval $[i,n-1]$. Any
solution to the resulting task can be made to solve the original task $T$ by a
transformation which includes removing the at least $n-m$ computation steps
referencing variables with indices inside the interval $[m,n-1]$. So, the time
to solve this new task must be,

$\displaystyle n-m+m\alpha(m,m)/96$
$\displaystyle\geq(n-m)/192+m\alpha(m,m)/96$ $\displaystyle\geq
n/192+m(2\alpha(m,m)-1)/192$ $\displaystyle\geq(n+m\alpha(m,m))/192.$

We are now ready to prove Theorem 6.9.

###### Proof of Theorem 6.9.

We show that any constant delay enumeration algorithm for $\varphi$ with
preprocessing time $T$ leads to an algorithm for OEPS that runs in time
$T+O(m+n)$.

Let $a_{1},a_{2},\dots,a_{n}$ and $(l_{1},r_{1})$, $(l_{2},r_{2})$, $\dots$,
$(l_{m},r_{m})$ be inputs to the $\mathsf{OpenEndedPartialSum}$ problem where
$m\leq n$.

We first construct factors $A$, $B$, and $R$ as follows: Fix a domain
$D=\\{1,2,\dots,n\\}$, and

  * •

for every $i\in D$, $A(i)=\mathbf{1}$, the multiplicative identity under the
semiring;

  * •

for every $j\in D$, $B(j)=a_{j}$;

  * •

for every $k\in\\{1,2,\dots,m\\}$, $R(k,l_{k})=\mathbf{1}$ and
$R(k,r_{k})=\mathbf{1}$.

This construction runs in time $O(n+2m)$. Then, we simply compute $\varphi$ in
time $T+O(n)$. Note that for any $i\in\\{1,2,\dots,m\\}$, the open ended sum
for $(l_{i},r_{i})$ is stored in $\phi(i)$:

$\varphi(i)=\bigoplus_{1\leq j\leq n}A(i)\otimes
B(j)\otimes\mathbbm{1}_{{\lnot
R}}(i,j)=\bigoplus_{j\in[n]\setminus\\{l_{i},r_{i}\\}}a_{j}.$

Hence the overall running time of this algorithm is $T+O(n+2m)$. By Theorem
6.9, we have that $T+O(n+2m)=\Omega(n+m\cdot\alpha(m,m))$. Therefore,
$T=\Omega(m\cdot\alpha(m,m))$, as desired. ∎

##  Appendix E Missing proofs in Section 7

###### Proof of Theorem 7.1.

Following (Hu and Wang, 2023), we can write $Q$ as follows:

$Q=\bigcup_{R_{e}\in Q_{2}}(\bigwedge_{S_{e}\in Q_{1}}S_{e}\wedge\neg R_{e})$

Hence, $Q$ can be viewed as a union of $\mathsf{CQ}^{\neg}$, each
$\mathsf{CQ}^{\neg}$ of the form $Q_{1}\wedge\neg R_{e}$. Since $Q_{1}$ is
$\alpha$-acyclic and $Q_{1}\wedge R_{e}$ is $\alpha$-acyclic, $Q_{1}\wedge\neg
R_{e}$ is signed-acyclic and free-connex (trivially, since it is full) and
thus by Theorem 1.1 can be enumerated with linear-time preprocessing and
constant delay. We can now apply the Cheater’s Lemma (Carmeli and Kröll, 2021)
to obtain linear-time preprocessing and constant-delay enumeration for $Q$. ∎

###### Proof of Corollary 7.2.

From (Hu and Wang, 2023), we can reduce $Q$ to a difference
$Q_{1}^{\prime}-Q_{2}^{\prime}$ in linear time such that
$Q_{1}^{\prime},Q_{2}^{\prime}$ are full CQs and satisfy the properties of
Theorem 7.1. We then simply apply Theorem 7.1. ∎

##  Appendix F $\mathsf{CQ}^{\neg}$ with Bounded Width

What can we say about the data complexity of evaluating a $\mathsf{CQ}^{\neg}$
if it is not signed-acyclic? Lanzinger (Lanzinger, 2021) defined a width
measure of a $\mathsf{CQ}^{\neg}$ called nest-set width ($\mathsf{nsw}$) and
showed that a Boolean $\mathsf{CQ}^{\neg}$ with bounded $\mathsf{nsw}$ can be
computed in polynomial time (combined complexity). One consequence of (2) is
that it is possible to obtain in a straightforward way a much tighter upper
bound in terms of data complexity.

###### Definition F.1.

Let $\varphi$ be a $\mathsf{CQ}^{\neg}$ with signed hypergraph
$\mathcal{H}=([n],\mathcal{E}^{+},\mathcal{E}^{-})$. Then,
$\beta$-$\\#\mathsf{subw}(\varphi)=\max_{S\subseteq\mathcal{E}^{-}}\\#\mathsf{subw}(\varphi_{S})$,
where $\varphi_{S}$ is the CQ with hypergraph $([n],\mathcal{E}^{+}\cup S)$
and $\\#\mathsf{subw}(\varphi)$ is the counting version of the submodular
width defined in (Khamis et al., 2020).

Thanks to (Abo Khamis et al., 2017; Khamis et al., 2020), for any Boolean CQ
$\varphi$, we can compute $\\#\varphi$ in time
$\tilde{O}(|\mathcal{D}|^{\\#\mathsf{subw}(\varphi)})$, where $\tilde{O}$
hides a polylogarithmic factor in $|\mathcal{D}|$. Combining this with (2), we
have:

###### Theorem F.2.

Let $\varphi$ be a Boolean $\mathsf{CQ}^{\neg}$. Then, we can compute
$\\#\varphi$ (and thus $\varphi$) in time
$\tilde{O}(|\mathcal{D}|^{\beta\text{-}\\#\mathsf{subw}(\varphi)})$

From (Lanzinger, 2021), we know that $\beta$-$\\#\mathsf{subw}$ is always at
most the nest-set width; moreover, there are queries were nest-set width is
unbounded but $\beta$-$\\#\mathsf{subw}$ is bounded.