Package 'tmle3shift'

Title: Targeted Learning of the Causal Effects of Stochastic Interventions
Description: Targeted maximum likelihood estimation (TMLE) of population-level causal effects under stochastic treatment regimes and related nonparametric variable importance analyses. Tools are provided for TML estimation of the counterfactual mean under a stochastic intervention characterized as a modified treatment policy, such as treatment policies that shift the natural value of the exposure. The causal parameter and estimation were described in Díaz and van der Laan (2013) <doi:10.1111/j.1541-0420.2011.01685.x> and an improved estimation approach was given by Díaz and van der Laan (2018) <doi:10.1007/978-3-319-65304-4_14>.
Authors: Nima Hejazi [aut, cre, cph] , Jeremy Coyle [aut] , Mark van der Laan [aut, ths]
Maintainer: Nima Hejazi <[email protected]>
License: GPL-3
Version: 0.2.2
Built: 2024-10-31 03:32:49 UTC
Source: https://github.com/tlverse/tmle3shift

Help Index


Shifted Likelihood Factor

Description

Shifts a likelihood factor according to a shift_function and a given magnitude of the desired shift (shift_delta). In effect, get_likelihood(tmle_task) from tmle3 will instead be the likelihood from the original_lf, but for a shifted value A=A'=shift_function(A,W)(A, W).

Format

R6Class object.

Value

LF_base object

Constructor

define_lf(LF_shift, name, type = "density", original_lf, shift_function, ...)

name

character, the name of the factor. Should match a node name in the specification in tmle3_Task$npsem.

original_lf

LF_base object, the likelihood factor to shift.

shift_function

function, defines the shift.

shift_inverse

function, the inverse of a given shift_function.

shift_delta

numeric, specification of the magnitude of the desired shift (on the level of the treatment).

max_shifted_ratio

A numeric value indicating the maximum tolerance for the ratio of the counterfactual and observed intervention densities. In particular, the shifted value of the intervention is assigned to a given observational unit when the ratio of the counterfactual intervention density to the observed intervention density is below this value.

...

Not currently used.

Fields

original_lf

LF_base object, the likelihood factor to shift.

shift_function

function, defines the shift.

shift_inverse

function, the inverse of a given shift_function.

shift_delta

numeric, specification of the magnitude of the desired shift (on the level of the treatment).

max_shifted_ratio

A numeric value indicating the maximum tolerance for the ratio of the counterfactual and observed intervention densities. In particular, the shifted value of the intervention is assigned to a given observational unit when the ratio of the counterfactual intervention density to the observed intervention density is below this value.

...

Additional arguments passed to the base class.

References

"Stochastic Treatment Regimes."

Díaz, Iván and van der Laan, Mark (2018). In Targeted Learning in Data Science: Causal Inference for Complex Longitudinal Studies, 167–80. Springer Science & Business Media.

"Population Intervention Causal Effects Based on Stochastic Interventions."

Díaz, Iván and van der Laan, Mark J (2012). Biometrics 68 (2). Wiley Online Library: 541–49.


Parameter for Linear Working Marginal Structural Model

Description

Parameter definition for targeting the parameters of a linear working marginal structural model (MSM): EY = beta0 + beta1 * delta, in order to summarize the variable importance results of a grid of shift interventions.

Format

R6Class object.

Value

Param_base object

Constructor

define_param(Param_MSM_linear, observed_likelihood, intervention_list, ..., outcome_node)

observed_likelihood

A Likelihood corresponding to the observed likelihood.

intervention_list

A list of objects inheriting from LF_base, representing the intervention.

...

Not currently used.

outcome_node

character, the name of the node that should be treated as the outcome.

Fields

cf_likelihood

the counterfactual likelihood for this treatment.

intervention_list

A list of objects inheriting from LF_base, representing the intervention.


Additive Shifts of Continuous-Valued Interventions Without Bounds

Description

Additive Shifts of Continuous-Valued Interventions Without Bounds

Usage

shift_additive(tmle_task, delta = 0, ...)

shift_additive_inv(tmle_task, delta = 0, ...)

Arguments

tmle_task

A tmle3_Task object containing data and nodes, as described and implemented in the tmle3 package. Please refer to the documentation and supporting materials of that package for details.

delta

A numeric value giving a value of the shift to be applied to the treatment. This is an additive shift so the value is merely to be added to the observed value of the treatment node "A". In the case of the inverse additive shift, the specified value will be subtracted from the observed value of the treatment node "A".

...

Additional arguments (currently unused).

See Also

Other shifting_interventions: shift_additive_bounded()

Other shifting_interventions: shift_additive_bounded()


Outcome under Shifted Treatment

Description

O = (W, A, Y) W = Covariates A = Treatment (binary or categorical) Y = Outcome (binary or bounded continuous)

Usage

tmle_shift(
  shift_fxn = shift_additive,
  shift_fxn_inv = shift_additive_inv,
  shift_val = 1,
  max_shifted_ratio = 5,
  ...
)

Arguments

shift_fxn

A function defining the type of shift to be applied to the treatment. For a simple example, see shift_additive.

shift_fxn_inv

A function defining the inverse of the type of shift to be applied to the treatment. For a simple example, see shift_additive_inv.

shift_val

A numeric, specification of the magnitude of the desired shift (on the level of the treatment). This is a value passed to the functions above for modulating the treatment.

max_shifted_ratio

A numeric value indicating the maximum tolerance for the ratio of the counterfactual and observed intervention densities. In particular, the shifted value of the intervention is assigned to a given observational unit when the ratio of counterfactual intervention density to the observed intervention density is below this value.

...

Additional arguments (currently unused).


Outcome Under a Grid of Shifted Interventions via Delta Method

Description

O = (W, A, Y) W = Covariates A = Treatment (binary or categorical) Y = Outcome (binary or bounded continuous)

Usage

tmle_vimshift_delta(
  shift_fxn = shift_additive,
  shift_fxn_inv = shift_additive_inv,
  shift_grid = seq(-1, 1, by = 0.5),
  max_shifted_ratio = 5,
  weighting = c("identity", "variance"),
  ...
)

Arguments

shift_fxn

A function defining the type of shift to be applied to the treatment. For an example, see shift_additive.

shift_fxn_inv

A function defining the inverse of the type of shift to be applied to the treatment. For an example, see shift_additive_inv.

shift_grid

A numeric vector, specification of a selection of shifts (on the level of the treatment) to be applied to the intervention. This is a value passed to the functions above for computing various values of the outcome under modulated values of the treatment.

max_shifted_ratio

A numeric value indicating the maximum tolerance for the ratio of the counterfactual and observed intervention densities. In particular, the shifted value of the intervention is assigned to a given observational unit when the ratio of counterfactual intervention density to the observed intervention density is below this value.

weighting

A character indicating the type of weighting used for construction of the marginal structural model. "identity" applies the same weight to all individual estimates while "variance" applies weights based on the inverse variance of the estimate. It would be expected that variance-based weighting would yield more stable estimates of the parameter of the MSM. The default remains the identity weighting.

...

Additional arguments, passed to shift functions.


Outcome Under a Grid of Shifted Interventions via Targeted Working MSM

Description

O = (W, A, Y) W = Covariates A = Treatment (binary or categorical) Y = Outcome (binary or bounded continuous)

Usage

tmle_vimshift_msm(
  shift_fxn = shift_additive,
  shift_fxn_inv = shift_additive_inv,
  shift_grid = seq(-1, 1, by = 0.5),
  max_shifted_ratio = 5,
  weighting = c("identity", "variance"),
  ...
)

Arguments

shift_fxn

A function defining the type of shift to be applied to the treatment. For an example, see shift_additive.

shift_fxn_inv

A function defining the inverse of the type of shift to be applied to the treatment. For an example, see shift_additive_inv.

shift_grid

A numeric vector, specification of a selection of shifts (on the level of the treatment) to be applied to the intervention. This is a value passed to the functions above for computing various values of the outcome under modulated values of the treatment.

max_shifted_ratio

A numeric value indicating the maximum tolerance for the ratio of the counterfactual and observed intervention densities. In particular, the shifted value of the intervention is assigned to a given observational unit when the ratio of counterfactual intervention density to the observed intervention density is below this value.

weighting

A character indicating the type of weighting used for construction of the marginal structural model. "identity" applies the same weight to all individual estimates while "variance" applies weights based on the inverse variance of the estimate. It would be expected that variance-based weighting would yield more stable estimates of the parameter of the MSM. The default remains the identity weighting.

...

Additional arguments, passed to shift functions.


Defines a TML Estimator for the Outcome under a Shifted Treatment

Description

Defines a TML Estimator for the Outcome under a Shifted Treatment


Defines a TML Estimator for Variable Importance for Continuous Interventions

Description

Defines a TML Estimator for Variable Importance for Continuous Interventions


Defines a TML Estimator for Variable Importance for Continuous Interventions

Description

Defines a TML Estimator for Variable Importance for Continuous Interventions


Test for a trend in the effect of shift interventions via working MSM

Description

Test for a trend in the effect of shift interventions via working MSM

Usage

trend_msm(
  tmle_fit_estimates,
  delta_grid,
  level = 0.95,
  weighting = c("identity", "variance")
)

Arguments

tmle_fit_estimates

A list corresponding to the $estimates slot of an object of class tmle3_Fit, containing estimates of a grid of posited shift interventions.

delta_grid

A numeric vector giving the individual values of the shift parameter used in computing each of the TML estimates.

level

The nominal coverage probability of the confidence interval.

weighting

A character indicating the type of weighting used for construction of the marginal structural model. "identity" applies the same weight to all individual estimates while "variance" applies weights based on the inverse variance of the estimate. It would be expected that variance-based weighting would yield more stable estimates of the parameter of the MSM. The default is identity-based weighting.