
G-Computation Risk-Difference Inference for Binary Responses
Source:R/inference_incidence_gcomp.R
InferenceIncidGCompRiskDiff.RdFits a logistic working model, \(\mathrm{logit}\,\Pr(Y_i=1\mid x_i) =
x_i^\top\hat\beta\), for an incidence outcome using treatment and, optionally,
all recorded covariates, then estimates the marginal (standardized) risk
difference \(\mathrm{RD} = \overline{\mathrm{risk}}_1 -
\overline{\mathrm{risk}}_0\) by G-computation: setting every subject's
treatment indicator to 1 (respectively 0) while holding their other observed
covariates fixed, averaging the model-implied risk over the empirical
covariate distribution under each counterfactual, and differencing — see
gcomp_logistic_point_estimate_cpp for the exact standardization
formula. Inference is nonparametric-bootstrap/randomization/jackknife-based
(likelihood_tier = "none"): no closed-form asymptotic standard error
is used.
See also
InferenceIncidGCompRiskRatio
for the risk-ratio version of this same standardized logistic working model.
Super class
Inference -> InferenceIncidGCompRiskDiff
Methods
Public methods
InferenceIncidGCompRiskDiff$approximate_bootstrap_distribution_beta_hat_T()InferenceIncidGCompRiskDiff$compute_bootstrap_confidence_interval()InferenceIncidGCompRiskDiff$compute_bootstrap_two_sided_pval()InferenceIncidGCompRiskDiff$compute_bayesian_bootstrap_two_sided_pval()InferenceIncidGCompRiskDiff$compute_bayesian_bootstrap_confidence_interval()InferenceIncidGCompRiskDiff$compute_jackknife_wald_two_sided_pval()InferenceIncidGCompRiskDiff$compute_jackknife_wald_confidence_interval()
+ inherited public methods from Inference
Inference$capabilities()Inference$compute_asymp_confidence_interval()Inference$compute_asymp_two_sided_pval()Inference$compute_estimate()Inference$compute_exact_confidence_interval()Inference$compute_exact_two_sided_pval_for_treatment_effect()Inference$duplicate()Inference$get_analysis_data()Inference$get_covariates()Inference$get_design_object()Inference$get_model_formula()Inference$get_nonestimable_reason()Inference$get_nonestimable_stage()Inference$get_optimization_alg()Inference$get_response()Inference$get_response_type()Inference$get_treatment()Inference$initialize()Inference$is_nonestimable()Inference$set_optimization_alg()Inference$set_seed()Inference$supports()
Examples
# \donttest{
seq_des = DesignSeqOneByOneBernoulli$new(n = 10, response_type = 'incidence')
for (i in 1:10) {
seq_des$add_one_subject_to_experiment_and_assign(data.frame(x1 = rnorm(1)))
}
seq_des$add_all_subject_responses(rbinom(10, 1, 0.5))
inf = InferenceIncidGCompRiskDiff$new(seq_des)
inf$compute_estimate()
#> [1] 0.2455327
# }