idie_exposed | R Documentation |
The idie_exposed
is a Targeted Minumum-loss based
estimator (TMLE) for the Interventional Disparity Indirect Effect (IDIE) among the exposed.
We consider a structure, where the mediator (Z) is an effect of the exposure (A) and a cause of the outcome (Y),
A -> Z -> Y. The function estimates the expected change in outcome risk among the exposed (A=1) if
hypothetically the exposed had the same probability of the mediator (Z)
as observed for similar unexposed (A=0) individuals.
The expected outcome risk under this hypothetical intervention is compared to the outcome risk
among the exposed when the distribution of the mediator was set
to the observed level among the exposed. Importantly, for this estimator the
exposure, mediator, and outcome must all be binary. The
underlying model for the exposure, mediator, and outcome, which are needed
to estimate any of the parameters, can be modeled using Super learning. Super
learning can be used to produce a weighted combination of candidate algorithms
that optimize the cross-validated loss-function or to select the single best
performing algorithm among the candidate algorithms, also known as the discrete
Super learner. One must define a library of candidate algorithms which should
be considered by the Super learner. If the Super learner library contains only
one algorithm, results will be estimated based on this algorithm alone, and
thus, not using Super Learning.
idie_exposed(data, discrete.SL=TRUE, exposure.A=NA, mediator.Z=NA, outcome.Y=NA,
cov.A, cov.Z, cov.Y, SL.lib.A=FALSE, SL.lib.Z=FALSE, SL.lib.Y=FALSE, iterations=10)
data |
A data frame/data table with a binary exposure, a binary mediator, a binary outcome, and covariates. |
discrete.SL |
If |
exposure.A |
Name of the binary exposure. |
mediator.Z |
Name of the binary mediator, which is the target of the hypothetical intervention. |
outcome.Y |
Name of the binary outcome. |
cov.A |
A vector containing names of possible confounders which should be included in models of the exposure. |
cov.Z |
A vector of confounders which should be included in models of the mediator. Do not include the exposure as the function does this. |
cov.Y |
A vector of confounders which should be included in models of the outcome. Do not include the exposure and the mediator as the function does this. |
SL.lib.A |
A vector of algorithms that should be considered by the super learner when modelling the exposure. All algorithms must be specified as Super Learner objects. |
SL.lib.Z |
A vector of algorithms for modelling the mediator. All algorithms must be specified as Super Learner objects. |
SL.lib.Y |
A vector of algorithms for modelling the outcome. All algorithms must be specified as Super Learner objects. |
iterations |
Number of iterations for the updating step in TMLE. Defaults to 10. |
The structure of the data should be as follows: \item For the binary
exposure (exposure.A
) 1 = exposed and 0 = unexposed. \item For the
binary mediator (mediator.Z
) 1 = treatment and 0 = no
treatment. \item For the binary outcome (outcome.Y
) 1 = event and 0 =
no event.
The function outputs the absolute outcome risk among the exposed had their chance of the mediator been the same as for similar unexposed individuals, the absolute outcome risk among the exposed under no intervention, where the probability of the mediator is as observed (psi1), the absolute risk difference between the two, the interventional disparity indirect effect among the exposed, and standard errors for each estimate.
Amalie Lykkemark Moller amlm@sund.ku.dk Helene Charlotte Wiese Rytgaard, Thomas Alexander Gerds, and Christian Torp-Pedersen
library(data.table)
require(tmleExposed)
n=5000
set.seed(1)
sex <- rbinom(n,1,0.4)
age <- rnorm(n,65,sd=5)
disease <- rbinom(n,1,0.6)
A <- rbinom(n, 1, plogis(-3+0.05*age+1*sex))
Z <- rbinom(n, 1, plogis(5-0.08*age+1*sex-1.2*disease-0.8*A+0.01*A*disease))
Y <- rbinom(n, 1, plogis(-9+0.09*age+0.5*sex+0.8*disease-1.2*Z+0.7*A))
d <- data.table(id=1:n, exposure=as.integer(A), mediator=as.integer(Z),
outcome=as.integer(Y), age, sex, disease)
##### Define algorithms for the Super Learner library #####
lib = c('SL.glm','SL.step.interaction')
#intervention: changing probability of the mediator (Z=1) among the exposed (A=1)
#to what it would have been had they been unexposed (A=0).
#target parameter: the change in outcome among the exposed (A=1) had their chance of
#the mediator (Z=1) been as among similar unexposed individuals (A=0).
res<-idie_exposed(data=d,
exposure.A='exposure',
mediator.Z='mediator',
outcome.Y='outcome',
cov.A=c('sex','age'),
cov.Z =c('sex','age','disease'),
cov.Y=c('sex','age','disease'),
SL.lib.A = lib,
SL.lib.Z = lib,
SL.lib.Y = lib,
discrete.SL = FALSE)
summary(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.