
Newcombe Risk-Difference Inference for Binary Responses
Source:R/inference_incidence_newcombe_univ.R
InferenceIncidNewcombeRiskDiff.RdFits the Newcombe hybrid score method (Method 10) for the risk difference in a two-arm binary trial. This method constructs a confidence interval for the difference between two independent proportions by combining Wilson score intervals for each group.
This class is unadjusted and assumes independent samples (e.g. from a
Bernoulli design). It ignores any matched-pair structure if present; for
matched data, use InferenceIncidKKNewcombeRiskDiff. The point
estimate is the plain risk difference \(\hat p_T - \hat p_C\). The
confidence interval (newcombe_independent_ci_cpp) is Newcombe's
"Method 10" hybrid score interval: separate Wilson score intervals
\([\ell_T, u_T]\) and \([\ell_C, u_C]\) are computed for each arm's
proportion individually, then combined into a difference interval via
\([\hat p_T - \hat p_C - \sqrt{(\hat p_T - \ell_T)^2 + (u_C - \hat
p_C)^2},\ \hat p_T - \hat p_C + \sqrt{(u_T - \hat p_T)^2 + (\hat p_C -
\ell_C)^2}]\) — this avoids the boundary/coverage problems of the naive
Wald interval on a risk difference while remaining closed-form (no
iterative score-test inversion, unlike the Miettinen-Nurminen method in
InferenceIncidMiettinenNurminenRiskDiff).
The two-sided p-value has no closed form here: it is obtained by
numerically inverting the confidence interval (root-finding via
stats::uniroot) to find the significance level at which delta
falls exactly on the interval boundary.
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.
References
Newcombe, R. G. (1998). "Interval Estimation for the Difference Between Independent Proportions: Comparison of Eleven Methods." Statistics in Medicine, 17(8), 873-890, doi:10.1002/(SICI)1097-0258(19980430)17:8<873::AID-SIM779>3.0.CO;2-I , for "Method 10", the hybrid Wilson-score interval used here.
[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).
Super class
Inference -> InferenceIncidNewcombeRiskDiff
Methods
Public methods
+ inherited public methods from Inference
Inference$capabilities()Inference$clear_randomization_cache()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$is_nonestimable()Inference$set_estimand()Inference$set_optimization_alg()Inference$set_seed()Inference$supports()
InferenceIncidNewcombeRiskDiff$new()
Uses the shared randomization two-sided p-value contract; see
InferenceRand.
Initialize a Newcombe risk-difference inference object for a completed design with an uncensored incidence response.
Usage
InferenceIncidNewcombeRiskDiff$new(
des_obj,
model_formula = NULL,
verbose = FALSE
)Arguments
des_objA completed
DesignSeqOneByOneobject with an incidence response.model_formulaOptional formula, accepted for interface consistency with the covariate-adjusted classes. It is ignored: this class is unadjusted and its estimate, confidence interval and p-value use only the treatment assignments and responses.
verboseWhether to print progress messages.
InferenceIncidNewcombeRiskDiff$compute_estimate()
Computes the observed (unadjusted) risk-difference estimate \(\hat p_T - \hat p_C\) (see class documentation for the full Newcombe interval method).
InferenceIncidNewcombeRiskDiff$compute_estimate_with_bootstrap_weights()
Recomputes the risk-difference estimate under subject/block
bootstrap weights: the weighted event proportions \(\hat p_T^w =
\sum_i r_i y_i \mathbb{1}[w_i=1] / \sum_i r_i \mathbb{1}[w_i=1]\) (and
analogously for control), differenced. Used by the Bayesian bootstrap
and related weighted-resampling machinery; see
InferenceBayesianBootstrap.
Always leaves the standard error and degrees of freedom unavailable
(NA) regardless of estimate_only — the Newcombe interval
method has no separate variance quantity to compute on this path.
InferenceIncidNewcombeRiskDiff$compute_asymp_confidence_interval()
Computes a \(1-\alpha\) Newcombe hybrid Wilson-score
confidence interval for the risk difference (see class documentation
for the full formula), via newcombe_independent_ci_cpp.
InferenceIncidNewcombeRiskDiff$compute_asymp_two_sided_pval()
Computes a two-sided p-value testing \(H_0: p_T - p_C =
\code{delta}\) by numerically finding (stats::uniroot) the
significance level \(\alpha\) at which delta falls exactly on
the boundary of the Newcombe confidence interval (see class
documentation) — there is no closed-form p-value for this method.
The search is carried out on \(\log(\alpha)\) so that very small
p-values are resolved accurately. If the null is already outside the
interval at the numerical \(\alpha\) floor, that floor is returned;
if it remains inside as \(\alpha\) approaches one, the p-value is
\(1\).
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 = InferenceIncidNewcombeRiskDiff$new(seq_des)
inf$compute_estimate()
#> [1] -0.0952381
# }