
Partial Proportional-Odds Regression Inference for Ordinal Responses
Source:R/inference_ordinal_partial_proportional_odds.R
InferenceOrdinalPartialProportionalOddsRegr.RdFits 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
Public methods
InferenceOrdinalPartialProportionalOddsRegr$compute_estimate()InferenceOrdinalPartialProportionalOddsRegr$compute_estimate_with_bootstrap_weights()InferenceOrdinalPartialProportionalOddsRegr$compute_asymp_confidence_interval()InferenceOrdinalPartialProportionalOddsRegr$compute_asymp_two_sided_pval()InferenceOrdinalPartialProportionalOddsRegr$compute_wald_confidence_interval()InferenceOrdinalPartialProportionalOddsRegr$compute_wald_two_sided_pval()InferenceOrdinalPartialProportionalOddsRegr$benchmark_asymp_two_sided_pval_breakdown()
+ 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()
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_objA completed
DesignSeqOneByOneobject with an ordinal response.verboseWhether to print progress messages.
hardenWhether to apply robustness measures.
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.nonparallelNames 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_defaultWhether 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).
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.
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().
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().
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.
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.
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.