medltmle | R Documentation |
Estimates parameters for longitudinal mediation analysis with time-varying mediators.
medltmle( data, Anodes, Znodes, Cnodes = NULL, Lnodes = NULL, Ynodes, Inodes = NULL, W2nodes = NULL, Dnodes = NULL, survivalOutcome = NULL, QLform = NULL, QZform = NULL, gform = NULL, qzform = NULL, qLform = NULL, abar, abar.prime, rule = NULL, gbounds = c(0.01, 1), Yrange = NULL, deterministic.g.function = NULL, deterministic.Q.function = NULL, stratify = FALSE, SL.library = NULL, estimate.time = TRUE, gcomp = FALSE, iptw.only = FALSE, IC.variance.only = FALSE, observation.weights = NULL, CSE, time.end, past = 1, YisL = TRUE )
data |
Dataframe containing the data in a wide format. |
Anodes |
names of columns containing A covariates (exposure) (character). |
Znodes |
names of columns containing Z covariates (mediator) (character). |
Cnodes |
names of columns containing C covariates (censoring) (character). |
Lnodes |
names of columns containing L covariates (covariate) (character). |
Ynodes |
names of columns containing Y covariates (outcome) (character). |
Inodes |
names of columns containing I covariates (instrument) (character). |
W2nodes |
names of columns containing W2 covariates (baseline covariates in need of fluctuation) (character). |
Dnodes |
names of columns containing D covariates (death indicator) (character). |
survivalOutcome |
If TRUE, then Y nodes are indicators of an event, and if Y at some time point is 1, then all following should be 1. Required to be TRUE or FALSE if outcomes are binary and there are multiple Ynodes. |
QLform |
character vector of regression formulas for Q corresponding to L covariates. |
QZform |
character vector of regression formulas for Q corresponding to Z covariates. |
gform |
character vector of regression formulas for g or a matrix/array of prob(A=1). |
qzform |
g form for Z covariates. |
qLform |
g form for L covariates. |
abar |
binary vector (numAnodes x 1) or matrix (n x numAnodes) of counterfactual treatment or a list of length 2. |
abar.prime |
binary vector (numAnodes x 1) or matrix (n x numAnodes) of counterfactual treatment or a list of length 2. |
rule |
a function to be applied to each row (a named vector) of data that returns a numeric vector of length numAnodes. |
gbounds |
lower and upper bounds on estimated cumulative probabilities for g-factors. Vector of length 2, order unimportant. |
Yrange |
NULL or a numerical vector where the min and max of Yrange specify the range of all Y nodes. |
deterministic.g.function |
optional information on A and C nodes that are given deterministically. Default NULL indicates no deterministic links. |
deterministic.Q.function |
optional information on Q given deterministically. See 'Details'. Default NULL indicates no deterministic links. |
stratify |
if TRUE stratify on following abar when estimating Q and g. If FALSE, pool over abar. |
SL.library |
optional character vector of libraries to pass to SuperLearner. NULL indicates glm should be called instead of SuperLearner. 'default' indicates a standard set of libraries. May be separately specified for Q and g. |
estimate.time |
if TRUE, run an initial estimate using only 50 observations and use this to print a very rough estimate of the total time to completion. No action if there are fewer than 50 observations. |
gcomp |
if TRUE, run the maximum likelihood based G-computation estimate instead of TMLE. |
iptw.only |
by default (iptw.only = FALSE), both TMLE and IPTW are run in ltmle and ltmleMSM. If iptw.only = TRUE, only IPTW is run, which is faster. |
IC.variance.only |
Only estimate variance through the influence curve |
observation.weights |
observation (sampling) weights. Vector of length n. If NULL, assumed to be all 1. |
CSE |
Logical specifying if the estimand is estimated by fully conditioning on the past (TRUE), or with the data-dependent estimate (FALSE). |
time.end |
How many time points in the longitudinal data? |
past |
Number indicating Markov order for the conditional densities. |
YisL |
Logical indicating whether Y is a function of time-varying covariate. |
Returns estimate of E[Y_{τ}(a, \overline{Γ}^{a^'})]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.