predict.mfp: Predict method for mfp fits

View source: R/predict.mfp.R

predict.mfpR Documentation

Predict method for mfp fits

Description

Obtains predictions from an "mfp" object

Usage

  ## S3 method for class 'mfp'
predict(object, newdata,
  type = c("link", "response", "lp", "risk", "expected", "terms"), terms,
  ref = NULL, seq = NULL, se.fit = FALSE, dispersion = NULL,
  na.action = na.pass, collapse, safe = FALSE, ...)

Arguments

object

an "mfp" object.

newdata

optionally, a data frame in which to look for variables with which to predict. If omitted, the fitted linear predictors are used.

type

the type of prediction required. The default is on the scale of the linear predictors; the alternative "response" is on the scale of the response variable. The "terms" option returns fitted values of each term on the linear predictor scale. This is useful for visualizing the effects for fractional polynomials.

terms

A character vector specifiying the variables for which to return fitted values. The default is all non-factor selected terms. Only relevant if type = "terms".

ref

a list of reference values for each term. This is the value relative to which contrasts are computed. Defaults to the mean value of the variable.

seq

a list of numeric vectors for each term specifiying the input values for which contrasts should be computed.

se.fit

logical switch indicating if standard errors are required.

dispersion

the dispersion of the GLM fit to be assumed in computing the standard errors. If omitted, that returned by summary applied to the object is used.

na.action

function determining what should be done with missing values in newdata. The default is to predict NA.

collapse

optional vector of subject identifiers. If specified, the output will contain one entry per subject rather than one entry per observation.

safe
...

further arguments used by predict.glm or predict.coxph.

Value

If type = "terms", a list with term predictions for each variable including the contrast to the reference value, standard errors, and contrasts of the first and second derivative.

Otherwise, a prediction object based on predict.glm or predict.coxph.

See Also

predict.glm, predict.coxph


mfp documentation built on July 26, 2023, 5:30 p.m.