Skip to contents

Fits a partial proportional-odds cumulative-logit model for an ordinal response: a subset of covariates named in nonparallel are allowed a separate coefficient at each cumulative threshold (relaxing the proportional-odds/parallel-lines assumption for exactly those covariates), while every other covariate — including the treatment indicator, which is always fit as a parallel (proportional) term regardless of nonparallel — keeps one shared coefficient across all thresholds. The reported treatment effect is therefore always a single proportional (threshold-invariant) log-odds shift, even when other covariates' effects are allowed to vary by threshold. When nonparallel is empty, fitting uses this package's fast Rcpp full-proportional-odds solver (fast_ordinal_regression_with_var_cpp); otherwise it falls back, in order, to VGAM::vglm(family = VGAM::cumulative(parallel = ...)), ordinal::clm(nominal = ...), and (only when nonparallel is empty and the earlier fast/VGAM/clm attempts failed) MASS::polr. Each fallback requires its corresponding package to be installed; unavailable packages are silently skipped in favor of the next fallback.

References

Peterson, B., and Harrell, F. E. (1990). "Partial Proportional Odds Models for Ordinal Response Variables." Journal of the Royal Statistical Society, Series C (Applied Statistics), 39(2), 205-217, doi:10.2307/2347760 , for the partial (non-parallel-covariate) proportional-odds model fit here. McCullagh, P. (1980). "Regression Models for Ordinal Data." Journal of the Royal Statistical Society, Series B, 42(2), 109-142, doi:10.1111/j.2517-6161.1980.tb01109.x , for the full proportional-odds model this generalizes (see InferenceOrdinalPropOddsRegr).

Super class

Inference -> InferenceOrdinalPartialProportionalOddsRegr

Methods

+ inherited public methods from Inference


InferenceOrdinalPartialProportionalOddsRegr$new()

Uses the shared randomization two-sided p-value contract; see InferenceRand.

Initialize partial proportional-odds ordinal regression inference for a completed design with an ordinal, uncensored response.

Usage

InferenceOrdinalPartialProportionalOddsRegr$new(
  des_obj,
  verbose = FALSE,
  harden = TRUE,
  model_formula = NULL,
  nonparallel = character(0),
  smart_cold_start_default = NULL
)

Arguments

des_obj

A completed DesignSeqOneByOne object with an ordinal response.

verbose

Whether to print progress messages.

harden

Whether to apply robustness measures.

model_formula

Optional 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.

nonparallel

Names of covariates (not including "treatment", which is always fit as a parallel/proportional term) allowed a separate coefficient at each cumulative threshold, relaxing the proportional-odds assumption for those covariates specifically.

smart_cold_start_default

Whether to use smart cold start values by default.


InferenceOrdinalPartialProportionalOddsRegr$compute_estimate()

Retrieves the estimated (always-parallel) treatment log-odds shift from the partial proportional-odds fit (see class documentation for the fitting backend cascade).

Usage

InferenceOrdinalPartialProportionalOddsRegr$compute_estimate(
  estimate_only = FALSE
)

Arguments

estimate_only

If TRUE, skip variance component calculations.

Returns

The estimated treatment effect.


InferenceOrdinalPartialProportionalOddsRegr$compute_estimate_with_bootstrap_weights()

Recomputes the partial-proportional-odds treatment estimate under subject/block bootstrap weights, used by the Bayesian bootstrap and related weighted-resampling machinery. If the weights are effectively constant, short-circuits to the unweighted $compute_estimate(estimate_only = TRUE). Otherwise refits with weights via the same backend cascade as the unweighted fit (VGAM/ordinal/MASS::polr, each weighted), and if all of those fail, falls back further to a plain weighted binary-logistic surrogate fit (weighted_ordinal_bootstrap_surrogate_fit(..., method = "logistic")) that does not model the ordinal structure at all. Never computes a standard error on any weighted path (s_beta_hat_T is always NA), regardless of estimate_only.

Usage

InferenceOrdinalPartialProportionalOddsRegr$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

Present for interface parity; this method never computes variance components regardless of its value.


InferenceOrdinalPartialProportionalOddsRegr$compute_asymp_confidence_interval()

Computes a Wald-style confidence interval for the treatment log-odds shift, using the model-based standard error from whichever backend (fast Rcpp solver, VGAM, ordinal, or MASS::polr) successfully fit the unweighted model (see class documentation). If that standard error is unavailable (NA, non-finite, or 0) — e.g. because the fit succeeded via a fallback path that doesn't report one — the interval is explicitly marked non-estimable (c(NA, NA)) when private$harden is TRUE, or raises an error otherwise, rather than silently returning a misleading result. Identical to $compute_wald_confidence_interval().

Usage

InferenceOrdinalPartialProportionalOddsRegr$compute_asymp_confidence_interval(
  alpha = 0.05
)

Arguments

alpha

Significance level for the interval.

Returns

A confidence interval for the treatment effect.


InferenceOrdinalPartialProportionalOddsRegr$compute_asymp_two_sided_pval()

Computes a Wald-style two-sided p-value testing \(H_0: \beta_T = \code{delta}\), using the same model-based standard error as $compute_asymp_confidence_interval(); if unavailable, marked non-estimable (NA) or an error is raised, per private$harden — see that method's documentation. Identical to $compute_wald_two_sided_pval().

Usage

InferenceOrdinalPartialProportionalOddsRegr$compute_asymp_two_sided_pval(
  delta = 0
)

Arguments

delta

Null treatment effect to test.

Returns

A two-sided p-value.


InferenceOrdinalPartialProportionalOddsRegr$compute_wald_confidence_interval()

Identical to $compute_asymp_confidence_interval(); provided as an explicit alias for callers that want to name the Wald method directly rather than via the generic "asymptotic" dispatch.

Usage

InferenceOrdinalPartialProportionalOddsRegr$compute_wald_confidence_interval(
  alpha = 0.05
)

Arguments

alpha

Significance level for the interval.

Returns

A confidence interval for the treatment effect.


InferenceOrdinalPartialProportionalOddsRegr$compute_wald_two_sided_pval()

Identical to $compute_asymp_two_sided_pval(); provided as an explicit alias for callers that want to name the Wald method directly rather than via the generic "asymptotic" dispatch.

Usage

InferenceOrdinalPartialProportionalOddsRegr$compute_wald_two_sided_pval(
  delta = 0
)

Arguments

delta

Null treatment effect to test.

Returns

A two-sided p-value.


InferenceOrdinalPartialProportionalOddsRegr$benchmark_asymp_two_sided_pval_breakdown()

Diagnostic helper for performance investigation: runs the same computation as $compute_asymp_two_sided_pval() (fit the partial proportional-odds model requiring a standard error, cache the estimate/SE/df, compute the two-sided Wald p-value) but separately times each of the three stages — model fit, cache materialization, and final p-value arithmetic — via proc.time(). If the fit fails or has no usable standard error, returns immediately with only fit_time populated and every other timing/result field NA.

Usage

InferenceOrdinalPartialProportionalOddsRegr$benchmark_asymp_two_sided_pval_breakdown(
  delta = 0
)

Arguments

delta

Null treatment effect to test.

Returns

A named list: fit_time, cache_time, pval_math_time, total_time (all in seconds), pval, beta_hat_T, and s_beta_hat_T.


InferenceOrdinalPartialProportionalOddsRegr$clone()

The objects of this class are cloneable with this method.

Usage

InferenceOrdinalPartialProportionalOddsRegr$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.