Skip to contents

Fits 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

+ inherited public methods from Inference


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
)

Arguments

des_obj

A completed KK DesignSeqOneByOne object with an ordinal response.

verbose

Flag for progress messages.

harden

Whether to apply robustness measures.

model_formula

Optional formula for covariate adjustment.

smart_cold_start_default

Whether to use smart cold start values by default.


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\).

Usage

InferenceOrdinalKKCondAdjCatLogitRegr$compute_estimate(estimate_only = FALSE)

Arguments

estimate_only

If TRUE, skip standard-error computation and cache only the point estimate; used by randomization and bootstrap resampling paths.


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.

Usage

InferenceOrdinalKKCondAdjCatLogitRegr$compute_estimate_with_bootstrap_weights(
  subject_or_block_weights,
  estimate_only = FALSE
)

Arguments

subject_or_block_weights

Subject-, block-, cluster-, or matched-set bootstrap weights.

estimate_only

If TRUE, compute only the weighted point estimate.


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.

Usage

InferenceOrdinalKKCondAdjCatLogitRegr$compute_asymp_confidence_interval(
  alpha = 0.05
)

Arguments

alpha

Two-sided miscoverage rate; the returned interval targets 1 - alpha coverage.


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.

Usage

InferenceOrdinalKKCondAdjCatLogitRegr$compute_asymp_two_sided_pval(delta = 0)

Arguments

delta

Null hypothesis treatment effect.


InferenceOrdinalKKCondAdjCatLogitRegr$clone()

The objects of this class are cloneable with this method.

Usage

InferenceOrdinalKKCondAdjCatLogitRegr$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

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
# }