Skip to contents

Initialize KK Newcombe risk-difference IVWC inference and prepare matched/reservoir paired-binomial components used by InferenceIncidKKNewcombeRiskDiff.

Computes the compound Newcombe risk-difference point estimate \(\hat\theta = w_1 \hat\theta_1 + w_2 \hat\theta_2\) on the risk-difference (probability) scale, where \(\hat\theta_1\) is the paired-Newcombe discordant-pair estimate from matched pairs and \(\hat\theta_2\) is the independent-Newcombe estimate from reservoir subjects, combined by inverse-variance weighting \(w_j \propto 1/\widehat{\mathrm{Var}}(\hat\theta_j)\) (falls back to the single available component when one has zero subjects). Caches intermediate match/reservoir statistics for reuse by compute_asymp_confidence_interval() and compute_asymp_two_sided_pval().

Usage

KKNewcombeRiskDiffIVWCSource

Details

Implements a compound Newcombe risk-difference estimator for KK designs. This class pools information from matched pairs (using the Paired Newcombe method) and the reservoir (using the Independent Newcombe method) via inverse-variance weighted combination (IVWC).

The matched-pair component applies the paired Newcombe (Method-10-style Wilson-score) interval to the discordant pairs to estimate the treatment effect and its variance (Newcombe 1998). The reservoir component applies the independent-samples Newcombe interval, treating unmatched subjects as two independent binomial samples. The two component estimates \(\hat\theta_1, \hat\theta_2\) are combined by inverse-variance weighting, \(\hat\theta = w_1 \hat\theta_1 + w_2 \hat\theta_2\), \(w_j = (1/\hat V_j) / \sum_k (1/\hat V_k)\), the standard IVWC framework used throughout the package's KK inference classes. likelihood_tier = "none": this is a closed-form Wilson-score-type estimator, not a fitted likelihood model, so no likelihood-ratio or parametric-bootstrap methods are exposed. If a design has no matched pairs or no reservoir subjects, the single available component is used directly rather than combined.

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

Examples

# \donttest{
seq_des = DesignSeqOneByOneKK14$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), x2 = rnorm(1)))
}
seq_des$add_all_subject_responses(rbinom(10, 1, 0.5))
inf = InferenceIncidKKNewcombeRiskDiff$new(seq_des)
inf$compute_estimate()
#> [1] 0
# }