View source: R/ordinal-profile.R
| fastglm_score_test | R Documentation |
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.
fastglm_score_test(
object,
terms = NULL,
contrast = NULL,
null = 0,
null.estimation = c("ML", "meanBR"),
control = list()
)
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 |
null |
hypothesized contrast values; a scalar is repeated across rows. |
null.estimation |
|
control |
named numerical controls, shared with ordinal profile
inference. |
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.
A fastglm_test object with the package's common printed table,
numeric as.data.frame() extraction, and constrained-fit diagnostics.
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.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.