
GEE Inference for KK Designs with Ordinal Response
Source:R/inference_ordinal_KK_combined.R
InferenceOrdinalKKGEE.RdFits a proportional-odds local-odds-ratio Generalized Estimating
Equations model, via multgee::ordLORgee, for ordinal responses under a
KK matching-on-the-fly design, using the treatment indicator and,
optionally, all recorded covariates as predictors. Each GEE cluster is
either a matched pair (2 members) or a reservoir singleton (1 member) — GEE
is used here purely to fit one marginal cumulative-logit 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. Unlike the other Inference*KKGEE
classes in this family (continuous/count/incidence/proportion, which use an
internal Rcpp solver or geepack::geeglm with an exchangeable working
correlation), this ordinal class always requires the multgee package
and has no use_rcpp option. The raw multgee treatment coefficient
is negated when reported so that, consistently with EDI's other ordinal
estimators, a positive estimate means movement toward higher response
categories. Inference is quasi-likelihood/
estimating-equation based (likelihood_tier = "quasi"): standard
errors are GEE sandwich (robust) standard errors, not model-likelihood-based.
Bayesian-bootstrap inference is temporarily unavailable because
multgee::ordLORgee does not accept the non-uniform observation
weights needed to refit the same clustered estimator. It will remain
disabled until the weighted ordinal-GEE implementation planned for v1.1.0
is complete.
Under (quasi-)complete separation (for example every treated subject in the
top category), the fit has no finite solution and the sandwich standard error
collapses. The class then warns once (edi_logistic_separation_warning)
and returns NA for the asymptotic p-value and confidence interval, and
the jackknife methods return NA with an edi_procedure_na_warning
(reason jackknife_full_data_separation); the point estimate is
unchanged. Use the randomization test, merge sparse categories, or fit fewer
covariates.
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] |
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
Touloumis, A. (2015). "R Package multgee: A Generalized Estimating Equations Solver for Multinomial Responses." Journal of Statistical Software, 64(8), 1-14, doi:10.18637/jss.v064.i08 , for the local-odds-ratio GEE solver used here; 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 underlying GEE estimating-equation framework.
[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.
[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 -> InferenceOrdinalKKGEE
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()
InferenceOrdinalKKGEE$new()
Initialize KK ordinal GEE inference, validate the ordinal
matched/reservoir design, and prepare the multgee::ordLORgee
proportional-odds local-odds-ratio GEE fitting machinery used by
InferenceOrdinalKKGEE. Requires
the multgee package; errors at construction if it is not installed.
Usage
InferenceOrdinalKKGEE$new(
des_obj,
model_formula = NULL,
verbose = FALSE,
smart_cold_start_default = NULL
)Arguments
des_objA completed
Designobject with an ordinal response.model_formulaOptional formula for covariate adjustment. If
NULL(default), the formula from the design object is used and its pre-computed design matrix is reused. If a formula is provided, a new design matrix is constructed from the design's imputed covariates.verboseWhether to print progress messages.
smart_cold_start_defaultWhether to use smart cold start values.
InferenceOrdinalKKGEE$compute_estimate_with_bootstrap_weights()
Recomputes the KK ordinal treatment estimate under
subject/block bootstrap weights. In EDI this hook is called only by the
Bayesian bootstrap, which is disabled for this class (see the class
description), so no built-in inference method reaches it; it runs only
when called directly. If the supplied weights are all
(numerically) equal, this short-circuits to the unweighted
$compute_estimate(estimate_only = TRUE) (the multgee
proportional-odds GEE fit) rather than refitting. Otherwise, since
multgee::ordLORgee does not support observation weights, this
falls back to a different, approximating model: a plain
(non-GEE, no matched-pair clustering) weighted proportional-odds
ordinal logistic regression via
fast_ordinal_regression_weighted_cpp, treating the
coefficient on the first predictor column as the treatment effect.
This always leaves the standard error and degrees of freedom
unavailable (s_beta_hat_T = NA, df = Inf) regardless of
estimate_only, since it is a point-estimate-only fallback path.
Examples
if (requireNamespace("multgee", quietly = TRUE)) {
# \donttest{
seq_des = DesignSeqOneByOneKK14$new(n = 10, response_type = 'ordinal')
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(sample(1:4, 10, replace = TRUE))
inf = InferenceOrdinalKKGEE$new(seq_des)
inf$compute_estimate()
# }
}
#> [1] 4.311489