predict.blrm: Make predictions from a 'blrm()' fit

predict.blrmR Documentation

Make predictions from a blrm() fit


Predict method for blrm() objects


## S3 method for class 'blrm'
  kint = NULL,
  ycut = NULL,
  zcppo = TRUE,
  fun = NULL,
  funint = TRUE,
  type = c("lp", "fitted", "fitted.ind", "mean", "x", "data.frame", "terms", "cterms",
    "ccterms", "adjto", "", "model.frame"), = FALSE,
  codes = FALSE,
  posterior.summary = c("mean", "median", "all"),
  cint = 0.95


object, ..., type,, codes

see 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).


a function to evaluate on the linear predictor, e.g. a function created by Mean() or Quantile()


set to FALSE if fun is not a function such as the result of Mean(), Quantile(), or ExProb() that contains an intercepts argument


set to 'median' or 'mode' to use posterior median/mode instead of mean. For some types 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.


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.


Frank Harrell

See Also



## Not run: 
  f <- blrm(...)
  predict(f, newdata, type='...', posterior.summary='median')

## End(Not run)

rmsb documentation built on Sept. 26, 2023, 5:11 p.m.