fastglm_score_test: Score tests for ordinal model terms and coefficient contrasts

View source: R/ordinal-profile.R

fastglm_score_testR Documentation

Score tests for ordinal model terms and coefficient contrasts

Description

Evaluates ordinary or mean-bias-adjusted likelihood scores under linear constraints, after re-estimating the nuisance parameters. The information matrix and, when requested, the bias adjustment refer to the full model.

Usage

fastglm_score_test(
  object,
  terms = NULL,
  contrast = NULL,
  null = 0,
  null.estimation = c("ML", "meanBR"),
  control = list()
)

Arguments

object

a converged ordinal model, including a nonparallel model, with retained dense data and every declared category observed.

terms

formula terms, or location coefficient names for a matrix fit. The default jointly tests all location slopes.

contrast

numeric vector or matrix of linear coefficient contrasts, as in fastglm_wald_test(). Named columns may select a subset of parameters.

null

hypothesized contrast values; a scalar is repeated across rows.

null.estimation

"ML" for ordinary constrained likelihood scores, or "meanBR" for constrained full-model adjusted scores. The default is ML even when object was fitted with bias reduction.

control

named numerical controls, shared with ordinal profile inference. maxit=300 limits constrained scoring iterations; score.tol=1e-7 bounds each nuisance score divided by the square root of its expected information; and step.tol=1e-7 bounds the largest remaining cumulative-predictor change. max.step=4 caps each predictor update (the adjusted-score solver caps it at one), max.halves=35 limits step reductions, and condition.tol=1e-14 is the native information-conditioning threshold. For profile intervals, root.tol=1e-6 is measured in fitted standard-error units, max.root=100 limits root iterations, and max.expand=25 limits endpoint-bracket doublings beyond the initial normal-approximation distance. These last three controls do not affect score tests. Exhausting a profile search yields a missing endpoint, not an assertion of an unbounded confidence interval.

Details

Let B span the nuisance directions allowed by the constraints, I be full-model expected information, and U the selected score vector. The test removes the nuisance component using U_e=U-IB(B^TIB)^{-1}B^TU, and reports U_e^T I^{-1}U_e. With null.estimation="meanBR", constrained fitting solves B^TU^*=0 using the adjustment of the full model; it does not recompute a bias adjustment for a smaller model with the tested columns removed.

For independent ordinal observations or integer frequency counts, fixed parameter dimension, an interior true parameter, and nonsingular limiting information, with the usual local smoothness and consistent constrained estimation, the statistic has a first-order chi-square reference with one degree of freedom per independent constraint. The mean-bias adjustment is order one, while the likelihood score is order square root of sample size. This establishes the same first-order reference, not a higher-order calibration result or exact small-sample inference. No resampling is used.

Infeasible starts, failed nuisance fits, singular information, or exhausted iterations return an unavailable test with an explanation. A finite bias-reduced estimate does not guarantee a successful constrained fit. For nonparallel models, constraints and all nuisance updates retain ordered cumulative predictors at each positive-frequency training row. Equality contrasts between a predictor's threshold-specific slopes test its common slope restriction while allowing other predictors to remain nonparallel. Tests of a term's zero effects are different from tests of equal slopes. Streaming fits and collapsed or empty categories are currently unsupported.

Value

A fastglm_test object with the package's common printed table, numeric as.data.frame() extraction, and constrained-fit diagnostics.

References

Kosmidis, I. (2014). Improved estimation in cumulative link models. Journal of the Royal Statistical Society: Series B, 76, 169–196. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/rssb.12025")}. The nuisance projection and full-model constrained adjustment used here specify the implementation beyond the paper's general discussion of adjusted-score tests.

Examples

fit <- fastglm_ordinal(Sat ~ Infl + Type + Cont, MASS::housing, weights=Freq)
fastglm_score_test(fit, terms="Type")
fastglm_score_test(fit, terms="Type", null.estimation="meanBR")

fastglm documentation built on Nov. 11, 2026, 5:07 p.m.