Skip to contents

Fits Anderson's (1984) stereotype logit model for ordinal responses (see fast_stereotype_logit_cpp for the full reduced-rank multinomial-softmax formula and reparameterization): a single linear predictor \(\eta_i = \beta_T W_i + X_i^\top \gamma\) is scaled by a category-specific score \(\phi_k \in [0,1]\) (jointly estimated, monotone in \(k\)) in a softmax over all \(K\) categories, rather than assuming a single proportional/parallel effect across cuts as InferenceOrdinalContRatioRegr/ InferenceOrdinalKKCondAdjCatLogitRegr do. This makes the stereotype model a genuinely more flexible (multinomial-logit-like, reduced-rank) alternative to the standard proportional-odds/adjacent-category/continuation-ratio ordinal families, at the cost of a less directly interpretable treatment coefficient (\(\beta_T\) enters multiplicatively through the \(\phi_k\) scores rather than as a single additive log-odds-ratio). likelihood_tier = "full": likelihood-ratio, score, gradient, and Wald tests are all available when the model converges, plus parametric-likelihood-bootstrap calibration of the likelihood-ratio test.

Computes the randomization distribution of the treatment effect estimate under the sharp null.

Whether compute_rand_two_sided_pval() is actually usable on this instance right now – FALSE exactly when it would stop(): an incidence-response instance with no custom randomization statistic and a design not eligible for design-randomization-based incidence inference (see private$should_use_design_randomization_for_incidence()). TRUE for every other case, including every non-incidence response type. Public, self-contained (only reads already-set instance state, no side effects), so InferenceSuite can check this before attempting the sentinel instead of relying on the stop() being silently swallowed into a pval = NA "ok" row – the single source of truth for both this check and compute_rand_two_sided_pval()'s own guard, so the two can never drift apart.

Computes a randomization-based p-value.

Value

When debug = FALSE (default), a numeric vector of length r. When debug = TRUE, a list with: values, errors (list of character vectors, one per iteration), warnings (list of character vectors, one per iteration), num_errors, num_warnings, prop_iterations_with_errors, prop_iterations_with_warnings, and prop_illegal_values.

A single logical.

Randomization p-value.

Details

compute_lik_ratio_two_sided_pval() can be anti-conservative at small \(n\). The stereotype model's category-score parameters \(\phi_k\) are a Davies (1977) non-regular case, not identified when \(\beta_T\) is at/near zero – exactly the neighborhood every null hypothesis test sits in – so the LR statistic's null distribution need not be the chi-square(1) this method assumes. The size of the problem depends on the constrained refit: before 2026-09-21 the delta-constrained refit started cold and could stall in a much worse local optimum (e.g. neg-log-likelihood 131.3 vs the full fit's 118.9 at \(\delta\) equal to the MLE itself), which inflated the LR statistic and produced ~18-23% Type-I error at \(n = 100\); it also collapsed the bootstrap and inverted-LR confidence intervals to zero width. The refit now also starts from the full-fit parameters and keeps the better fit. Measured after that change (400 simulated null datasets, 5 response categories, a continuous covariate): about 6.5% Type-I error and 0.93 confidence-interval coverage at \(n = 100\), with no zero-width intervals, and about 13% Type-I error at \(n = 50\) with 3 categories (169 converged fits). Part of the small-sample excess comes from the likelihood being multimodal: in a few percent of \(n = 50\) fits the reported point estimate sits at a local optimum whose likelihood is below that of another optimum, which makes the LR statistic at the estimate positive rather than zero. For small samples, prefer the better-calibrated alternatives on this class: compute_lik_ratio_bootstrap_two_sided_pval() (parametric-bootstrap calibration via the class's own null simulation; ~6-7% Type-I error) and the cheaper compute_lik_ratio_bartlett_two_sided_pval() (Monte-Carlo Bartlett correction; ~4% Type-I error); those two figures predate the refit change and were not re-measured. Both are roughly 20-40x slower per call than the raw chi-square test (a fresh bootstrap/Monte-Carlo refit at every delta candidate), which is why they are excluded from this package's own routine comprehensive test suite (see comprehensive_slow_paths.R). compute_lik_ratio_two_sided_pval() itself is left unchanged (not silently recalibrated) to avoid an undocumented behavior change to an existing method's contract. Bayesian-bootstrap inference is temporarily unavailable because the current non-uniform weighted hook fits a cumulative-logit surrogate rather than the stereotype likelihood. It will remain disabled until the native weighted stereotype-logit backend described in the package implementation plan lands.

References

Anderson, J. A. (1984). "Regression and Ordered Categorical Variables." Journal of the Royal Statistical Society, Series B, 46(1), 1-30, doi:10.1111/j.2517-6161.1984.tb01276.x , for the stereotype logit model.

See also

InferenceOrdinalContRatioRegr for a proportional (non-reduced-rank) ordinal alternative. See also: Ordinal regression (Wikipedia).

Super class

Inference -> InferenceOrdinalStereotypeLogitRegr

Methods

+ inherited public methods from Inference


InferenceOrdinalStereotypeLogitRegr$approximate_randomization_distribution_beta_hat_T()

Usage

InferenceOrdinalStereotypeLogitRegr$approximate_randomization_distribution_beta_hat_T(
  r = 501,
  delta = 0,
  transform_responses = "none",
  show_progress = TRUE,
  permutations = NULL,
  debug = FALSE,
  zero_one_logit_clamp = .Machine$double.eps
)

Arguments

r

Number of randomization vectors. Default 501.

r

Number of randomization vectors.

delta

The null difference. Default 0.

delta

Null difference.

transform_responses

Type of transformation. Default "none".

transform_responses

Transformation.

show_progress

Show progress bar. Default TRUE.

show_progress

Show progress.

permutations

Pre-computed permutations. Default NULL.

permutations

Pre-computed permutations.

debug

If TRUE, return a list with the distribution values and per-iteration diagnostics including error messages, warning messages, counts of each, and summary proportions for iterations with errors, warnings, and illegal (non-finite) values. Runs serially. Default FALSE.

zero_one_logit_clamp

The clamping amount for exact 0 and 1 values when logging

zero_one_logit_clamp

The clamping amount for exact 0 and 1 values when logging


InferenceOrdinalStereotypeLogitRegr$supports_rand_pval_for_incidence()

Usage

InferenceOrdinalStereotypeLogitRegr$supports_rand_pval_for_incidence()


InferenceOrdinalStereotypeLogitRegr$compute_rand_two_sided_pval()

Usage

InferenceOrdinalStereotypeLogitRegr$compute_rand_two_sided_pval(
  r = 501,
  delta = 0,
  transform_responses = "none",
  na.rm = TRUE,
  show_progress = TRUE,
  permutations = NULL,
  zero_one_logit_clamp = .Machine$double.eps
)

Arguments

r

Number of randomization vectors. Default 501.

r

Number of randomization vectors.

delta

The null difference. Default 0.

delta

Null difference.

transform_responses

Type of transformation. Default "none".

transform_responses

Transformation.

na.rm

Remove NAs.

show_progress

Show progress bar. Default TRUE.

show_progress

Show progress.

permutations

Pre-computed permutations. Default NULL.

permutations

Pre-computed permutations.

zero_one_logit_clamp

The clamping amount for exact 0 and 1 values when logging

zero_one_logit_clamp

The clamping amount for exact 0 and 1 values when logging


InferenceOrdinalStereotypeLogitRegr$clone()

The objects of this class are cloneable with this method.

Usage

InferenceOrdinalStereotypeLogitRegr$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.