predict.ridgeregr: Print the fitted values of a ridgeregr object

Description Usage Arguments Value See Also Examples

Description

A method that prints out the fitted values of the ridge regression model, possibly for new data.

Usage

1
2
## S3 method for class 'ridgeregr'
predict(x, x_values = "default")

Arguments

x

A ridgeregr object.

x_values

Optional. If included, the predictions are made on these x_values instead.

Value

a numeric vector of fitted values.

See Also

predict. The generic function from which predict.ridgeregr is created.

Examples

1
2
3
4
a <- ridgeregr(Petal.Length~Sepal.Width+Sepal.Length, data=iris, lambda=10)
predict(a) # The fitted values
df <- data.frame(Petal.Length=runif(n = 150, min = -1.5, max = 1.5), x2=runif(n = 150, min = -2, max = 2.5),x3 = runif(n = 150, min = -1.5, max = 1.5) )
predict(x=a, x_values = df) # Predicted on the new x-values in the df data.frame.

thozh912/Lab7 documentation built on May 31, 2019, 11:18 a.m.