R/AIPW_nuis.R
AIPW_nuis.Rd
AIPW_nuis
class for users to manually input nuisance functions (estimates from the exposure and the outcome models)
AIPW_nuis
object
Create an AIPW_nuis object that uses users' input nuisance functions from the exposure model \(P(A| W)\), and the outcome models \(P(Y| do(A=0), W)\) and \(P(Y| do(A=1), W.Q)\): $$ \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.
AIPW$new(Y = NULL, A = NULL, tmle_fit = NULL, verbose = TRUE)
Argument | Type | Details |
Y | Integer | A vector of outcome (binary (0, 1) or continuous) |
A | Integer | A vector of binary exposure (0 or 1) |
mu0 | Numeric | User input of \(P(Y=1| do(A = 0),W_Q)\) |
mu1 | Numeric | User input of \(P(Y=1| do(A = 1),W_Q)\) |
raw_p_score | Numeric | User input of \(P(A=a|W_g)\) |
verbose | Logical | Whether to print the result (Default = TRUE) |
stratified_fitted | Logical | Whether mu0 & mu1 was estimated only using A=0 & A=1 (Default = FALSE) |
Methods | Details | Link |
summary() | Summary of the average treatment effects from AIPW | summary.AIPW_base |
plot.p_score() | Plot the propensity scores by exposure status | plot.p_score |
plot.ip_weights() | Plot the inverse probability weights using truncated propensity scores | plot.ip_weights |
Variable | Generated by | Return |
n | Constructor | Number of observations |
obs_est | Constructor | Components calculating average causal effects |
estimates | summary() | A list of Risk difference, risk ratio, odds ratio |
result | summary() | A matrix contains RD, ATT, ATC, RR and OR with their SE and 95%CI |
g.plot | plot.p_score() | A density plot of propensity scores by exposure status |
ip_weights.plot | plot.ip_weights() | A box plot of inverse probability weights |
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
)