Learn R Programming

AIPW (version 0.6.3.2)

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

Description

AIPW_tmle class uses a fitted tmle or tmle3 object as input

Arguments

Value

AIPW_tmle object

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)
tmle_fitObjectA fitted tmle or tmle3 object
verboseLogicalWhether to print the result (Default = TRUE)

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

obs_est

This list extracts from the fitted tmle object. It 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)

Details

Create an AIPW_tmle object that uses the estimated efficient influence function from a fitted tmle or tmle3 object

Examples

Run this code
vec <- function() sample(0:1,100,replace = TRUE)
df <- data.frame(replicate(4,vec()))
names(df) <- c("A","Y","W1","W2")

## From tmle
library(tmle)
library(SuperLearner)
tmle_fit <- tmle(Y=df$Y,A=df$A,W=subset(df,select=c("W1","W2")),
                 Q.SL.library="SL.glm",
                 g.SL.library="SL.glm",
                 family="binomial")
AIPW_tmle$new(A=df$A,Y=df$Y,tmle_fit = tmle_fit,verbose = TRUE)$summary()

Run the code above in your browser using DataLab