AIPW_nuis function

Augmented Inverse Probability Weighting (AIPW) uses tmle or tmle3 as inputs

Augmented Inverse Probability Weighting (AIPW) uses tmle or tmle3 as inputs

AIPW_nuis class for users to manually input nuisance functions (estimates from the exposure and the outcome models)

Returns

AIPW_nuis object

Details

Create an AIPW_nuis object that uses users' input nuisance functions from the exposure model P(AW)P(A| W), and the outcome models P(Ydo(A=0),W)P(Y| do(A=0), W) and P(Ydo(A=1),W.Q)P(Y| do(A=1), W.Q):

ψ(a)=E[I(A=a)/P(A=aW)][YP(Y=1A,W)]+P(Y=1do(A=a),W) \psi(a) = E{[ I(A=a) / P(A=a|W) ] * [Y-P(Y=1|A,W)] + P(Y=1| do(A=a),W) }

Note: If outcome is missing, replace (A=a) with (A=a, observed=1) when estimating the propensity scores.

Constructor

AIPW$new(Y = NULL, A = NULL, tmle_fit = NULL, verbose = TRUE)

Constructor Arguments

ArgumentTypeDetails
YIntegerA vector of outcome (binary (0, 1) or continuous)
AIntegerA vector of binary exposure (0 or 1)
mu0NumericUser input of P(Y=1do(A=0),WQ)P(Y=1\| do(A = 0),W_Q)
mu1NumericUser input of P(Y=1do(A=1),WQ)P(Y=1\| do(A = 1),W_Q)
raw_p_scoreNumericUser input of P(A=aWg)P(A=a\|W_g)
verboseLogicalWhether to print the result (Default = TRUE)
stratified_fittedLogicalWhether mu0 & mu1 was estimated only using A=0 & A=1 (Default = FALSE)

Public Methods

MethodsDetailsLink
summary()Summary of the average treatment effects from AIPWsummary.AIPW_base
plot.p_score()Plot the propensity scores by exposure statusplot.p_score
plot.ip_weights()Plot the inverse probability weights using truncated propensity scoresplot.ip_weights

Public Variables

VariableGenerated byReturn
nConstructorNumber of observations
obs_estConstructorComponents calculating average causal effects
estimatessummary()A list of Risk difference, risk ratio, odds ratio
resultsummary()A matrix contains RD, ATT, ATC, RR and OR with their SE and 95%CI
g.plotplot.p_score()A density plot of propensity scores by exposure status
ip_weights.plotplot.ip_weights()A box plot of inverse probability weights

Public Variable Details

  • stratified_fit: An indicator for whether the outcome model is fitted stratified by exposure status in thefit() method. Only when using stratified_fit() to turn on stratified_fit = TRUE, summary outputs average treatment effects among the treated and the controls.
  • obs_est: This list includes propensity scores (p_score), counterfactual predictions (mu, mu1 & mu0) and efficient influence functions (aipw_eif1 & aipw_eif0)
  • g.plot: This plot is generated by ggplot2::geom_density
  • ip_weights.plot: This plot uses truncated propensity scores stratified by exposure status (ggplot2::geom_boxplot)
  • Maintainer: Yongqi Zhong
  • License: GPL-3
  • Last published: 2025-04-05