ridgeregr: Ridge regression

Description Usage Arguments Details Value See Also Examples

Description

This is our own created ridge regression function

Usage

1
ridgeregr(formula, data, lambda = 0)

Arguments

formula

A formula on the form response~first_predictor + second_predictor + ... . The response variable and all predictors must be in the data set provided.

data

The data set from which to choose the predictors and the response variable in the formula.

lambda

The value of lambda, lambda = 0 as default which is equals to OLS.

Details

This is a linear regression with one extra shrinkage parameter(lambda). Note that the data should be normalized before using this function.

Value

An object of S3-type class "ridgeregr": A list of nine elements, including fitted values and residuals.

See Also

The methods that use the ridgeregr class:predict.ridgeregr.

Examples

1
ridgeregr(Petal.Length~Sepal.Width+Sepal.Length, data=iris, lambda=10)

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