Skip to contents

This function predicts values based on Nearest Shrunken Centroid model objects.

Usage

forecast_by_nsc(
  object,
  newx,
  type = c("response", "class", "posterior", "centroid", "nonzero"),
  newoffset,
  ...,
  threshold,
  target = 2L
)

Arguments

object

an object of class Trained

newx

the new values at which prediction are to be made

type

character specifying the type of prediction. Three options are available

"response"

predicted values are on the same scale as the outcome, e.g. for binomial the returned values are classes

"class"

the class labels corresponding to the max probability

"posterior"

posterior probabilities

"centroid"

(unshrunken) class centroids

"nonzero"

index of genes surviving the threshold

newoffset

currently not used

...

further arguments to pamr.predict

threshold

The desired threshold value

target

(optional) integer, index of the target class. If provided, only the prediction for the selected class are returned (default to second level of factor response). Set to NULL to return all classes. Used when type = "posterior" or type = "centroid"

Value

A vector containing the predictions.

See also

Author

Alessandro Barberis