Estimating a relative risk or risk difference with a binary exposure
Klaus Kähler Holst
2025-12-09
Introduction
Let \(Y\) be a binary response, \(A\) a binary exposure, and \(V\) a vector of covariates.
DAG for the statistical model with the dashed edge representing a potential interaction between exposure \(A\) and covariates \(V\).
In a common setting, the main interest lies in quantifying the treatment effect, \(\nu\), of \(A\) on \(Y\) adjusting for the set of covariates, and often a standard approach is to use a Generalized Linear Model (GLM):
with link function \(g\), and \(W = w(V)\), \(Z= v(V)\) known vector functions of \(V\).
The canonical link (logit) leads to nice computational properties (logistic regression) and parameters with an odds-ratio interpretation. But ORs are not collapsible even under randomization. For example
\[
E(Y\mid X) = E[ E(Y\mid X,Z) \mid X ] = E[\operatorname{expit}( \mu +
\alpha X + \beta Z ) \mid X]
\neq \operatorname{expit}[\mu + \alpha X + \beta E(Z\mid X)],
\]
When marginalizing we leave the class of logistic regression. This non-collapsibility makes it hard to interpret odds-ratios and to compare results from different studies
Relative risks (and risk differences) are collapsible and generally considered easier to interpret than odds-ratios. Richardson et al (JASA, 2017) proposed a regression model for a binary exposures which solves the computational problems and need for parameter contraints that are associated with using for example binomial regression with a log-link function (or identify link for the risk difference) to obtain such parameter estimates. In the following we consider the relative risk as the target parameter
Let \(p_a(V) = P(Y \mid A=a, V), a\in\{0,1\}\), the idea is then to posit a linear model for \[ \theta(v) = \log \big(RR(v)\big) \], i.e., \[\log \big(RR(v)\big) = \alpha^Tv,\]
and a nuisance model for the odds-product\[ \phi(v) =
\log\left(\frac{p_{0}(v)p_{1}(v)}{(1-p_{0}(v))(1-p_{1}(v))}\right) \]
noting that these two parameters are variation independent as illustrated by the below L’Abbé plot.
The lvm call first defines the linear predictor for the exposure to be of the form
\[\mathrm{LP}_A := \mu_A + \alpha X\]
and the linear predictors for the /target parameter/ (relative risk) and the /nuisance parameter/ (odds product) to be of the form
\[\mathrm{LP}_{RR} := \mu_{RR},\]
\[\mathrm{LP}_{OP} := \mu_{OP} + \beta_x X + \beta_z Z.\]
The covariates are by default assumed to be independent and standard normal \(X, Z\sim\mathcal{N}(0,1)\), but their distribution can easily be altered using the lava::distribution method.
Here the intercepts of the model are simply given the same name as the variables, such that \(\mu_A\) becomes a, and the other regression coefficients are labeled using the “~”-formula notation, e.g., \(\alpha\) becomes a~x.
Intercepts are by default set to zero and regression parameters set to one in the simulation. Hence to simulate from the model with \((mu_A, \mu_{RR}, \mu_{OP}, \alpha, \beta_x, \beta_z)^T =
(-1,1,-2,2,1,1)^T\), we define the parameter vector p given by
p <-c('a'=-1, 'lp.target'=1, 'lp.nuisance'=-1, 'a~x'=2)
and then simulate from the model using the sim method
Notice, that in this simulated data the target parameter\(\mu_{RR}\) has been set to lp.target = 1.
Estimation
MLE
We start by fitting the model using the maximum likelihood estimator.
args(riskreg_mle)
function (y, a, x1, x2 = x1, weights = rep(1, length(y)), std.err = TRUE,
type = "rr", start = NULL, control = list(), ...)
NULL
The riskreg_mle function takes vectors/matrices as input arguments with the response y, exposure a, target parameter design matrix x1 (i.e., the matrix \(W\) at the start of this text), and the nuisance model design matrix x2 (odds product).
We first consider the case of a correctly specified model, hence we do not consider any interactions with the exposure for the odds product and simply let x1 be a vector of ones, whereas the design matrix for the log-odds-product depends on both \(X\) and \(Z\)
We next fit the model using a double robust estimator (DRE) which introduces a model for the exposure \(E(A=1\mid V)\) (propensity model). The double-robustness stems from the fact that the this estimator remains consistent in the union model where either the odds-product model or the propensity model is correctly specified. With both models correctly specified the estimator is efficient.
with(d, riskreg_fit(y, a, target=x1, nuisance=x2, propensity=x2, type="rr"))
The usual /formula/-syntax can be applied using the riskreg function. Here we illustrate the double-robustness by using a wrong propensity model but a correct nuisance paramter (odds-product) model:
The DRE is a regular and asymptotic linear (RAL) estimator, hence \[\sqrt{n}(\widehat{\alpha}_{\mathrm{DRE}} - \alpha) = \frac{1}{\sqrt{n}}\sum_{i=1}^{n} \phi_{\mathrm{eff}}(Z_{i}) + o_{p}(1)\] where \(Z_i = (Y_i, A_i, V_i), i=1,\ldots,n\) are the i.i.d. observations and \(\phi_{\mathrm{eff}}\) is the influence function.
The influence function can be extracted using the IC method