adapt_orm: Adaptive orm Fit For a Single Continuous Predictor

View source: R/adapt_orm.r

adapt_ormR Documentation

Adaptive orm Fit For a Single Continuous Predictor

Description

Finds the best fitting orm model for a single continuous predictor x, starting by finding the link function with the smallest deviance when the predictor is modeled with 4 knots in a restricted cubic spline function. Then the function finds the number of knots minimizing AIC when this link function is used. Candidate number of knots are 0 (linear fit), 3, 4, 5, maxk.

Usage

adapt_orm(x, y, maxk = 6, ...)

Arguments

x

a numeric vector

y

a numeric or factor variable representing an ordinal dependent variable, or an Ocens object

maxk

maximum number of knots to try

...

arguments to orm other than family, x, y

Value

the best orm fit object

Author(s)

Frank Harrell

Examples

## Not run: 
f <- adapt_orm(age, blood_pressure)
f$stats['d.f.']   # print no. of parameters for age
f$family          # print optimum link found

## End(Not run)

rms documentation built on Feb. 18, 2026, 9:07 a.m.