blrm()
fitPredict method for blrm()
objects
# S3 method for blrm
predict(
object,
...,
kint = NULL,
ycut = NULL,
zcppo = TRUE,
Zmatrix = TRUE,
fun = NULL,
funint = TRUE,
type = c("lp", "fitted", "fitted.ind", "mean", "x", "data.frame", "terms", "cterms",
"ccterms", "adjto", "adjto.data.frame", "model.frame"),
se.fit = FALSE,
codes = FALSE,
posterior.summary = c("mean", "median", "all"),
cint = 0.95
)
a data frame, matrix, or vector with posterior summaries for the requested quantity, plus an attribute 'draws'
that has all the posterior draws for that quantity. For type='fitted'
and type='fitted.ind'
this attribute is a 3-dimensional array representing draws x observations generating predictions x levels of Y.
see rms::predict.lrm()
This is only useful in a multiple intercept model such as the ordinal logistic model. There to use to second of three intercepts, for example, specify kint=2
. The default is the middle intercept corresponding to the median y
. You can specify ycut
instead, and the intercept corresponding to Y >= ycut
will be used for kint
.
for an ordinal model specifies the Y cutoff to use in evaluating departures from proportional odds, when the constrained partial proportional odds model is used. When omitted, ycut
is implied by kint
. The only time it is absolutely mandatory to specify ycut
is when computing an effect (e.g., odds ratio) at a level of the response variable that did not occur in the data. This would only occur when the cppo
function given to blrm
is a continuous function. If type='x'
and neither kint
nor ycut
are given, the partial PO part of the design matrix is not multiplied by the cppo
function. If type='x'
, the number of predicted observations is 1, ycut
is longer than 1, and zcppo
is TRUE
, predictions are duplicated to the length of ycut
as it is assumed that the user wants to see the effect of varying ycut
, e.g., to see cutoff-specific odds ratios.
applies only to type='x'
for a constrained partial PO model. Set to FALSE
to prevent multiplication of Z matrix by cppo(ycut)
.
set to FALSE
to exclude the partial PO Z matrix from the returned design matrix if type='x'
a function to evaluate on the linear predictor, e.g. a function created by Mean.blrm()
or Quantile.blrm()
set to FALSE
if fun
is not a function such as the result of Mean.blrm()
, Quantile.blrm()
, or ExProb.blrm()
that contains an intercepts
argument
set to 'median'
or 'mode'
to use posterior median/mode instead of mean. For some type
s set to 'all'
to compute the needed quantity for all posterior draws, and return one more dimension in the array.
probability for highest posterior density interval. Set to FALSE
to suppress calculation of the interval.
Frank Harrell
rms::predict.lrm()
if (FALSE) {
f <- blrm(...)
predict(f, newdata, type='...', posterior.summary='median')
}
Run the code above in your browser using DataLab