Learn R Programming

oem (version 1.01)

predict.oemfit: make predictions from a fitted "oemfit" object

Description

Similar to other predict methods, this function produces fitted values from a fitted "oemfit" object.

Usage

## S3 method for class 'oemfit'
## S3 method for class 'oemfit':
predict(object, newx, s = NULL,
                          type = c("response",
                          "coefficients",
                          "nonzero"), ...)

Arguments

object
fitted oemfit object.
newx
matrix of new values for x at which predictions are to be made. Must be a matrix.
s
Value(s) of the penalty parameter lambda at which predictions are required. Default is the entire sequence used to create the model.
type
not used.
...
additional predict arguments.

Value

  • Fitted response returned.

Details

Predicted values returned as a vector

References

Xiong, S., Dai, B. and Qian, P. Z. G. (2011), Orthogonalizing Penalized Regression, http://www.stat.wisc.edu/~zhiguang/OEM.pdf

See Also

oemfit, print.oemfit, plot.oemfit

Examples

Run this code
x=matrix(rnorm(100*20),100,20)
y=rnorm(100)
fit <- oemfit(y~x)
newx=matrix(rnorm(50*20), 50, 20)
pred <- predict(fit, newx)

Run the code above in your browser using DataLab