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 ratio \(\mathrm{RR} = \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 taking the ratio — see gcomp_logistic_point_estimate_cpp for the exact standardization formula (mean1/mean0). Bootstrap/jackknife inference on this estimand is generally done on the log risk-ratio scale internally (see $compute_bootstrap_confidence_interval(), $compute_bayesian_bootstrap_confidence_interval(), and the jackknife-Wald methods, whose "basic"/"wald" interval types route through log-scale-specific helpers for this estimand), then back-transformed, since ratio estimators are typically closer to normally distributed on the log scale. Inference is nonparametric-bootstrap/ randomization/jackknife-based (likelihood_tier = "none"): no closed-form asymptotic standard error is used.

See also

InferenceIncidGCompRiskDiff for the risk-difference version of this same standardized logistic working model.

Super class

Inference -> InferenceIncidGCompRiskRatio

Methods

+ inherited public methods from Inference


InferenceIncidGCompRiskRatio$approximate_bootstrap_distribution_beta_hat_T()

Usage

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


InferenceIncidGCompRiskRatio$compute_bootstrap_confidence_interval()

Usage

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


InferenceIncidGCompRiskRatio$compute_bootstrap_two_sided_pval()

Usage

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


InferenceIncidGCompRiskRatio$compute_bayesian_bootstrap_two_sided_pval()

Usage

InferenceIncidGCompRiskRatio$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
)


InferenceIncidGCompRiskRatio$compute_bayesian_bootstrap_confidence_interval()

Usage

InferenceIncidGCompRiskRatio$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
)


InferenceIncidGCompRiskRatio$compute_jackknife_wald_two_sided_pval()

Usage

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


InferenceIncidGCompRiskRatio$compute_jackknife_wald_confidence_interval()

Usage

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


InferenceIncidGCompRiskRatio$clone()

The objects of this class are cloneable with this method.

Usage

InferenceIncidGCompRiskRatio$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 = InferenceIncidGCompRiskRatio$new(seq_des)
inf$compute_estimate()
#> [1] 0.9366012
# }