
GEE Inference for KK Designs with Binary Response
Source:R/inference_incidence_KK_combined.R
InferenceIncidKKGEE.RdFits a Generalized Estimating Equations (GEE) model with a binomial family
and logit link, \(\mathrm{logit}\,\Pr(Y_i = 1 \mid x_i) = x_i^\top\beta\),
for binary (incidence) responses under a KK matching-on-the-fly design, using
an exchangeable working correlation structure where each cluster is
either a matched pair (2 members) or a reservoir singleton (1 member) — see
$compute_estimate()'s method-level documentation for the full fitting
contract (internal Rcpp solver vs. geepack fallback, hardening/retry
behavior). GEE is used here purely to fit one marginal model jointly across
matched-pair and reservoir subjects while accounting for the within-pair
correlation the matching induces, not as a longitudinal/repeated-measures
tool. Inference is quasi-likelihood/estimating-equation based
(likelihood_tier = "quasi"): standard errors are GEE sandwich (robust)
standard errors, not model-likelihood-based.
Under (quasi-)complete separation (fitted probabilities numerically 0 or
1) the logit GEE has no finite solution: the fitter stops at a huge estimate and
the sandwich standard error collapses with it. The standard error is then treated
as unavailable, so the asymptotic p-value and confidence interval are NA
(not a spurious \(p \approx 0\)), with one warning of class
edi_logistic_separation_warning per object (silent inside resampling).
The point estimate is returned unchanged. Use a randomization test
($compute_rand_two_sided_pval()), an exact incidence method, or fewer
covariates instead.
Subsampling and m-out-of-n
(v1.0.6-TODO-230.) At the default size \(b = m = \lfloor n^{0.7} \rfloor\) a draw can be
degenerate: a treatment arm with no events or only events. Its log odds ratio then sits where the fitter stopped (about \(\pm 20\)),
not in the sampling law the pivot estimates, so the draw is NaN in
approximate_subsampling_distribution_beta_hat_T() and
approximate_m_out_of_n_bootstrap_distribution_beta_hat_T() (also with debug = TRUE)
and is not used. If fewer than min_fraction_usable_samples (default 0.8, user-settable since
v1.0.6-TODO-269) of the B draws are usable (degenerate and failed draws both count against
it), the subsampling / m-out-of-n p-value or interval is NA with reason
"subsampling_too_few_usable_draws_fraction" or "m_out_of_n_too_few_usable_draws_fraction"
and one edi_procedure_na_warning. The p-value is symmetric: the share of usable pivot draws
\(\sqrt{b}(\hat\theta^* - \hat\theta)\) (subsampling also divides by \(\sqrt{1 - b/n}\)) at
least as large in absolute value as \(\sqrt{n}(\hat\theta - \delta)\), floored at \(1/B\), rather
than the equal-tailed \(2\min\{\cdot\}\), because at small \(b\) the law of a log ratio is skewed
toward the observed effect and the equal-tailed rule doubles the heavy tail. The interval is the basic
(equal-tailed) one. Null size at \(n = 80\) (200 data sets, B = 199, nominal 0.05, before and
after): Wald 0.055; subsampling 0.000 to 0.005, m-out-of-n 0.000 before and after (the pivot is wider than the Wald scale at this size); intervals that were NA (2% and 10%) are now finite. The ordinary bootstrap is the better resampling method for this estimand.
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 | pairs + reservoir | regular | theory | [Fisher1935], [LehmannRomano2005] |
wald | asymptotic | \(O(n_{eff}^{-1})\) | pairs + reservoir | regular | assumed default | [Hall1992] |
jackknife | asymptotic | \(O(n_{eff}^{-1})\) | pairs + reservoir | regular | assumed default | [ShaoTu1995] |
bootstrap | asymptotic | \(O(n_{eff}^{-1})\) | pairs + reservoir | regular | assumed default | [Hall1992] |
bayes_boot | asymptotic | \(O(n_{eff}^{-1})\) | pairs + reservoir | regular | assumed default | [Rubin1981], [Lo1987] |
rand_bootstrap | asymptotic | \(O(n_{eff}^{-1})\) | pairs + reservoir | 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
Liang, K.-Y., and Zeger, S. L. (1986). "Longitudinal Data Analysis Using Generalized Linear Models." Biometrika, 73(1), 13-22, doi:10.1093/biomet/73.1.13 , for the GEE estimating-equation framework and sandwich variance estimator 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 -> InferenceIncidKKGEE
Methods
+ 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$is_nonestimable()Inference$set_estimand()Inference$set_optimization_alg()Inference$set_seed()Inference$supports()
InferenceIncidKKGEE$new()
Initialize KK binary-response GEE inference, validate the
matched/reservoir design, and prepare the exchangeable-working-correlation
binomial (logit-link) GEE fitting machinery used by
InferenceIncidKKGEE.
Usage
InferenceIncidKKGEE$new(
des_obj,
model_formula = NULL,
use_rcpp = TRUE,
verbose = FALSE,
smart_cold_start_default = NULL
)Arguments
des_objA completed
Designobject with an incidence response.model_formulaOptional formula for covariate adjustment.
use_rcppWhether to use the internal Rcpp GEE solver (
TRUE, default) with automatic fallback togeepack::geeglmon failure, or always usegeepack::geeglmdirectly (FALSE).verboseWhether to print progress messages.
smart_cold_start_defaultWhether to use smart cold start values.
Examples
seq_des = DesignSeqOneByOneKK14$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), x2 = rnorm(1)))
}
seq_des$add_all_subject_responses(rbinom(30, 1, 0.5))
inf = InferenceIncidKKGEE$new(seq_des)
inf$compute_estimate()
#> [1] 1.063609
# }