
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. Wald inference uses the fitted logistic model's sandwich covariance
and the delta method. This standard error conditions on the observed
covariates used for standardization: it quantifies uncertainty in the
fitted coefficients for the sample-conditional standardized risk
difference, and does not add sampling variability from a target population's
covariate distribution. Bootstrap, randomization, and jackknife methods
remain available. likelihood_tier = "none" means that this class
does not provide likelihood-ratio or score tests; it does not preclude its
Wald inference.
Uses the shared nonparametric bootstrap distribution contract; see
InferenceNonParamBootstrap.
Computes a bootstrap confidence interval for the treatment effect.
Computes a bootstrap two-sided p-value for the treatment effect.
Computes a Bayesian-bootstrap two-sided p-value for the treatment effect.
Computes a Bayesian-bootstrap confidence interval for the treatment effect.
Computes a jackknife-Wald two-sided p-value for the treatment effect.
Computes a jackknife-Wald confidence interval for the treatment effect.
Computes a PRW subsampling two-sided p-value for the treatment effect.
For the risk ratio the p-value is symmetric (v1.0.6-TODO-230): the share of usable
pivot draws \(\sqrt{b}(\log\widehat{RR}^* - \log\widehat{RR})\) at least as large in absolute value
as \(\sqrt{n}(\log\widehat{RR} - \log\delta)\), floored at \(1/B\), because the small-sample
law of \(\log\widehat{RR}^*\) is skewed toward the observed effect and the equal-tailed rule doubled
that heavy tail. Null size at n = 80, nominal 0.05, equal-tailed to symmetric: subsampling 0.040 to
0.055 (KK 0.015 to 0.045), m-out-of-n 0.030 to 0.035 (KK 0.010 to 0.015). The risk difference keeps
the equal-tailed p-value.
See Subsampling and m-out-of-n in
InferenceIncidGCompRiskRatio.
Computes a PRW subsampling confidence interval for the treatment effect.
Computes an m-out-of-n bootstrap two-sided p-value for the treatment effect.
For the risk ratio the p-value is symmetric (v1.0.6-TODO-230): the share of usable
pivot draws \(\sqrt{m}(\log\widehat{RR}^* - \log\widehat{RR})\) at least as large in absolute value
as \(\sqrt{n}(\log\widehat{RR} - \log\delta)\), floored at \(1/B\), because the small-sample
law of \(\log\widehat{RR}^*\) is skewed toward the observed effect and the equal-tailed rule doubled
that heavy tail. Null size at n = 80, nominal 0.05, equal-tailed to symmetric: subsampling 0.040 to
0.055 (KK 0.015 to 0.045), m-out-of-n 0.030 to 0.035 (KK 0.010 to 0.015). The risk difference keeps
the equal-tailed p-value.
See Subsampling and m-out-of-n in
InferenceIncidGCompRiskRatio.
Computes an m-out-of-n bootstrap confidence interval for the treatment effect.
Details
Small samples. With unequal allocation (prob_T = 0.2, about
10 treated subjects at n = 50), the Wald test of the risk difference rejected
a true null 12.3% of the time at a nominal 5% level with covariate
adjustment (intervals covered 87.7%) and 10.2% treatment-only; for the risk
ratio the figures were 9.6% and 6.0%. The excess is expected to shrink as n
grows. With so few subjects in one arm, use a larger or more balanced sample,
or a randomization or bootstrap test. Source: the first calibration campaign
(2026-11-09-8c32d060; provisional, 1000 screening replicates per cell, Monte
Carlo standard error about 0.007; measured at n = 50 only),
https://github.com/kapelner/EDI/tree/calibration-results.
Separation. When the logistic working model's fitted probabilities
are numerically 0 or 1 (the data look (quasi-)completely separated) the
working-model MLE does not exist and the fitted risks sit where the fitter
stopped. The class then raises one warning of class
edi_logistic_separation_warning per object (silent inside resampling);
the returned values are unchanged. A randomization test or an exact incidence
method is safer there.
Small-sample behaviour
How fast the size (and coverage) error of each procedure is expected to vanish as the
effective sample size \(n_{eff}\) grows, from EDI's convergence-rate registry
(inference_convergence_expectation()). Exact procedures are valid at every
n by construction; the others are asymptotic, so a small-sample excess is expected, and
its constant is not given by an order. The table is the expectation for a balanced
complete-randomization design; it is not a measured size. Reference keys are explained
under References.
| Procedure | Regime | Error order | Effective n | Regularity | Basis | References |
rand | finite sample | exact | events | regular | theory | [Fisher1935], [LehmannRomano2005] |
wald | asymptotic | \(O(n_{eff}^{-1})\) | events | regular | assumed default | [Hall1992] |
jackknife | asymptotic | \(O(n_{eff}^{-1})\) | events | regular | assumed default | [ShaoTu1995] |
bootstrap | asymptotic | \(O(n_{eff}^{-1})\) | events | regular | assumed default | [Hall1992] |
bayes_boot | asymptotic | \(O(n_{eff}^{-1})\) | events | regular | assumed default | [Rubin1981], [Lo1987] |
rand_bootstrap | asymptotic | \(O(n_{eff}^{-1})\) | events | regular | assumed default | [Hall1992], [Kallus2018] |
The point estimate's bias is of order \(O(n_{eff}^{-1})\) (assumed default: [CoxSnell1968]).
Rows with basis assumed default: the order shown is the procedure's rate in a regular parametric model, and the cited works establish it for that case only. EDI has not derived it for this class.
Blocking designs
On a blocking design
(DesignFixedBlocking and relatives)
the regression-type inference classes do not add block fixed effects
(or block-by-treatment interactions) automatically: the model uses only the
covariate matrix. Whether the blocks enter the regression therefore depends
on how they were supplied: not at all with m=; as dummies when the
blocking column is a factor/character (or few-level integer) covariate; as a
single linear term when it is numeric. Randomization, bootstrap and
jackknife inference are block-aware regardless; only the model-based
(asymptotic, likelihood) path ignores the blocks.
When the proportion treated is the same in every block, the pooled
treatment estimate of a linear model is unbiased and its model-based SE is
conservative (it is inflated by the block variation it fails to remove), at a
cost in power. If the proportion treated differs across blocks (for example
equal_block_sizes = FALSE with very small blocks and an extreme
prob_T, where per-block rounding changes the allocation, or a
user-supplied m), the pooled treated-vs-control comparison is
confounded by block (Simpson's paradox) and can be biased; then include the
blocking covariate(s) explicitly as factor covariates. For non-linear models
(GLM, ordinal, survival) omitting blocks changes the estimand to a
block-marginal effect. See DesignFixedBlocking.
References
[Fisher1935] Fisher, R. A. (1935). The Design of Experiments. Oliver and Boyd.
[LehmannRomano2005] Lehmann, E. L., and Romano, J. P. (2005). Testing Statistical Hypotheses (3rd ed.). Springer.
[Hall1992] Hall, P. (1992). The Bootstrap and Edgeworth Expansion. Springer.
[ShaoTu1995] Shao, J., and Tu, D. (1995). The Jackknife and Bootstrap. Springer.
[Rubin1981] Rubin, D. B. (1981). "The Bayesian Bootstrap." The Annals of Statistics, 9(1), 130-134.
[Lo1987] Lo, A. Y. (1987). "A Large Sample Study of the Bayesian Bootstrap." The Annals of Statistics, 15(1), 360-375.
[Kallus2018] Kallus, N. (2018). "Optimal a priori balance in the design of controlled experiments." Journal of the Royal Statistical Society: Series B, 80(1), 85-112. Section 5 ("Algorithms for inference"), Algorithm 4.
[CoxSnell1968] Cox, D. R., and Snell, E. J. (1968). "A General Definition of Residuals." Journal of the Royal Statistical Society: Series B, 30(2), 248-265 (discussion 265-275).
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()InferenceIncidGCompRiskDiff$compute_subsampling_two_sided_pval()InferenceIncidGCompRiskDiff$compute_subsampling_confidence_interval()InferenceIncidGCompRiskDiff$compute_m_out_of_n_bootstrap_two_sided_pval()InferenceIncidGCompRiskDiff$compute_m_out_of_n_bootstrap_confidence_interval()
+ inherited public methods from Inference
Inference$capabilities()Inference$clear_randomization_cache()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_estimand()Inference$get_model_formula()Inference$get_nonestimable_reason()Inference$get_nonestimable_stage()Inference$get_optimization_alg()Inference$get_procedure_validity()Inference$get_response()Inference$get_response_type()Inference$get_summary()Inference$get_supported_estimands()Inference$get_treatment()Inference$initialize()Inference$is_nonestimable()Inference$set_estimand()Inference$set_optimization_alg()Inference$set_seed()Inference$supports()
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
)Arguments
BNumber of bootstrap samples.
BNumber of bootstrap samples.
BNumber of bootstrap samples.
BNumber of Bayesian-bootstrap samples.
BNumber of Bayesian-bootstrap samples.
BNumber of subsamples.
BNumber of subsamples.
BNumber of resamples.
BNumber of resamples.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
debugWhether to return diagnostics.
bootstrap_typeOptional resampling scheme.
bootstrap_typeOptional empirical-resampling scheme.
bootstrap_typeOptional empirical-resampling scheme.
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
)Arguments
alphaSignificance level. Default 0.05.
alphaSignificance level. Default 0.05.
alphaSignificance level. Default
0.05.alphaSignificance level. Default 0.05.
alphaSignificance level. Default 0.05.
BNumber of bootstrap samples.
BNumber of bootstrap samples.
BNumber of bootstrap samples.
BNumber of Bayesian-bootstrap samples.
BNumber of Bayesian-bootstrap samples.
BNumber of subsamples.
BNumber of subsamples.
BNumber of resamples.
BNumber of resamples.
typeBootstrap CI type. See
InferenceNonParamBootstrap$compute_bootstrap_confidence_interval.typeBootstrap p-value type. See
InferenceNonParamBootstrap$compute_bootstrap_two_sided_pval.typeBayesian-bootstrap p-value type. See
InferenceBayesianBootstrap$compute_bayesian_bootstrap_two_sided_pval.typeBayesian-bootstrap CI type. See
InferenceBayesianBootstrap$compute_bayesian_bootstrap_confidence_interval.typeP-value type.
typeConfidence-interval type.
typeP-value type.
typeConfidence-interval type.
na.rmWhether to remove non-finite bootstrap replicates.
na.rmWhether to remove non-finite bootstrap replicates.
na.rmWhether to remove non-finite bootstrap replicates.
na.rmWhether to remove non-finite bootstrap replicates.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite subsampled estimates required.
min_number_usable_samplesMinimum number of finite subsampled estimates required.
min_number_usable_samplesMinimum number of finite resampled estimates required.
min_number_usable_samplesMinimum number of finite resampled estimates required.
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,
min_fraction_usable_samples = 0.95
)Arguments
deltaThe null treatment effect. Defaults to 0 for RD and 1 for RR.
deltaThe null treatment effect. Defaults to 0 for RD and 1 for RR.
deltaThe null treatment effect. Defaults to 0 for RD and 1 for RR.
deltaNull treatment effect. Defaults to 0 for RD and 1 for RR.
deltaNull treatment effect. Defaults to 0 for RD and 1 for RR.
BNumber of bootstrap samples.
BNumber of bootstrap samples.
BNumber of bootstrap samples.
BNumber of Bayesian-bootstrap samples.
BNumber of Bayesian-bootstrap samples.
BNumber of subsamples.
BNumber of subsamples.
BNumber of resamples.
BNumber of resamples.
typeBootstrap CI type. See
InferenceNonParamBootstrap$compute_bootstrap_confidence_interval.typeBootstrap p-value type. See
InferenceNonParamBootstrap$compute_bootstrap_two_sided_pval.typeBayesian-bootstrap p-value type. See
InferenceBayesianBootstrap$compute_bayesian_bootstrap_two_sided_pval.typeBayesian-bootstrap CI type. See
InferenceBayesianBootstrap$compute_bayesian_bootstrap_confidence_interval.typeP-value type.
typeConfidence-interval type.
typeP-value type.
typeConfidence-interval type.
na.rmWhether to remove non-finite bootstrap replicates.
na.rmWhether to remove non-finite bootstrap replicates.
na.rmWhether to remove non-finite bootstrap replicates.
na.rmWhether to remove non-finite bootstrap replicates.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite subsampled estimates required.
min_number_usable_samplesMinimum number of finite subsampled estimates required.
min_number_usable_samplesMinimum number of finite resampled estimates required.
min_number_usable_samplesMinimum number of finite resampled estimates required.
min_fraction_usable_samplesMinimum fraction of the
Breplicates that must be finite whenna.rm = TRUE. Default 0.95. SeeInferenceNonParamBootstrap$compute_bootstrap_two_sided_pval.min_fraction_usable_samplesMinimum fraction of the
Breplicates that must be finite whenna.rm = TRUE. Default 0.95. SeeInferenceBayesianBootstrap$compute_bayesian_bootstrap_two_sided_pval.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bsubsamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bsubsamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bresamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bresamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.
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,
min_fraction_usable_samples = 0.95
)Arguments
deltaThe null treatment effect. Defaults to 0 for RD and 1 for RR.
deltaThe null treatment effect. Defaults to 0 for RD and 1 for RR.
deltaThe null treatment effect. Defaults to 0 for RD and 1 for RR.
deltaNull treatment effect. Defaults to 0 for RD and 1 for RR.
deltaNull treatment effect. Defaults to 0 for RD and 1 for RR.
BNumber of bootstrap samples.
BNumber of bootstrap samples.
BNumber of bootstrap samples.
BNumber of Bayesian-bootstrap samples.
BNumber of Bayesian-bootstrap samples.
BNumber of subsamples.
BNumber of subsamples.
BNumber of resamples.
BNumber of resamples.
typeBootstrap CI type. See
InferenceNonParamBootstrap$compute_bootstrap_confidence_interval.typeBootstrap p-value type. See
InferenceNonParamBootstrap$compute_bootstrap_two_sided_pval.typeBayesian-bootstrap p-value type. See
InferenceBayesianBootstrap$compute_bayesian_bootstrap_two_sided_pval.typeBayesian-bootstrap CI type. See
InferenceBayesianBootstrap$compute_bayesian_bootstrap_confidence_interval.typeP-value type.
typeConfidence-interval type.
typeP-value type.
typeConfidence-interval type.
na.rmWhether to remove non-finite bootstrap replicates.
na.rmWhether to remove non-finite bootstrap replicates.
na.rmWhether to remove non-finite bootstrap replicates.
na.rmWhether to remove non-finite bootstrap replicates.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite subsampled estimates required.
min_number_usable_samplesMinimum number of finite subsampled estimates required.
min_number_usable_samplesMinimum number of finite resampled estimates required.
min_number_usable_samplesMinimum number of finite resampled estimates required.
weighting_unit_typeOptional resampling unit override.
weighting_unit_typeOptional resampling unit override.
min_fraction_usable_samplesMinimum fraction of the
Breplicates that must be finite whenna.rm = TRUE. Default 0.95. SeeInferenceNonParamBootstrap$compute_bootstrap_two_sided_pval.min_fraction_usable_samplesMinimum fraction of the
Breplicates that must be finite whenna.rm = TRUE. Default 0.95. SeeInferenceBayesianBootstrap$compute_bayesian_bootstrap_two_sided_pval.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bsubsamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bsubsamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bresamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bresamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.
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
)Arguments
alphaSignificance level. Default 0.05.
alphaSignificance level. Default 0.05.
alphaSignificance level. Default
0.05.alphaSignificance level. Default 0.05.
alphaSignificance level. Default 0.05.
BNumber of bootstrap samples.
BNumber of bootstrap samples.
BNumber of bootstrap samples.
BNumber of Bayesian-bootstrap samples.
BNumber of Bayesian-bootstrap samples.
BNumber of subsamples.
BNumber of subsamples.
BNumber of resamples.
BNumber of resamples.
typeBootstrap CI type. See
InferenceNonParamBootstrap$compute_bootstrap_confidence_interval.typeBootstrap p-value type. See
InferenceNonParamBootstrap$compute_bootstrap_two_sided_pval.typeBayesian-bootstrap p-value type. See
InferenceBayesianBootstrap$compute_bayesian_bootstrap_two_sided_pval.typeBayesian-bootstrap CI type. See
InferenceBayesianBootstrap$compute_bayesian_bootstrap_confidence_interval.typeP-value type.
typeConfidence-interval type.
typeP-value type.
typeConfidence-interval type.
na.rmWhether to remove non-finite bootstrap replicates.
na.rmWhether to remove non-finite bootstrap replicates.
na.rmWhether to remove non-finite bootstrap replicates.
na.rmWhether to remove non-finite bootstrap replicates.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite subsampled estimates required.
min_number_usable_samplesMinimum number of finite subsampled estimates required.
min_number_usable_samplesMinimum number of finite resampled estimates required.
min_number_usable_samplesMinimum number of finite resampled estimates required.
weighting_unit_typeOptional resampling unit override.
weighting_unit_typeOptional resampling unit override.
InferenceIncidGCompRiskDiff$compute_jackknife_wald_two_sided_pval()
Usage
InferenceIncidGCompRiskDiff$compute_jackknife_wald_two_sided_pval(
delta = NULL,
unit = "auto"
)Arguments
deltaThe null treatment effect. Defaults to 0 for RD and 1 for RR.
deltaThe null treatment effect. Defaults to 0 for RD and 1 for RR.
deltaThe null treatment effect. Defaults to 0 for RD and 1 for RR.
deltaNull treatment effect. Defaults to 0 for RD and 1 for RR.
deltaNull treatment effect. Defaults to 0 for RD and 1 for RR.
unitDeletion unit. Default
"auto".unitDeletion unit. Default
"auto".
InferenceIncidGCompRiskDiff$compute_jackknife_wald_confidence_interval()
InferenceIncidGCompRiskDiff$compute_subsampling_two_sided_pval()
Usage
InferenceIncidGCompRiskDiff$compute_subsampling_two_sided_pval(
delta = NULL,
B = 501,
b = NULL,
type = "centered",
show_progress = TRUE,
min_number_usable_samples = 5L,
subsampling_type = NULL,
min_fraction_usable_samples = 0.8
)Arguments
deltaThe null treatment effect. Defaults to 0 for RD and 1 for RR.
deltaThe null treatment effect. Defaults to 0 for RD and 1 for RR.
deltaThe null treatment effect. Defaults to 0 for RD and 1 for RR.
deltaNull treatment effect. Defaults to 0 for RD and 1 for RR.
deltaNull treatment effect. Defaults to 0 for RD and 1 for RR.
BNumber of bootstrap samples.
BNumber of bootstrap samples.
BNumber of bootstrap samples.
BNumber of Bayesian-bootstrap samples.
BNumber of Bayesian-bootstrap samples.
BNumber of subsamples.
BNumber of subsamples.
BNumber of resamples.
BNumber of resamples.
bSubsample size. See
InferenceNonParamBootstrap$compute_subsampling_two_sided_pval.bSubsample size. See
InferenceNonParamBootstrap$compute_subsampling_confidence_interval.typeBootstrap CI type. See
InferenceNonParamBootstrap$compute_bootstrap_confidence_interval.typeBootstrap p-value type. See
InferenceNonParamBootstrap$compute_bootstrap_two_sided_pval.typeBayesian-bootstrap p-value type. See
InferenceBayesianBootstrap$compute_bayesian_bootstrap_two_sided_pval.typeBayesian-bootstrap CI type. See
InferenceBayesianBootstrap$compute_bayesian_bootstrap_confidence_interval.typeP-value type.
typeConfidence-interval type.
typeP-value type.
typeConfidence-interval type.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite subsampled estimates required.
min_number_usable_samplesMinimum number of finite subsampled estimates required.
min_number_usable_samplesMinimum number of finite resampled estimates required.
min_number_usable_samplesMinimum number of finite resampled estimates required.
subsampling_typeOptional empirical-resampling scheme.
subsampling_typeOptional empirical-resampling scheme.
min_fraction_usable_samplesMinimum fraction of the
Breplicates that must be finite whenna.rm = TRUE. Default 0.95. SeeInferenceNonParamBootstrap$compute_bootstrap_two_sided_pval.min_fraction_usable_samplesMinimum fraction of the
Breplicates that must be finite whenna.rm = TRUE. Default 0.95. SeeInferenceBayesianBootstrap$compute_bayesian_bootstrap_two_sided_pval.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bsubsamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bsubsamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bresamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bresamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.
InferenceIncidGCompRiskDiff$compute_subsampling_confidence_interval()
Usage
InferenceIncidGCompRiskDiff$compute_subsampling_confidence_interval(
alpha = 0.05,
B = 501,
b = NULL,
type = "basic",
show_progress = TRUE,
min_number_usable_samples = 5L,
subsampling_type = NULL,
min_fraction_usable_samples = 0.8
)Arguments
alphaSignificance level. Default 0.05.
alphaSignificance level. Default 0.05.
alphaSignificance level. Default
0.05.alphaSignificance level. Default 0.05.
alphaSignificance level. Default 0.05.
BNumber of bootstrap samples.
BNumber of bootstrap samples.
BNumber of bootstrap samples.
BNumber of Bayesian-bootstrap samples.
BNumber of Bayesian-bootstrap samples.
BNumber of subsamples.
BNumber of subsamples.
BNumber of resamples.
BNumber of resamples.
bSubsample size. See
InferenceNonParamBootstrap$compute_subsampling_two_sided_pval.bSubsample size. See
InferenceNonParamBootstrap$compute_subsampling_confidence_interval.typeBootstrap CI type. See
InferenceNonParamBootstrap$compute_bootstrap_confidence_interval.typeBootstrap p-value type. See
InferenceNonParamBootstrap$compute_bootstrap_two_sided_pval.typeBayesian-bootstrap p-value type. See
InferenceBayesianBootstrap$compute_bayesian_bootstrap_two_sided_pval.typeBayesian-bootstrap CI type. See
InferenceBayesianBootstrap$compute_bayesian_bootstrap_confidence_interval.typeP-value type.
typeConfidence-interval type.
typeP-value type.
typeConfidence-interval type.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite subsampled estimates required.
min_number_usable_samplesMinimum number of finite subsampled estimates required.
min_number_usable_samplesMinimum number of finite resampled estimates required.
min_number_usable_samplesMinimum number of finite resampled estimates required.
subsampling_typeOptional empirical-resampling scheme.
subsampling_typeOptional empirical-resampling scheme.
min_fraction_usable_samplesMinimum fraction of the
Breplicates that must be finite whenna.rm = TRUE. Default 0.95. SeeInferenceNonParamBootstrap$compute_bootstrap_two_sided_pval.min_fraction_usable_samplesMinimum fraction of the
Breplicates that must be finite whenna.rm = TRUE. Default 0.95. SeeInferenceBayesianBootstrap$compute_bayesian_bootstrap_two_sided_pval.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bsubsamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bsubsamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bresamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bresamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.
InferenceIncidGCompRiskDiff$compute_m_out_of_n_bootstrap_two_sided_pval()
Usage
InferenceIncidGCompRiskDiff$compute_m_out_of_n_bootstrap_two_sided_pval(
delta = NULL,
B = 501,
m = NULL,
type = "centered",
show_progress = TRUE,
min_number_usable_samples = 5L,
bootstrap_type = NULL,
min_fraction_usable_samples = 0.8
)Arguments
deltaThe null treatment effect. Defaults to 0 for RD and 1 for RR.
deltaThe null treatment effect. Defaults to 0 for RD and 1 for RR.
deltaThe null treatment effect. Defaults to 0 for RD and 1 for RR.
deltaNull treatment effect. Defaults to 0 for RD and 1 for RR.
deltaNull treatment effect. Defaults to 0 for RD and 1 for RR.
BNumber of bootstrap samples.
BNumber of bootstrap samples.
BNumber of bootstrap samples.
BNumber of Bayesian-bootstrap samples.
BNumber of Bayesian-bootstrap samples.
BNumber of subsamples.
BNumber of subsamples.
BNumber of resamples.
BNumber of resamples.
mResample size. See
InferenceNonParamBootstrap$compute_m_out_of_n_bootstrap_two_sided_pval.mResample size. See
InferenceNonParamBootstrap$compute_m_out_of_n_bootstrap_confidence_interval.typeBootstrap CI type. See
InferenceNonParamBootstrap$compute_bootstrap_confidence_interval.typeBootstrap p-value type. See
InferenceNonParamBootstrap$compute_bootstrap_two_sided_pval.typeBayesian-bootstrap p-value type. See
InferenceBayesianBootstrap$compute_bayesian_bootstrap_two_sided_pval.typeBayesian-bootstrap CI type. See
InferenceBayesianBootstrap$compute_bayesian_bootstrap_confidence_interval.typeP-value type.
typeConfidence-interval type.
typeP-value type.
typeConfidence-interval type.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite subsampled estimates required.
min_number_usable_samplesMinimum number of finite subsampled estimates required.
min_number_usable_samplesMinimum number of finite resampled estimates required.
min_number_usable_samplesMinimum number of finite resampled estimates required.
bootstrap_typeOptional resampling scheme.
bootstrap_typeOptional empirical-resampling scheme.
bootstrap_typeOptional empirical-resampling scheme.
min_fraction_usable_samplesMinimum fraction of the
Breplicates that must be finite whenna.rm = TRUE. Default 0.95. SeeInferenceNonParamBootstrap$compute_bootstrap_two_sided_pval.min_fraction_usable_samplesMinimum fraction of the
Breplicates that must be finite whenna.rm = TRUE. Default 0.95. SeeInferenceBayesianBootstrap$compute_bayesian_bootstrap_two_sided_pval.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bsubsamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bsubsamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bresamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bresamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.
InferenceIncidGCompRiskDiff$compute_m_out_of_n_bootstrap_confidence_interval()
Usage
InferenceIncidGCompRiskDiff$compute_m_out_of_n_bootstrap_confidence_interval(
alpha = 0.05,
B = 501,
m = NULL,
type = "basic",
show_progress = TRUE,
min_number_usable_samples = 5L,
bootstrap_type = NULL,
min_fraction_usable_samples = 0.8
)Arguments
alphaSignificance level. Default 0.05.
alphaSignificance level. Default 0.05.
alphaSignificance level. Default
0.05.alphaSignificance level. Default 0.05.
alphaSignificance level. Default 0.05.
BNumber of bootstrap samples.
BNumber of bootstrap samples.
BNumber of bootstrap samples.
BNumber of Bayesian-bootstrap samples.
BNumber of Bayesian-bootstrap samples.
BNumber of subsamples.
BNumber of subsamples.
BNumber of resamples.
BNumber of resamples.
mResample size. See
InferenceNonParamBootstrap$compute_m_out_of_n_bootstrap_two_sided_pval.mResample size. See
InferenceNonParamBootstrap$compute_m_out_of_n_bootstrap_confidence_interval.typeBootstrap CI type. See
InferenceNonParamBootstrap$compute_bootstrap_confidence_interval.typeBootstrap p-value type. See
InferenceNonParamBootstrap$compute_bootstrap_two_sided_pval.typeBayesian-bootstrap p-value type. See
InferenceBayesianBootstrap$compute_bayesian_bootstrap_two_sided_pval.typeBayesian-bootstrap CI type. See
InferenceBayesianBootstrap$compute_bayesian_bootstrap_confidence_interval.typeP-value type.
typeConfidence-interval type.
typeP-value type.
typeConfidence-interval type.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
show_progressWhether to show a progress bar.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite bootstrap samples required.
min_number_usable_samplesMinimum number of finite subsampled estimates required.
min_number_usable_samplesMinimum number of finite subsampled estimates required.
min_number_usable_samplesMinimum number of finite resampled estimates required.
min_number_usable_samplesMinimum number of finite resampled estimates required.
bootstrap_typeOptional resampling scheme.
bootstrap_typeOptional empirical-resampling scheme.
bootstrap_typeOptional empirical-resampling scheme.
min_fraction_usable_samplesMinimum fraction of the
Breplicates that must be finite whenna.rm = TRUE. Default 0.95. SeeInferenceNonParamBootstrap$compute_bootstrap_two_sided_pval.min_fraction_usable_samplesMinimum fraction of the
Breplicates that must be finite whenna.rm = TRUE. Default 0.95. SeeInferenceBayesianBootstrap$compute_bayesian_bootstrap_two_sided_pval.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bsubsamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bsubsamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bresamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.min_fraction_usable_samplesRisk ratio only (ignored for the risk difference): minimum fraction of the
Bresamples that must be usable. A draw is unusable when it is degenerate (an arm with no events or only events, or a non-converged or separated logistic fit) or its fit fails. Below this fraction the method returnsNAwith a recorded reason and oneedi_procedure_na_warning; otherwise it uses the usable draws only. Default 0.8, lower than the bootstrap's 0.95 because degenerate draws concentrate in the data sets with an extreme estimate (at 0.95 up to 29% of small null data sets wereNA). See Subsampling and m-out-of-n inInferenceIncidGCompRiskRatio.
Examples
seq_des = DesignSeqOneByOneBernoulli$new(n = 30, response_type = 'incidence')
# \donttest{
for (i in 1:30) {
seq_des$add_one_subject_to_experiment_and_assign(data.frame(x1 = rnorm(1)))
}
seq_des$add_all_subject_responses(rbinom(30, 1, 0.5))
inf = InferenceIncidGCompRiskDiff$new(seq_des)
inf$compute_estimate()
#> [1] 0.1210847
# }