orm.fit | R Documentation |
Fits ordinal cumulative probability models for continuous or ordinal
response variables, efficiently allowing for a large number of
intercepts by capitalizing on the information matrix being sparse.
Five different distribution functions are implemented, with the
default being the logistic (yielding the proportional odds
model). Penalized estimation and weights are also implemented, as in '[lrm.fit()]'.
The optimization method is Newton-Raphson with step-halving, or the Levenberg-Marquart method.
The latter has been shown to converge better when there are large offsets.
Execution time is is fast even for hundreds of thousands of intercepts. The limiting factor
is the number of intercepts times the number of columns of x
.
orm.fit(x=NULL, y, family=c("logistic","probit","loglog","cloglog","cauchit"),
offset, initial, opt_method=c('NR', 'LM'),
maxit=30L, eps=5e-4, gradtol=0.001, abstol=1e10,
minstepsize=0.01, tol=.Machine$double.eps, trace=FALSE,
penalty.matrix=NULL, weights=NULL, normwt=FALSE, scale=FALSE, mscore=FALSE,
inclpen=TRUE, y.precision = 7, compstats=TRUE, onlydata=FALSE, ...)
x |
design matrix with no column for an intercept |
y |
response vector, numeric, factor, or character. The ordering of levels
is assumed from |
family |
a character value specifying the distribution family, corresponding to logistic (the
default), Gaussian, Cauchy, Gumbel maximum ( |
offset |
optional numeric vector containing an offset on the logit scale |
initial |
vector of initial parameter estimates, beginning with the
intercepts. If |
opt_method |
set to |
maxit |
maximum no. iterations (default= |
eps |
difference in |
gradtol |
maximum absolute gradient before convergence can be declared. |
abstol |
maximum absolute change in parameter estimates from one iteration to the next before convergence can be declared; by default has no effect |
minstepsize |
used to specify when to abandon step-halving |
tol |
Singularity criterion. Default is typically 2e-16 |
trace |
set to |
penalty.matrix |
a self-contained ready-to-use penalty matrix - see |
weights |
a vector (same length as |
normwt |
set to |
mscore |
set to |
scale |
set to |
inclpen |
set to |
y.precision |
When ‘y’ is numeric, values may need to be rounded
to avoid unpredictable behavior with |
compstats |
set to |
onlydata |
set to |
... |
ignored |
a list with the following components, not counting all the components produced by 'orm.fit':
call |
calling expression |
freq |
table of frequencies for |
yunique |
vector of sorted unique values of |
stats |
vector with the following elements: number of observations used in the
fit, number of unique |
fail |
set to |
coefficients |
estimated parameters |
family , famfunctions |
see |
deviance |
-2 log likelihoods. When an offset variable is present, three deviances are computed: for intercept(s) only, for intercepts+offset, and for intercepts+offset+predictors. When there is no offset variable, the vector contains deviances for the intercept(s)-only model and the model with intercept(s) and predictors. |
lpe |
vector of per-observation likelihood probability elements. An observation's
contribution to the log likelihood is the log of |
non.slopes |
number of intercepts in model |
interceptRef |
the index of the middle (median) intercept used in
computing the linear predictor and |
linear.predictors |
the linear predictor using the first intercept |
penalty.matrix |
see above |
info.matrix |
see |
Frank Harrell
Department of Biostatistics, Vanderbilt University
fh@fharrell.com
orm
, lrm
, glm
,
gIndex
, solve
,
recode2integer
#Fit an additive logistic model containing numeric predictors age,
#blood.pressure, and sex, assumed to be already properly coded and
#transformed
#
# fit <- orm.fit(cbind(age,blood.pressure,sex), death)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.