
Adjacent Category Logit Inference for KK Matching-on-the-fly Designs
Source:R/inference_ordinal_KK_cond_adj_cat_logit.R
InferenceOrdinalKKCondAdjCatLogitRegr.RdFits a conditional (stratified) adjacent-category logit model for ordinal
responses under a KK matching-on-the-fly design:
$$\log\frac{\Pr(Y_i = j+1 \mid Y_i \in \{j, j+1\})}{\Pr(Y_i = j \mid Y_i
\in \{j, j+1\})} = \alpha_j + \beta_T W_i + X_i^\top \gamma,$$ for adjacent
category comparisons \(j = 1, \dots, K-1\), with cut-specific intercepts
\(\alpha_j\) and a treatment coefficient \(\beta_T\) constrained equal
across all cuts (the parallel/proportional adjacent-category assumption).
\(\exp(\hat\beta_T)\) is the common adjacent-category odds ratio. Fitting
proceeds by expand_adjacent_category_data_cpp's stacked-binary
expansion (each subject contributes a 0/1 row per adjacent cut they border,
stratified by matched pair) followed by conditional logistic regression on
the expanded data — the matched-pair identity becomes the conditioning
stratum, so the pair's shared nuisance intercept is conditioned out exactly
as in a single binary conditional-logit KK model, and reservoir (unmatched)
subjects each form their own singleton stratum. likelihood_tier =
"partial" (a conditional/partial likelihood, matched-set effects are
profiled out rather than estimated); supports_likelihood_tests() is
hard FALSE — only Wald inference is exposed, not likelihood-ratio,
score, or gradient tests. Validity requires the adjacent-category
proportionality assumption (a common \(\beta_T\) across all \(K-1\)
cuts) in addition to the usual conditional-logit exchangeability-within-strata
assumption induced by the KK design.
References
Agresti, A. (2010). Analysis of Ordinal Categorical Data (2nd ed.). Wiley, for the adjacent-category logit model family; Kapelner, A. and Krieger, A. M. (2014). "Matching on-the-fly: Sequential allocation with higher power and efficiency." Biometrics, 70(2), 378-388, doi:10.1111/biom.12148 , for the KK matching-on-the-fly design this class is built for.
See also
InferenceOrdinalAdjCatLogitRegr
for the non-KK analog. See also:
Ordinal regression
(Wikipedia).
Super class
Inference -> InferenceOrdinalKKCondAdjCatLogitRegr
Methods
Public methods
+ inherited public methods from Inference
Inference$capabilities()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_model_formula()Inference$get_nonestimable_reason()Inference$get_nonestimable_stage()Inference$get_optimization_alg()Inference$get_response()Inference$get_response_type()Inference$get_treatment()Inference$is_nonestimable()Inference$set_optimization_alg()Inference$set_seed()Inference$supports()
InferenceOrdinalKKCondAdjCatLogitRegr$new()
Initialize inference for the conditional adjacent-category
logit model \(\log(\Pr(Y_i = j+1 \mid Y_i \in \{j,j+1\}) / \Pr(Y_i =
j \mid Y_i \in \{j,j+1\})) = \alpha_j + \beta_T W_i + X_i^\top \gamma\)
and prepare KK matched-pair structure for the stratified conditional-logit
fit. Does not fit the model; the fit is deferred to the first call to
compute_estimate() or a method that requires it.
Usage
InferenceOrdinalKKCondAdjCatLogitRegr$new(
des_obj,
verbose = FALSE,
harden = TRUE,
model_formula = NULL,
smart_cold_start_default = NULL
)InferenceOrdinalKKCondAdjCatLogitRegr$compute_estimate()
Fits the conditional adjacent-category logit model via
stacked-binary expansion (expand_adjacent_category_data_cpp)
plus conditional logistic regression, and returns the shared
log-odds-ratio estimate \(\hat\beta_T\).
InferenceOrdinalKKCondAdjCatLogitRegr$compute_estimate_with_bootstrap_weights()
Recomputes the treatment estimate under subject/block-level
bootstrap weights (Bayesian-bootstrap or nonparametric-bootstrap draw
weights, expanded to row level via
private$expand_subject_or_block_weights_to_row_weights()). When
weights are effectively constant, this collapses to the unweighted
compute_estimate() call. Otherwise, rather than refitting the
full expanded conditional-logit model under weights, it calls
weighted_ordinal_bootstrap_surrogate_fit() — a fast weighted
ordinal-logistic surrogate fit on the raw (unexpanded) design matrix —
as an approximation to the weighted adjacent-category likelihood; this
trades exact reweighted refitting for speed across many bootstrap
replicates. No standard error is computed (s_beta_hat_T is
always NA); the surrogate returns NA if the fit fails.
InferenceOrdinalKKCondAdjCatLogitRegr$compute_asymp_confidence_interval()
Wald confidence interval for the shared adjacent-category
log-odds-ratio \(\beta_T\), using the conditional-logit model's
standard error; see InferenceAsymp
for the shared Wald contract. Fits the model first if not already
cached.
InferenceOrdinalKKCondAdjCatLogitRegr$compute_asymp_two_sided_pval()
Return the adjacent-category conditional-logit asymptotic
p-value for the treatment coefficient, using the shared Wald semantics
documented in InferenceAsymp.
Examples
# \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 = InferenceOrdinalKKCondAdjCatLogitRegr$new(seq_des)
inf$compute_estimate()
#> [1] NA
# }