Skip to contents

Fits 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

+ inherited public methods from Inference


InferenceIncidGCompRiskDiff$approximate_bootstrap_distribution_beta_hat_T()

Usage

InferenceIncidGCompRiskDiff$approximate_bootstrap_distribution_beta_hat_T(
  B = 501,
  show_progress = TRUE,
  debug = FALSE,
  bootstrap_type = NULL
)


InferenceIncidGCompRiskDiff$compute_bootstrap_confidence_interval()

Usage

InferenceIncidGCompRiskDiff$compute_bootstrap_confidence_interval(
  alpha = 0.05,
  B = 501,
  type = NULL,
  na.rm = TRUE,
  show_progress = TRUE,
  min_number_usable_samples = 5L
)


InferenceIncidGCompRiskDiff$compute_bootstrap_two_sided_pval()

Usage

InferenceIncidGCompRiskDiff$compute_bootstrap_two_sided_pval(
  delta = NULL,
  B = 501,
  type = "symmetric",
  na.rm = FALSE,
  show_progress = TRUE,
  min_number_usable_samples = 5L
)


InferenceIncidGCompRiskDiff$compute_bayesian_bootstrap_two_sided_pval()

Usage

InferenceIncidGCompRiskDiff$compute_bayesian_bootstrap_two_sided_pval(
  delta = NULL,
  B = 501,
  type = NULL,
  na.rm = FALSE,
  show_progress = TRUE,
  min_number_usable_samples = 5L,
  weighting_unit_type = NULL
)


InferenceIncidGCompRiskDiff$compute_bayesian_bootstrap_confidence_interval()

Usage

InferenceIncidGCompRiskDiff$compute_bayesian_bootstrap_confidence_interval(
  alpha = 0.05,
  B = 501,
  type = NULL,
  na.rm = TRUE,
  show_progress = TRUE,
  min_number_usable_samples = 5L,
  weighting_unit_type = NULL
)


InferenceIncidGCompRiskDiff$compute_jackknife_wald_two_sided_pval()

Usage

InferenceIncidGCompRiskDiff$compute_jackknife_wald_two_sided_pval(
  delta = NULL,
  unit = "auto"
)


InferenceIncidGCompRiskDiff$compute_jackknife_wald_confidence_interval()

Usage

InferenceIncidGCompRiskDiff$compute_jackknife_wald_confidence_interval(
  alpha = 0.05,
  unit = "auto"
)


InferenceIncidGCompRiskDiff$clone()

The objects of this class are cloneable with this method.

Usage

InferenceIncidGCompRiskDiff$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

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
# }